Unfinished particle system.

Lost interest quickly. May come back later and rip it all out.
This commit is contained in:
Alexander Bass 2022-06-21 09:35:33 -04:00
parent 3927b3963e
commit f95b91a64c
7 changed files with 48 additions and 11 deletions

View file

@ -9,7 +9,7 @@ var express = require('express');
log.setMode(0); log.setMode(0);
process.title = "Server" process.title = "Server"
setInterval(function(){ updateInfo()},5000) setInterval(function(){ updateInfo()},5000)
log.logRight(1, `Uptime: ${(performance.now() - startTime)/100}`);
function updateInfo() { function updateInfo() {
log.setInfo(server.games) log.setInfo(server.games)
} }

View file

@ -19,7 +19,8 @@
<span class ="left"><p>left</p></span> <span class ="left"><p>left</p></span>
<span class="canvasStack"> <span class="canvasStack">
<canvas oncontextmenu="return false;" class="canvas1" id="canvas" width=0 height=0></canvas> <canvas oncontextmenu="return false;" class="canvas1" id="canvas" width=0 height=0></canvas>
<canvas oncontextmenu="return false;" class="canvas2" id="hud" width="0" height="0"></canvas> <canvas oncontextmenu="return false;" class="canvas2" id="parti" width=0 height=0></canvas>
<canvas oncontextmenu="return false;" class="canvas3" id="hud" width="0" height="0"></canvas>
</span> </span>
<span class ="right"><p>right</p></span> <span class ="right"><p>right</p></span>

View file

@ -4,8 +4,12 @@ export var canvas = document.getElementById('canvas');
export var ctx = canvas.getContext('2d'); export var ctx = canvas.getContext('2d');
export var hud = document.getElementById('hud'); export var hud = document.getElementById('hud');
export var hctx = hud.getContext('2d'); export var hctx = hud.getContext('2d');
export var parti = document.getElementById('parti');
export var pctx = parti.getContext('2d');
canvas.width = game.tileSize*game.gridSize[0]; canvas.width = game.tileSize*game.gridSize[0];
canvas.height = game.tileSize*game.gridSize[1]; canvas.height = game.tileSize*game.gridSize[1];
hud.width = canvas.width hud.width = canvas.width;
hud.height = canvas.height hud.height = canvas.height;
parti.width = canvas.width;
parti.height = canvas.height;

View file

@ -0,0 +1,26 @@
class particleHandler {
constructor() {
}
new(type, location) {
const id;
return id;
}
destroy(id) {
}
}
class particle {
constructor(id, type, location, timeout = 6) {
this.id = id;
this.type = type;
this.location = location;
this.timeout = timeout;
}
}

View file

@ -1,9 +1,9 @@
import {render } from "./draw.js" import {render } from "./draw.js"
var RUNNING = false var RUNNING = false;
var animationStage = 0; var animationStage = 0;
export function start() { export function start() {
if (!RUNNING) { if (!RUNNING) {
RUNNING = true RUNNING = true;
loop(); loop();
} }
} }
@ -19,7 +19,7 @@ export function get() {
async function loop() { async function loop() {
if (RUNNING === true) if (RUNNING === true)
setTimeout(function(){ setTimeout(function(){
if (animationStage < 2) { if (animationStage < 6) {
animationStage = animationStage + 1; animationStage = animationStage + 1;
} else { } else {
animationStage = 0; animationStage = 0;

View file

@ -1,4 +1,4 @@
import './display/draw.js'; import '/scripts/display/draw.js';
import './game/game.js' import '/scripts/game/game.js'
import './interface/mainmenu/menu.js' import '/scripts/interface/mainmenu/menu.js'
import "/scripts/net/netcode.js" import "/scripts/net/netcode.js"

View file

@ -107,10 +107,16 @@ span.button:hover {
transform: translate(-50%, 0); transform: translate(-50%, 0);
} }
.canvas2 { .canvas2{
z-index: 1; z-index: 1;
position: absolute; position: absolute;
transform: translate(-50%, 0); transform: translate(-50%, 0);
}
.canvas3 {
z-index: 2;
position: absolute;
transform: translate(-50%, 0);
} }