I'm working on a 2D flickscreen game where hitting the edge of the screen triggers a transition which moves to the next room. I'm wondering how to tell the game which room is the next room.
Each room in my game will have coordinates from a grid. So, I need a structure like this.
[Structure storing Coords - Room Name]
(0,0) - Room 1
(1,0) - Room 2
After triggering the room transition, I need some kind of structure in Gamemaker than can handle this kind of look-up:
[start transition to room on right]
1) Get current room coordinates (input Room 1, (0,0) is retrieved from the structure)
2) Since a right transition, add 1 to x direction of current room coordinates to get the new room coordinates (operation performed on (0,0) to get (1,0))
3) Get next room name from the new room coordinates ((1,0) is searched for in the structure and Room 2 is retrieved)
I've tried reading about 2D arrays and ds_grid / ds_map, but I'm a bit stuck.
Thanks for any help!
Each room in my game will have coordinates from a grid. So, I need a structure like this.
[Structure storing Coords - Room Name]
(0,0) - Room 1
(1,0) - Room 2
After triggering the room transition, I need some kind of structure in Gamemaker than can handle this kind of look-up:
[start transition to room on right]
1) Get current room coordinates (input Room 1, (0,0) is retrieved from the structure)
2) Since a right transition, add 1 to x direction of current room coordinates to get the new room coordinates (operation performed on (0,0) to get (1,0))
3) Get next room name from the new room coordinates ((1,0) is searched for in the structure and Room 2 is retrieved)
I've tried reading about 2D arrays and ds_grid / ds_map, but I'm a bit stuck.
Thanks for any help!