When walking between rooms/frames
This is probably a simple one, but I haven't been able to figure it out.
When your character moves from one frame to another, is there a built in mmf function so that the character will appear correctly in the next frame? If for an example you would jump between frames in a platformer, the character would have to maintain its speed, angle etc, and appear at the correct coordinates in the frame relative to the previous frame. How is this done?
The way I'm doing it now is to simply "create object" at start of frame, and having static doors that links the frames. This is obviously not the best sollution.
Edit: So, is this solved by storing xy-cordinates, speed, direction etc as variables when leaving the frame, and then using them to determine the start position on the next frame? Or is there an easier way?
Re: When walking between rooms/frames
Either that, or to make things quicker made each frame much bigger, and always centre the frame so it jumps (or smoothly scrolls, like in old zelda games), to the next "screen". That's what i'd do.
Re: When walking between rooms/frames
Äh. Right. I didn't think of that at all. I suppose that's what most people do. =)
Re: When walking between rooms/frames
not really.
if you want to continue movement from 1 frame to another. you must store all of the movement value you are using.
now most people WILL be storing the x & y movment of your character, and also the actual x & y position onscreen.
so if your character goes out of the left of screen, you can jump to the next frame (or whichever), and at the beginning of each frame, you set the characters position.
(i.e) if the charcters actual x position < 0 (out of screen left) then set the actual x position to the (frame width + actual x position)
the next actual x position will be to the right.
heres an example:
your man is travelling at x speed of -2 (eg, x=x+ x speed) : moving left.
his actual x position = -2 (now he went out of screen to the left)
JUMP FRAME:
start of frame -> actual x = (framewidth + actual x)
ie: frame of 640 wide. x=640+ -2 (x now = 638)
he still should be moving at -2.
you just make sure you "GLOBALLY" store his values from frame to frame.
best way is to make the man a global object, and store all of his movement values in his alterable values.