I inserted a test score function on the game I'm working on and have it set to destroy the main object and go to the next room which already has that object placed. I also allowed for an else function that displays scoreboard and ends the game if there is no next room. I have currently made only 2 rooms, but when I reach the 2000 score required to advance, it displays the scoreboard and ends rather than going to the next room. Oh! I also have this posted under the step event.
Any help in resolving this issue would be greatly appreciated.
Game Maker 8.1 Lite not recognizing room.
Started by trivettz, Feb 27 2012 01:39 AM
5 replies to this topic
#1
Posted 27 February 2012 - 01:39 AM
#2
Posted 27 February 2012 - 01:44 AM
It's a bit hard to help you from your post. Please post the code.
#3
Posted 27 February 2012 - 01:51 AM
Information about object: obj_ship
Sprite: spr_ship
Solid: true
Visible: true
Depth: -100
Persistent: true
Parent:
Mask:
Create Event:
set variable can_shoot to 1
Alarm Event for alarm 0:
set variable can_shoot to 1
Step Event:
if score is equal to 2000
destroy the instance
if next room exists
go to next room with transition effect Create from right
else
show the highscore table
background: back_white
show the border
new color: 16776960, other color: 0
Font: "Times New Roman",10,0,0,0,0,0
end the game
Keyboard Event for Key:
if can_shoot is equal to 1
play sound aud_laser; looping: false
create instance of object obj_laser at relative position (0,0) with speed 10 in direction 360
set variable can_shoot to 0
set Alarm 0 to 10
Keyboard Event for Key:
jump relative to position (-5,0)
if x is smaller than 16
jump relative to position (5,0)
Keyboard Event for Key:
jump relative to position (0,-5)
if y is smaller than 16
jump relative to position (0,5)
Keyboard Event for Key:
jump relative to position (5,0)
if x is larger than room_width-16
jump relative to position (-5,0)
Keyboard Event for Key:
jump relative to position (0,5)
if y is larger than room_height-16
jump relative to position (0,-5)
I appologize in advance if this is not what you meant.
I also went into debug mode and it will allow me to go to the next level, but when I either code it to go to the next level or d&d it to go to the next level it won't recognize that it exists.
Sprite: spr_ship
Solid: true
Visible: true
Depth: -100
Persistent: true
Parent:
Mask:
Create Event:
set variable can_shoot to 1
Alarm Event for alarm 0:
set variable can_shoot to 1
Step Event:
if score is equal to 2000
destroy the instance
if next room exists
go to next room with transition effect Create from right
else
show the highscore table
background: back_white
show the border
new color: 16776960, other color: 0
Font: "Times New Roman",10,0,0,0,0,0
end the game
Keyboard Event for Key:
if can_shoot is equal to 1
play sound aud_laser; looping: false
create instance of object obj_laser at relative position (0,0) with speed 10 in direction 360
set variable can_shoot to 0
set Alarm 0 to 10
Keyboard Event for Key:
jump relative to position (-5,0)
if x is smaller than 16
jump relative to position (5,0)
Keyboard Event for Key:
jump relative to position (0,-5)
if y is smaller than 16
jump relative to position (0,5)
Keyboard Event for Key:
jump relative to position (5,0)
if x is larger than room_width-16
jump relative to position (-5,0)
Keyboard Event for Key:
jump relative to position (0,5)
if y is larger than room_height-16
jump relative to position (0,-5)
I appologize in advance if this is not what you meant.
I also went into debug mode and it will allow me to go to the next level, but when I either code it to go to the next level or d&d it to go to the next level it won't recognize that it exists.
Edited by trivettz, 27 February 2012 - 03:13 AM.
#4
Posted 27 February 2012 - 06:48 AM
'if score is equal to 2000'
you probably want this to change into 'if score is not smaller than 2000'.
Select the 'smaller than' from the list and check the NOT box at the bottom.
you probably want this to change into 'if score is not smaller than 2000'.
Select the 'smaller than' from the list and check the NOT box at the bottom.
#5
Posted 27 February 2012 - 06:59 AM
Probably, the problem is that you have the object in the second room as well. When the second room starts, the ship will execute its step event, detecting that score is already 2000. Since there isn't the third room, it will immediately show the score board as soon as you enter the second room.and go to the next room which already has that object placed.
You should make a different condition for each room, or reset score before the next room starts.
#6
Posted 27 February 2012 - 12:25 PM
Thank you so much! This has fixed my problem.Probably, the problem is that you have the object in the second room as well. When the second room starts, the ship will execute its step event, detecting that score is already 2000. Since there isn't the third room, it will immediately show the score board as soon as you enter the second room.
and go to the next room which already has that object placed.
You should make a different condition for each room, or reset score before the next room starts.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











