game maker room switching tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
7,917
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 20, 2010

A Game maker tutorial showing you how to switch in and out of rooms in your game. This works in Game maker lite and pro! (^_^)-b


Player Step code:
if keyboard_check(ord("A"))
{
hspeed=-4
}
else if keyboard_check(ord("D"))
{
hspeed=4
}
if !keyboard_check(ord("A")) and !keyboard_check(ord("D"))
{
hspeed=0
}
if keyboard_check(ord("W"))
{
vspeed=-4
}
else if keyboard_check(ord("S"))
{
vspeed=4
}
if !keyboard_check(ord("W")) and !keyboard_check(ord("S"))
{
vspeed=0
}
if collision_rectangle(x+1,y+1,x+31,y+31,obj_wall,0,1)
{
hspeed=0
vspeed=0
}

Player Collision with wall code:
hspeed=0
vspeed=0

Exit block Collision with player code:
room_goto(rm)other.x=X
other.y=Y

Exit block collision with wall code:
hspeed=0
vspeed=0

Exit block UP code:
rm=rm_name of your room
X=x
Y=room_height-65

Exit block DOWN code:
rm=rm_name of your room
X=x
Y=33

Exit block LEFT code:
rm=rm_name of your room
X=room_width-65
Y=y

Exit block RIGHT code:
rm=rm_name of your room
X=33
Y=y

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (rexfurry)

  • u deserve a hug! hey guys I think the code is wrong for the player movement so you'll need to do it manually, thats what I think I don't mean to be a troll

  • @OfficialNeilnet Oh no! I'm sorry, I just received your comment then noticed everyone else s (for some reason my comments haven't been showing up lately) Anyway, I'll try to get on that code thing as soon as I can ^)^

  • I'm new to this, and I was just wondering if you would try to help me with a problem I'm having. When I'm trying to go to the next room I get a message saying:

    ______________________________­_____________

    FATAL ERROR in

    action number 2

    of Step Event

    for object obj_ship:

    Moving to next room after the last room.

    Could you help me out with this please?

  • @trivettz Is that the whole error?

  • Hey everyone, for those of you who posted questions and other comments that didn't get posted, for some reason I had to approve some of them (it's odd because the comments for this video are set for automatic o_o). Anyway, I went through and approved them all ^)^

  • i did pefect what you did say but it just dussent work

  • @TheBGGAST Hmm, well I can't really help you if I don't know exactly what the problem is. I need to know things like, what was the error, or what about it didn't work. Also, I would recommend using my new and updated room switching tutorial which I have placed in a little annotation in this video.

see all

All Comments (92)

Sign In or Sign Up now to post a comment!
  • @rexfurry ok

  • ERROR in

    action number 1

    of Collision Event with object playerr

    for object exit:

    Error in code at line 1: room_goto(rm)other.x=X  ^

    at position 11: Unknown variable rm

    Yes rooms are labeled rm_ and player is persistent

  • this strategy works better then the update for if you want to switch in the middle of the room, as if

    entering a house.

  • @technonerd100 example: room_goto(r_room)

    code: room_goto()

  • make a tutorial about when we press a key the obj will shoot like a bullet come out from its weapon.......

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more