Platform game:
Scrolling level: 1600x1200
Screen game size: 800x600
For some reason, when throwing a granade straight up (using pinball movement) into the air it blows a bit to the left when the screen is scrolling to me. When the scrolling finally comes to a stop, only then the granade then shoots straight up. But as soon as I move again it starts to blow left again, what ever direction my sprite is facing.
But when I'm on the far right of the level or in a non-scrolling level, I don't have this problem. The granade shoots straight up and comes straight back down.
The event is really quite simple: Press Fire button 2, animation stopped is playing, sprite is facing up = Create granade, and set direction to up.
When I disable the Scrolling events I don't have this problem. So it has something thing to do with that but I can't put my finger on it.
Is there an equation I can add to make the grandade follow where I throw it and not move with the screen?
I can't set its X co-ordinate to X("Player") becasue sometimes I'm throwing it left, right, diagnol up/left, diagnol up/right, diagnol down/left, diagnol down/right. So I was just wondering if I could minus the screen's movement so that it only stays where I throw it. Hmm, it's gonna be tricky but does anyone have a clue???
do you mean like creating an inertia effect? Like adding the player's velocity to the grenade's initial velocity?
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
13th January, 2008 at 11:37:18 -
A solution could be to make it move to the left/right faster if you're throwing them when you're moving. Just have the object have a speed variable that adjusts to when you throw it while walking or standing still.