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 KenD

I'm working on my first JS game using Impact. I really like what the engine has to offer, and so far I've been able to put together a decent prototype in a remarkably short period of time. However, I'm at the point where I could use some advice on how to proceed. We're building a game with a 2.5D look to it (think Battletoads only less frustrating.) The player is confined to 2 "lanes", can move forward and backward, can jump and slide and can collect coins and get various power ups including a shield, blaster and jetpack (it's a kids' game.) Most of that wouldn't be a big deal at all if it were strictly 2D, but adding in that extra half dimension makes things complicated.

I know how to make the player move in any direction, but in order to do so, I basically have to throw out the built in physics, and I'd like to keep that for the jump and slide. I'm unsure if I should skip using a collisionMap in favor of hard-coding upper and lower bounds to each level.

I'm also wondering if it's possible (or a good idea) to change the collision box during gameplay. I was looking at the hitbox plugin at: https://github.com/quidmonkey/Hitbox-Plugin but I'm not sure how that differs from the built-in collision box. The idea is that if the player is sliding, the hitbox should shrink and if the player is flying, they should still collect coins; I was thinking of keeping the hitbox below the animation.

I've been searching for examples of this type of game and the closest thing I've found is Bored to Death, which is close but doesn't quite fit what I'm trying to do. Any insight/advice is most welcome :)

1 decade ago by auz1111

I'm working on a similar project - http://impactjs.com/forums/help/2d-scrolling-platformer-jumping/page/1#post17953

1 decade ago by quidmonkey

I erased my hitbox plugin - too much confusion. Use offset in conjunction with size instead.

The best way to understand how it works is to turn on the debugging module and Show Entity Collision Boxes.

But take a 16x16 Entity as an example. If I set offset: { x: 1, y: 1 } and size: { x: 14, y: 14 }, this will draw an Entity with a 14x14 hitbox. Think of size as your hitbox, and offset as how much to offset that hitbox from the left and top of your Animation frame.
Page 1 of 1
« first « previous next › last »