Sidescroller Demo (Flash)

Hello,

Attached is a sidescroller project I've been working on. Press the arrow keys to move left / right, space to jump. If you ever get "stuck", just hold down jump. Also, you can "push" objects by rolling up to them and jumping sideways off them.

I'm really curious to hear how this performs on other machines - it's kind of ambitious for Flash. The framerate is displayed in the upper left corner.

There really isn't a point to this yet. Just kind of trying to figure out whats fun (and waiting for box2d 2.0). Once you get past the giant falling carrots and the bridge there's just a massive abyss...
Pretty cool, runs fine on an AMD64 3500+. You've got crazy amounts of friction going on there, but it makes it kinda interesting.
Yeah, the "crazy" friction is needed to get the ball to roll when you press the arrow keys. I didn't want it to feel "slippery." The side effect though is you can roll up extremely steep surfaces and the ball can get "stuck" in acute angles.
This is pretty cool. Did you do anything special to it, or is box2d really handling such large level limits in Flash?
The control has a pretty nice feel to it, and I found it very hard to get "stuck". But the steep slopes thing is a problem. The combination of high friction and air control means it is actually possibly to climb sheer walls (or even ones tilted slightly against you). Probably not the intended effect.
Yep, that's pretty much out-of-the-box AS Box2D. But, this is my "World.Step" call:

Code:
world.Step(1/30, 15);


So I'm not exactly giving Box2D all of the resources it deserves. Every time I notice a slow down I cut the "step" parameter in half. It's going to get me in trouble eventually. When I notice slow down it's really hard to tell if it's caused by Flash processing the graphics or Box2D processing the physics.
Hello,

This is very nice game, friction is heavy, it gives it a sticky feel.

May i ask you how did you design your levels ?
Did you use Flash CS3 editor or did you write your own level editor ?

Thanks,

swank
Swank,

I designed the level right within Flash CS3. I've got it set up so I can just drag bodies from the library onto the stage. I described my approach in more detail here:

viewtopic.php?f=8&t=367
Cool, you did a good job. Thanks.
Hey, you did a really good job, it is fun and it feels good.

i wanted to ask you, how do you make the world scroll after the player?
what are the actual object that you relocate?
alonm10 wrote:
i wanted to ask you, how do you make the world scroll after the player?
what are the actual object that you relocate?

I have a "world" movieclip that sits on the stage and contains everything, even the player. The player has an "onEnterFrame" function that simply does this:
Code:
parent.x = 275 - x;
parent.y = 200 - y;

So it just offsets the "world" in the opposite direction of the position of the player.

Original thread: https://box2d.org/forum/viewtopic.php?t=430