Scrolling Game Development Kit Forum
SGDK Version 1 => Help/FAQ => Topic started by: Shenanigans on 2006-07-17, 10:14:29 AM
-
Is there any way to have the player fall toward the left or right side of the screen, basically switch the gravitational axis?
-
I think a simple script would take car of that... Perhaps somethingn like this?
Sub Player_OnBeforeMoveSprites()
Sprite.DX = Sprite.DX + (Sprite.rDef.SpriteTemplate.GravPow - 10)
Sprite.DY = Sprite.DY - (Sprite.rDef.SpriteTemplate.GravPow - 10)
End Sub
Where Sprite is the sprite you want to be affecting. This will use the gravity set in the sprite dialog. If it doesn't work for some reason, just set the gravity in the sprite dialog to 0 and use a constant value in the script:
Sub Player_OnBeforeMoveSprites()
Sprite.DX = Sprite.DX + 3
End Sub
(Change 3 to more or less to make the gravity stronger or weaker)