scene.my.flash:= (t)=> {sim.time > scene.my.timer + t ? {scene.my.lamp = 0}:{}}
onCollide = (e)=>{
scene.my.lamp = 1;
scene.my.timer = sim.time
}
update = (e)=>{
scene.my.flash(0.1)
}
_lastShot = 0
_delay = 5
onLaserHit = (e) => {
(sim.time > e.laser._lastShot + e.laser._delay) || (e.laser._lastShot > sim.time) ? {
//do shot
e.laser._lastShot = sim.time
} : {}
}
onCollide = (e)=>{
scene.my.lamp = 1;
scene.my.timer = sim.time
}
update = (e)=>{
scene.my.flash(0.1)
}
_lastShot = 0
_delay = 5
onLaserHit = (e) => {
(sim.time > e.laser._lastShot + e.laser._delay) || (e.laser._lastShot > sim.time) ? {
//do shot
e.laser._lastShot = sim.time
} : {}
}
No hay comentarios:
Publicar un comentario