Flash jump'n'run -> The Adventures of Tinger

huesforalice wrote:

@maroxe: What exactly do you mean by "heightfiled terrain"? The terrain is composed of boxes, but as soon as I give you the aforementioned link, you'll be able to understand how it's built.


me wrote:
a heightfield terrain, it's something like that:

Image


and i want to assign to it a shape like that:


Image
Also, bugreport:
Attachment:
tinger.png
tinger.png [ 445.27 KiB | Viewed 991 times ]

While attempting to jump from the ground directly onto that platform. He's standing at an angle.
@Boris: I'd have to check the code again, but I'm pretty sure that I'm only setting the velocity. I also aply a counterforce to gravity as long as he is not moving and touching the ground, so that he doesn't slip down the slopes. About your bug report, the angle that tinger stands in is defined by the normalvector of his collission with ground. So if he stands on the edge of a collissionbox, he'll stand at an angle. I don't really consider this to be a serious bug, but thanks for pointing it out!

@maroxe: I'll go into detail about that in my upcoming blogentry. I'll post you the link in this thread.
ok
and how do you limit rotation of your charactere controller?
Would be nice if it weren't limited to 24fps (on a 4ghz core 2 duo here)... I'm a first person shooter player so I absolutely despise low framerates. Changing that to a max of 40+ would increase my enjoyment tenfold.
Please check out: http://www.huesforalice.com/project/box2d_tinger to answer some of your questions. There is a version of the game with a physics debug view online as well, which hopefully will help you understand some of the details.

@dc443: The computation of the game is based on the framerate, so at the moment the game would be running twice as fast if i put it up to 50 frames. But you're right, the next time I'll try and implement the game so that the framerate isn't limited.
😀 i am thankfull
Code:
The angle at which the characters stand is determined by the collission vector between every character and the ground object it is standing on.
how do you perform that?
Code:
void MyContactListener::Add  ( const b2ContactPoint *  point   )  {
//point->shape2 is the character controller
b2Vector2 original(0, 1);
b2Mat22 mat(orginal, point->normal);
point->shape2->setXForm(body>getPosition(), mat.GetAngle());
}
???
Thanks, that's pretty cool. You've obviously made a pretty nice level editor there, as well as a game, judging by the screenshot.

I'm astonished how effective it is setting a one way platform just by setting and unsetting it's solidity.. That basically solves the problem as far as I'm concerned, which is good as it's a reasonably frequent question on these boards. It's a pity how you can get Tinger to stand on the corner of the platforms at an angle, but I don't think that is too hard to resolve either.

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