Unfinished particle system.
Lost interest quickly. May come back later and rip it all out.
This commit is contained in:
parent
3927b3963e
commit
f95b91a64c
2
index.js
2
index.js
|
@ -9,7 +9,7 @@ var express = require('express');
|
|||
log.setMode(0);
|
||||
process.title = "Server"
|
||||
setInterval(function(){ updateInfo()},5000)
|
||||
log.logRight(1, `Uptime: ${(performance.now() - startTime)/100}`);
|
||||
|
||||
function updateInfo() {
|
||||
log.setInfo(server.games)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
<span class ="left"><p>left</p></span>
|
||||
<span class="canvasStack">
|
||||
<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 class ="right"><p>right</p></span>
|
||||
|
||||
|
|
|
@ -4,8 +4,12 @@ export var canvas = document.getElementById('canvas');
|
|||
export var ctx = canvas.getContext('2d');
|
||||
export var hud = document.getElementById('hud');
|
||||
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.height = game.tileSize*game.gridSize[1];
|
||||
hud.width = canvas.width
|
||||
hud.height = canvas.height
|
||||
hud.width = canvas.width;
|
||||
hud.height = canvas.height;
|
||||
parti.width = canvas.width;
|
||||
parti.height = canvas.height;
|
||||
|
|
26
www/scripts/display/particle.js
Normal file
26
www/scripts/display/particle.js
Normal 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
import {render } from "./draw.js"
|
||||
var RUNNING = false
|
||||
var RUNNING = false;
|
||||
var animationStage = 0;
|
||||
export function start() {
|
||||
if (!RUNNING) {
|
||||
RUNNING = true
|
||||
RUNNING = true;
|
||||
loop();
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function get() {
|
|||
async function loop() {
|
||||
if (RUNNING === true)
|
||||
setTimeout(function(){
|
||||
if (animationStage < 2) {
|
||||
if (animationStage < 6) {
|
||||
animationStage = animationStage + 1;
|
||||
} else {
|
||||
animationStage = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import './display/draw.js';
|
||||
import './game/game.js'
|
||||
import './interface/mainmenu/menu.js'
|
||||
import '/scripts/display/draw.js';
|
||||
import '/scripts/game/game.js'
|
||||
import '/scripts/interface/mainmenu/menu.js'
|
||||
import "/scripts/net/netcode.js"
|
||||
|
|
|
@ -111,6 +111,12 @@ span.button:hover {
|
|||
z-index: 1;
|
||||
position: absolute;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
.canvas3 {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
transform: translate(-50%, 0);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue