Help with motobike game
Jordeyy
Member Posts: 409
first i was wondering how you would go about doing this
"i want to jump off a ramp on my motobike (that be i know how to do the bit im stuck with is knowing how far i went and having it show up in meters how far my jump was ?
"i want to jump off a ramp on my motobike (that be i know how to do the bit im stuck with is knowing how far i went and having it show up in meters how far my jump was ?
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Change attribute game.StartX to self.Position.X [put this at the top of the rules list]
When [condition for end of jump, e.g. finish line, crash, hit the ground]
.....Change attribute game.EndX to self.Position.X
.....Change attribute game.Distance to game.EndX-game.StartX
You can then use math functions to adjust game.Distance to the unit you want (e.g. meters). For example, if the farthest possible jump is a difference of 300 pixels but you want that to be recorded as 100 meters, you would do:
Change attribute game.Distance to (game.EndX-game.StartX)/3
And then to display the meters:
DisplayText [floor(game.Distance).." meters"]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Anyway, for what it's worth, here's a demo:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User