Moon Jump Code with X and Y

Started by shark2003, November 20, 2008, 11:27:09 PM

Previous topic - Next topic

shark2003

Okay,I know how to make a moon jump code,but how do I add in the X and Y co ordinates to be able to move the character around while floating??
No matter where you go...there you are...

biolizard89

Quote from: shark2003 on November 20, 2008, 11:27:09 PM
Okay,I know how to make a moon jump code,but how do I add in the X and Y co ordinates to be able to move the character around while floating??
Just make another moon jump code, but with a different activator button and using the X or Y values instead of Z.  Repeat for each type of movement you want.

Black_Wolf

. Simply treat it like another Z co - ord, adding or subtracting based off a button press OR, if you can find it, the address that says which direction you are facing.

Generally in games that don't handle a jump function well, you can only really moon jump North, South, East or West, and maybe the diagonals if you have the time to do it. Just include in your subroutine, this kind of thing in words (depends on if your using gecko code types or asm)

IF holding UP{
   Decrease X co-ordinates by 0x0200
IF holding DOWN{
   Increase X co-ordinates by 0x0200
IF holding LEFT{
   Decrease Y co-ordinates by 0x0200
IF holding RIGHT
   Decrease X co-ordinates by 0x0200



If you have the address for character direction though, you can simplify this so no more buttons need to be added, it just jumps BASED off the direction. Find the ranges for north south east and west in this address, and then do the series of Ifs again, but saying like IF character direction is between 0x04120000 and 0x05630000 Increase X co-ords etc

Igglyboo

I've made a couple of moon jump codes and I would suggest using adding floats instead of normal adding.

Romaap


biolizard89

Or, even better than worrying about adding floats, just set the velocity variable instead of incrementing the position variable.  In several games that I've seen, the XYZ velocity is right after the XYZ prev. position, which is right after the XYZ current position.  So you can often find the velocity by finding the position.  By setting velocity, you let the game worry about how it affects the position, so you don't need to deal with adding floats.  :)

Romaap

yeah, I know that but in some games I just can't find it :confused: