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 pixelrevision

I was thinking about buying impact but I have a couple questions about the engine.

1. How do multiple levels get handled along with garbage collection? I see nothing relating to scenes or levels in the docs.

2. How is time stepping managed (especially with physics)? Previous frameworks I have used use delta time for certain things but generally not for physics. How is the rate set on the physics and how does it compare between mobile and desktop?

1 decade ago by stahlmanDesign

Level changing is easy. You can have a trigger in the game that when touched loads a new level. Put this invisible trigger over a door for example, and it loads the level name you either assign in the trigger or you can probably do it in code. Very easy.

Timers are also easy:

var myTimer = new ig.Timer(0.4); // will start counting up from -0.4 seconds

if ( this.myTimer.delta() > 0 ); // timer is up, but keeps counting

this.myTimer.set(0.4); // set back to -0.4 seconds

Not sure about physics engines. I haven't used Impact with Box2D but there are several examples of Impact using Box2D

1 decade ago by pixelrevision

To be more specific with question number 2 I'm wondering how velocity and acceleration get effected across platforms with variable framerates. If a game runs at 20fps on a mobile device and 80fps on a desktop will the actual movement be the same on both platforms or will the mobile game be slower?

A solution to this issue is often to multiply your character's movement by delta time (velocity = 100 * deltatime), but that usually does not work well with a physics engine.

1 decade ago by dominic

All physics in Impact are calculated with a delta value (ig.system.tick) - the time since the last frame. For most tasks you don't have to deal with this delta yourself, but simply set a velocity or acceleration for an entity and the engine will do the rest.

This works well for Impact's built-in physics. I also haven't found any issues with Box2D using the same delta. I guess it works fine as long as the frame rate is relatively stable!?

The ig.Timer description details how edge cases (low fps) are handled.

1 decade ago by maryrosecook

Hiya Dominic. I'm working on an Impact+Box2D game. The framerate that is occasionally unstable, which can result is the player doing mega jumps. Is there anyway I can fix this?

1 decade ago by maryrosecook

Don't worry. I am going to try the suggestion in this thread: http://impactjs.com/forums/help/deterministic-game-loop

Thanks.
Page 1 of 1
« first « previous next › last »