L
Lobos
Guest
Hi guys!
I need some help with my game, hope someone can help me out. I try to make a player-guided platform, which can move along a pre-determined path indefinetly. I think maybe it works with paths, but I can’t figure it out, how.
My goals are:
I started with a simple path
Aaand stuck - maybe If I change the speed (5 in this example) to a variable and make a step event to swap speed/negative speed when pressed the left/right button, but thats hardly the most elegant and easy way, if it works at all.
Can I make a simple If I press the button, move towards the left path endpoint? (there are more than one path, so the fixed coordinates don't work for me)
Hope you got some usefull code/suggestion.
Thanks for the help/time for read all of this.
I need some help with my game, hope someone can help me out. I try to make a player-guided platform, which can move along a pre-determined path indefinetly. I think maybe it works with paths, but I can’t figure it out, how.
My goals are:
- the player have two inputs (like GO LEFT/GO RIGHT) - thats OK, code done, a simple "if(keyboard_check("
- the object can only move along the path - thats OK too (if I use a path and use "absolute: true")
- the object could move toward the two endpoint at any time, when the player press one of the buttons, even when the path is curved, a loop or other shape (and stops, when no button pressed) - without a path, I use "if pressed; x +=" - maybe I could swap x with a path endpoint?
- the object stops when reaches one endpoint, but don’t go backwards, unless the player press the other button
- the object cannot leave the path - thats OK with path
- also, the player start in the middle of the path, but I can avoid this by simply make a separate spawn point
I started with a simple path
Code:
path_start(path0, 5, path_action_continue, true);
Can I make a simple If I press the button, move towards the left path endpoint? (there are more than one path, so the fixed coordinates don't work for me)
Hope you got some usefull code/suggestion.
Thanks for the help/time for read all of this.
Attachments
-
406.5 KB Views: 16