Box2D with Actionscript 3, simulating different timesteps for objects
I've been playing with the box2d engine, and it's great I love it. I'm creating a flash game involving a time traveller, his ability is to slow and speed up time. I'm using different timesteps to simulate a fast and slow motion.
My question is: is it possibl开发者_如何学编程e to run objects at different timesteps? My aim is to make the environment run in slow/fast motion, but I would like my main character to stay normal, so he doesn't get effected by it. If not how would I go about speeding my character up in slow motion or slowing him down in fast motion?
Thanks in advance,
Will@willdonohoe i think @lordcover meant just the movieclips you were using.
As for the box2d objects since the player is speeding up relative to everything, change the timestep like you are and then just speed up the player. if necessary add more iterations to keep it smooth. do the reverse for fast everything else and slow player.
Since Box2D is a physics engine, it only has one world to run the game in, so only one framerate can be applied over the whole scene.
To solve your problem, you have to create many characters each has its animation with different FPS, I mean a (fast character, normal character, slow character) and load the suitable character up on request (this way I think that when you need to load a character it has to be loaded dynamically - say in a seperate swf file).
精彩评论