Jumping!!! (and z-coordinates)

Started by A�rendyll (formerly Yurina), Thu 20/04/2006 18:48:13

Previous topic - Next topic

A�rendyll (formerly Yurina)

Hi all,

I'm making this tiled RPG in which I want the player to be able to jump. I mean jumping so she really jumps. So not only animated! I don't know or I need a 3d plugin or module for this, but I want to know.

My situation:
- I have a character which is able to move in 8 directions which I want to change into 10 (1 extra for jumping, 1 for falling).
- I do not yet have a 3d plugin/module/thingy.
- My backgrounds are TILED so NO GAPS between walkable areas.

So I have some questions:
- Can I even do this in AGS? (I think I can't but it would be awesome if it's possible).
- Do I need a plugin/module/etc. for this for z coordinates? If so, which one?
- Can I combine it with the movement module?
- How much scripting will it take, and of which level? I'm very new to this...
- Is it possible to make the player character hang with her hands on a cliff?

If I really can't make my character jump I'll leave it out of my game.

Thanks in advance,
~Yurina
Yuna: Give me a Y!
Rikku: Give me an R!
Paine: Give me a break...
~Final Fantasy X-2

I've been

DoorKnobHandle

You are mixing a few things up. You wont definately need any kind of 3d module/plugin for jumping. You won't need any z-coordinates either.

Imagine a set of tiles on the ground and the player standing on one of those tiles. Now, when you move the player to the tile left from the player, then you decrease the player's x-position, if you make the player move to the tile above where the player is at the moment, then you decrease the player's y-position and so on. I am sure you already have this in your current project.

Allright, so, now imagine the player jumps. What happens? Well, actually the player moves up and down again. So, you don't need to change any kind of z-coordinate, you need to change the y-coordinate. Decrease it to make him rise and increase afterwards to make him fall again until he is back on his original position.

Of course, this could look like you are simply moving your player to the tile above the player and then back. To fight this impression, you could add a shadow that stays on the original place of the player and make the speed of the jump change (let him start the jump quickly, then let him become slower as the player rises, now comes the "maximum height point" where the player stops rising and then starts to slowly fall again and finally increase the speed of the player falling as he comes closer to the ground again).

That's it. I hope I managed to make everything clear, if not, feel free to ask again and good luck! :)

GarageGothic

#2
Depending on how your game works (that is, whether it is pure 2D or has "depth movement" like traditional adventure games), you may actually need a z-coodinate. And AGS supports it. Check out "z property (character)" in the manual. If you use region interactions it's at least one of the easiest solutions.

SSH

The advantage of the Z coordinate over dkh's suggestion is that it keeps the baseline right for objects, walkbehinds, etc.
12

A�rendyll (formerly Yurina)

I meant jumping in a way that makes you able to reach a ledge which you can't reach if you don't jump. (pretty obvious)

How do I do this? Do I need regions? Or what else?

NOTE: I have a tiled game!

~Yurina
Yuna: Give me a Y!
Rikku: Give me an R!
Paine: Give me a break...
~Final Fantasy X-2

I've been

DoorKnobHandle

Ah, now I see.

Well, that's quite complex, but "here goes nothing":

In order to even draw two "heights" of tiles, you probably need layers. This means you first draw the screen full of floor tiles and then you draw the second floor over whereever you want to have a second floor. Now, when you let the player jump as described above, you first check wether he is currently standing on a first floor tile, that has a second floor tile over it. If there is one, then you don't let him jump at all. If there isn't anything in the way, then you move the player as described above, but you keep track of the current jump height with a variable. This one could be 0 whenever the player stands on the floor and for example 15 on the highest point that the player reaches throughout a jump (if the player jump strength is 15). Now you need to let the player walk around on the floor tiles if he is under for example a height of 10 and place him on the second floor if he is above those 10 units.

This would be my approach, I guess. It should possibly work somehow, although I am sure this is not the only and very unlikely the best way of doing this. :) Good luck!

SMF spam blocked by CleanTalk