1 decade ago by Robodude
I'm trying to think of a good way to come up with a laser entity that sort of works like the missile command rocket. For those of you unfamiliar with missile command, the players primary attack is a line that extends towards the mouse location from a fixed point.
Here is a sample of what I mean: http://js1k.com/2010-first/demo/680
Because I want to simulate a "slow" laser, I thought it would be nice to make a small entity (like size: {x: 3, y: 3}) and spawn them on input.state. This seems to work if the laser is really, really, slow, but if I try to speed it up, the entities move out faster then they are spawned, making the whole 'laser beam' illusion fall apart.
I really like this idea because if something gets in the way of the laser beam, it is interrupted automatically.
So that's my idea for achieving this effect, but since I'm new to ImpactJS I wanted to get some additional ideas for how to do this.
Here is a sample of what I mean: http://js1k.com/2010-first/demo/680
Because I want to simulate a "slow" laser, I thought it would be nice to make a small entity (like size: {x: 3, y: 3}) and spawn them on input.state. This seems to work if the laser is really, really, slow, but if I try to speed it up, the entities move out faster then they are spawned, making the whole 'laser beam' illusion fall apart.
I really like this idea because if something gets in the way of the laser beam, it is interrupted automatically.
So that's my idea for achieving this effect, but since I'm new to ImpactJS I wanted to get some additional ideas for how to do this.