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 RockLeo

Hi everyone,

I decided to learn game development by cloning a NES game and my choice was Battletoads, because there was different kinds of levels and mechanics.

I got some tiles and did the first level (Ragnarok). The looking was great, the player was awesome! But I cant manage to do the jump and falling logic.

Here is pic of the result
[URL=http://imageshack.us/photo/my-images/818/btgame.gif/][IMG]http://imageshack.us/a/img818/4566/btgame.gif[/IMG][/URL]

My first problem is that I cant put gravity on the level, the player falls to the collision layer. So the jumpnfall example doesnt fit here.

I did a jump logic, but I could only achieve a good result using the "this.pos.y" property, which ignores the collision layer.

The second problem are the gap/waterfall. The player needs to fall and this one I have no idea what to do. I was thinking in something like the "kill entity" that Dominic did in the weltmeister video, but no so sure that it's going to work.

I need some ideas or even codes to help me get over this. I did a lot of research, but I dont think my knowledge was enough.

Thx a lot!

1 decade ago by RockLeo

The link was broke, sry.

http://imageshack.us/photo/my-images/818/btgame.gif

1 decade ago by dominic

Well, you're essentially dealing with a real 3D world here; "simulating" this with just x and y coords will be very difficult.

Instead, the x, y should correspond to the ground plane and you'd need an additional z coordinate to keep track of the height: i.e. the platform the player is standing on, or when he's jumping. The world y and world z would then need to be "projected" onto the screen, to form the screen y coordinate.

Maybe there's a simpler way to fake such a 3D effect, but I can't think of one - not if you have platforms of different heights and jumping - i.e. for something like Streets of Rage, you could ignore the z position, but not for Battletoads.

You picked one of the harder games to re-implement. Rare did a very impressive job with Battletoads, especially considering the hardware limits of the NES. Snake Rattle 'n' Roll is equally impressive. There are very few games on the NES (or even SNES) that have real 3D world behind the scenes, ignoring how it's projected on the screen.

1 decade ago by RockLeo

thx Dominic!!

I believe I can do it in a simpler way. If I can check the collision layer I can stop the falling. Something like this:

if (collison layer) // I need this code here
{
   this.pos.y = collision layer.pos.y; // and this one, which means the whole code lol
   this.grounded = true;
   this.jumping = false;
}

I think I can do an entity like the Kill entity you did in the weltmeister video that can change the position of the player in some pos.y++, it will feel like a small fall when touched by the player.

The kill entity I'll use for sure when falling from the waterfall.

Thx!!
Page 1 of 1
« first « previous next › last »