Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by dmarchand

This may be a little difficult to explain, so bear with me :)

I'm working on a 2D top-down game that functions similarly to the 2D zelda games. Impact so far has worked incredibly well for this. (see http://www.danmarchand.com)

I'm running into some issues however with making more customizable collision shapes. I have a stationary "boss" entity that occasionally shoots a sweeping laser. The laser is a simple long rectangler sprite. The top originates from the boss, and anchors there. The sprite then rotates while anchoring the top, sweeping back and forth across the screen. Rendering this is pretty easy, obviously.

However, handling collision is not so easy. You can't just rotate the collision rectangle in impact (at least as far as I'm aware), since all you have is pos.x/y and size.x/y.

One possibility would be to render a series of invisible entities representing the laser's path (like how you would rasterize a line equation), but this would be both expensive and result in rather hokey collision detection (segments of the laser where you would collide just by being nearby, or segments where you wouldn't collide at all, depending on the rectangle rendering).

Has anyone dealt with this before, or does anyone have any ideas?

1 decade ago by paulh

i havent looked at ejecta yet, but if you draw the scan area as vectors/canvas draw within an entity would they get collision by default?
Page 1 of 1
« first « previous next › last »