F
floatingonthewater
Guest
Hello All,
I'm new to programming and have been going through the Space Rocks tutorial, but have run into a problem with the game_restart() function I can't figure out.
Within the switch(room) function I'm using the game_restart() function to restart the game when the player presses the enter button while in rm_win or rm_gameover. This should return the game to the initial room, rm_start, but for some reason after pressing enter the game returns to the second room, rm_game.
I have tried to troubleshoot this problem for the last couple of hours and still can't figure it out. As a test, I replaced game_restart() with room_goto(rm_start), and it works fine. Any thoughts?
I've attached some screenshots of the code.
-- I appreciate any and all help. If there is a better way to format my questions for future posts, please let me know. --
Thanks!
I'm new to programming and have been going through the Space Rocks tutorial, but have run into a problem with the game_restart() function I can't figure out.
Within the switch(room) function I'm using the game_restart() function to restart the game when the player presses the enter button while in rm_win or rm_gameover. This should return the game to the initial room, rm_start, but for some reason after pressing enter the game returns to the second room, rm_game.
I have tried to troubleshoot this problem for the last couple of hours and still can't figure it out. As a test, I replaced game_restart() with room_goto(rm_start), and it works fine. Any thoughts?
I've attached some screenshots of the code.
-- I appreciate any and all help. If there is a better way to format my questions for future posts, please let me know. --
Thanks!
Attachments
-
114.6 KB Views: 7
-
47.8 KB Views: 7