Game Maker – Character Select Tutorial

July 21, 2020



A nice simple/efficient way to create character select screens in game maker ^)^

Codes used in tutorial:

obj_char_select

Create:

global.char_s = 0
image_index = 0
image_speed = 0

Step:

if global.char_s = 2
{
global.char_s = 0
}

Left Released:

visible = false
room_goto_next()

obj_next:

Left Pressed:

image_index += 1
global.char_s += 1

obj_char:

Create:

if global.char_s = 0
instance_change(obj_char_1,true)

if global.char_s = 1
instance_change(obj_char_2,true)
with obj_char_select {instance_destroy()}

Link to download example:

Nguồn: https://bestcitiestolivein.net/

Xem thêm bài viết khác: https://bestcitiestolivein.net/game/

All Comments

  • Can u please fix link?

    sir pie July 21, 2020 2:47 pm Reply
  • I must be dumber than a box of rocks. I changed it a bit to make it a selection between 4 characters and it only rotates between 1 and 3. So when I hit the arrow it goes to the next image correctly but only the first is correct. 1 to 1, 2 to 3, 3 to 1 and 4 to 3.

    Daron Thomas July 21, 2020 2:47 pm Reply
  • Download doesn't work 🙁

    TASJackson July 21, 2020 2:47 pm Reply
  • if you have game maker studio i have a advanced version (i dont know if his version works but for me not :D)
    obj_char_select:

    STEP:
    IF YOU HAVE ONLY 2 CHARACTERS 
    if global.char_s = 2
    {
    global.char_s = 0
    }
    IF YOU HAVE ONLY 3 CHARATERS
    if global.char_s = 3
    {
    global.char_s = 0
    }
    IT IS THE SAME BUT THIS IS ONLY WARNING!!
    obj_char:

    CREATE:
    AGAIN IF YOU HAVE 2 CHAR THIS:
    if global.char_s = 0 {
        instance_create(x,y,o_char_1)
    }
        else
    if global.char_s = 1 {
        instance_create(x,y,o_char_2)
    }
    AND IF YOU HAVE MORE, THIS:
    if global.char_s = 0 {
        instance_create(x,y,o_char_1)
    }
        else
    if global.char_s = 1 {
        instance_create(x,y,o_char_2)
    }
        else
    if global.char_s = 2 {
        instance_create(x,y,o_char_3)
    }
        else
    if global.char_s = 3 {
        instance_create(x,y,o_char_4)
    }
        else
    if global.char_s = 4 {
        instance_create(x,y,o_char_5)
    }
    etc..

    That Richard July 21, 2020 2:47 pm Reply
  • _________________________________________
    ERROR in
    action number 1
    of Create Event
    for object obj_char:

    Error in code at line 1:
       if global.char_s = 0
                ^
    at position 11: Unknown variable char_s

    Mike Kane July 21, 2020 2:47 pm Reply
  • Just thought you should know that the link for the example in the description is broken, but other than that, great tutorial! Helped a lot! 🙂

    minecrafteer03 July 21, 2020 2:47 pm Reply
  • I did exactly what you did and when i click any button, it chooses only 1 character every time. even if i click as example a warrior, it will end up being a mage. any help?

    Bigmakkattack 89 July 21, 2020 2:47 pm Reply
  • Thanks! And a PM or email is good. My email is "rexfurry@gmail.com"

    -Rex ^)^

    rexfurry July 21, 2020 2:47 pm Reply
  • Great tutorial once again! Very helpful as always. I was curious how to contact you as I have a question in regards to your minecraft water video

    TheFantasticGreyFox July 21, 2020 2:47 pm Reply

Leave a Reply

Your email address will not be published. Required fields are marked *