• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Room Changing Issues (FIXED)

K

Keegman

Guest
Okay, so, I am attempting to make a game where there are a couple of rooms that hold text. This is because I want to present some story stuff to the player. The issue I am having is this: the room only switches between the first two rooms.


I have yet to actually write the text, primarily because I wanted to make sure the code worked the way I wanted it, which it unfortunately doesn't. The blue screen will be the title, and the black screen will be the first chunk of text.

Code:
if(keyboard_check_pressed(vk_enter)){
    room_goto_next();
}
Any help will be very appreciated!
Thanks!
 

YoSniper

Member
Some questions:

1) How many rooms do you have?
2) Is this code executed from an object created in the first room?
3) Is said object persistent?
 
Okay, so when you release enter AFTER the black screen, it just returns to the previous room? I am going to foolishly assume you have a controller object persistent throughout the rooms. If the key is pressed it's just going to cycle as long as the button is held.

May want to include some validation to better control your function.

Code:
if(keyboard_check_released(vk_enter)) && (room_exists(room_next(room))){
room_goto_next();
}
 

zATARA_0

Member
if you know what the name of the next room you want to go to is you can just room_goto(nameOfRoom). Maybe in conjunction with storing the rooms in a list in order.
 
K

Keegman

Guest
The issue's been resolved, but I would like to thank you all for giving suggestions.
 
Top