moth now filters events to the correct space
This commit is contained in:
@@ -1,23 +1,10 @@
|
||||
/* main.js – runs the demo with your prototype-based grid */
|
||||
|
||||
var json = use('json')
|
||||
var os = use('os')
|
||||
var draw2d = use('draw2d')
|
||||
|
||||
var blob = use('blob')
|
||||
|
||||
var myblob = new blob
|
||||
myblob.write_bit(1)
|
||||
myblob.write_bit(0)
|
||||
myblob.__proto__.toString = function() {
|
||||
return `[${this.length} bit blob]`
|
||||
}
|
||||
log.console(myblob.toString(), myblob, myblob.length)
|
||||
|
||||
var input = use('input')
|
||||
|
||||
input.watch($_)
|
||||
|
||||
/*──── import our pieces + systems ───────────────────────────────────*/
|
||||
var Grid = use('examples/chess/grid'); // your new ctor
|
||||
var MovementSystem = use('examples/chess/movement').MovementSystem;
|
||||
@@ -339,8 +326,6 @@ function joinServer() {
|
||||
});
|
||||
}
|
||||
|
||||
var os = use('os')
|
||||
|
||||
$_.receiver(e => {
|
||||
if (e.kind == 'update')
|
||||
send(e, update(e.dt))
|
||||
@@ -348,7 +333,6 @@ $_.receiver(e => {
|
||||
send(e, draw())
|
||||
else if (e.type === 'game_start' || e.type === 'move' || e.type === 'greet')
|
||||
log.console("Receiver got message:", e.type, e);
|
||||
if (e.type === 'quit') os.exit()
|
||||
|
||||
if (e.type === 'greet') {
|
||||
log.console("Server received greet from client");
|
||||
@@ -410,4 +394,6 @@ $_.receiver(e => {
|
||||
} else if (e.type === 'key_down') {
|
||||
handleKeyDown(e)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
var parseq = use('parseq', $_.delay)
|
||||
|
||||
Reference in New Issue
Block a user