I'm not even sure if I'm posting in the right place, this being my first post, but, I do not know how to solve an issue I am having with my game. I would really appreciate any help.
I want to make my player object restart the game if it collides with a certain object if the space bar is NOT pressed. If it IS pressed, however, I want a special animation to play and for the object to continue moving. I will attach the current D&D code I have via screenshot.
So far, essentially, I made the variable "Leap" for when I want my character to "Leap" over obj_block2. If Leap = 0, it will play my character's idle animation(spr_player). But if vk_space is pressed, and if Leap is less than or equal to 0, and if obj_block2 is colliding with my current x,y, coordinate, my leap animation plays. I set it so I can only leap when obj_block2 is colliding with my current x and y coordinate. (Ideally I want to make it so I can leap a few frames before I really collide, but that's another story).
Now, however, I want to make it so that if I DON'T press vk_space, the game restarts. If I DO press it, it doesn't restart and I continue playing. I tried attaching Else statements to the vk_space If statement in the screenshot, but all that does is it makes me restart the game as soon as I touch obj_block2, essentially not giving me enough time to press vk_space and do my animation. I don't know what to do. I sincerely apologize if I'm not being very specific. Please let me know if you need more info. Any and all help is appreciated.
I want to make my player object restart the game if it collides with a certain object if the space bar is NOT pressed. If it IS pressed, however, I want a special animation to play and for the object to continue moving. I will attach the current D&D code I have via screenshot.
So far, essentially, I made the variable "Leap" for when I want my character to "Leap" over obj_block2. If Leap = 0, it will play my character's idle animation(spr_player). But if vk_space is pressed, and if Leap is less than or equal to 0, and if obj_block2 is colliding with my current x,y, coordinate, my leap animation plays. I set it so I can only leap when obj_block2 is colliding with my current x and y coordinate. (Ideally I want to make it so I can leap a few frames before I really collide, but that's another story).
Now, however, I want to make it so that if I DON'T press vk_space, the game restarts. If I DO press it, it doesn't restart and I continue playing. I tried attaching Else statements to the vk_space If statement in the screenshot, but all that does is it makes me restart the game as soon as I touch obj_block2, essentially not giving me enough time to press vk_space and do my animation. I don't know what to do. I sincerely apologize if I'm not being very specific. Please let me know if you need more info. Any and all help is appreciated.