15 49.0138 8.38624 1 0 4000 1 https://pubvision-network.com 300 true 0
theme-sticky-logo-alt

Game Maker Tutorial: Snake Game

28 Comments


A tutorial on how to make a “Snake” game in Game Maker. If you don’t know what Snake is, it’s an old game where you play as a snake. You must collect points while avoiding your tail, which grows longer depending on the score.

This tutorial was requested by halohunter7676.

I would like to have some feedback on this tutorial. Was it too simple or too complex? Did it explain enough or did it explain too much? Should I do tutorials in drag and drop or GML? I want to know what people think, so I can hopefully improve if I make another one in the future.

Wow, it’s been a long time since I last uploaded something…

Nguồn: https://pubvision-network.com/

Xem thêm bài viết khác: https://pubvision-network.com/game/

Previous
Next

28 Comments

  • July 10, 2020 at 12:36 pm
    Reznovelty

    I think I'm using an outdated version of game maker. highscore_show doesn't work. The version I'm using is master collection v1.2.1130 do you know any differnt way of doing this bit?

    Reply
  • July 10, 2020 at 12:36 pm
    Thor Troy

    i tried this but when i run it it creates more parts every time i move insted of when i eat a food object

    Reply
  • July 10, 2020 at 12:36 pm
    isaacanimates

    i wish that i could see

    Reply
  • July 10, 2020 at 12:36 pm
    TH3 R3AP3R

    thank you

    Reply
  • July 10, 2020 at 12:36 pm
    THE PHATMAN

    It was a great tutorial however, I would like the snake to look more real and for you to slow down a bit otherwise it was a very good tutorial…

    Reply
  • July 10, 2020 at 12:36 pm
    Chloe Work

    9:36 special

    Reply
  • July 10, 2020 at 12:36 pm
    August Murko

    Hey if i wanted to just use the code to add a snake tail when eating food where would the code be for that, but the length has to still get longer. I already have a bunch of code and im worried that it will mess up my game

    Reply
  • July 10, 2020 at 12:36 pm
    Declan Was Here

    FATAL ERROR in
    action number 1
    of Create Event
    for object obj_head:

    COMPILATION ERROR in code action
    Error in code at line 4:
    alarm(0)=global.spd
    ^
    at position 2: Unknown function or script: alarm

    Reply
  • July 10, 2020 at 12:36 pm
    بايت - BITE

    _________________________________________
    FATAL ERROR in
    action number 1
    of Alarm Event for alarm 0
    for object object0:

    COMPILATION ERROR in code action
    Error in code at line 1:
    tail-instance_create(x,y,sprite1)
    ^
    at position 5: Assignment operator expected.

    Reply
  • July 10, 2020 at 12:36 pm
    ThatMarDude

    _________________________________________
    FATAL ERROR in
    action number 1
    of Draw Event
    for object obj_control:

    COMPILATION ERROR in code action
    Error in code at line 3:
    draw_text (room_width/3,0"Special Time: "+string (ceil(alarm[0]/30)))
    ^
    at position 27: Symbol , or ) expected.

    Reply
  • July 10, 2020 at 12:36 pm
    Robin D.

    solved! Thx! amazing game!!

    Reply
  • July 10, 2020 at 12:36 pm
    Robin D.

    when I hit the obj_food it shows up the highscore table?

    Reply
  • July 10, 2020 at 12:36 pm
    theANDW20

    how would you reset the high scores?

    Reply
  • July 10, 2020 at 12:36 pm
    PixelsCollide

    Hey! Nice video but I have a problem, on the first time you test the game (when you have only the snake), the compile would never finish, it just stayed at the quote, Entering main loop. If you could help me on this I would be very grateful!

    Reply
  • July 10, 2020 at 12:36 pm
    Arturas Radzevicius

    my body follows the head but it leaves space and if I turn the snake spaces increase more

    Reply
  • July 10, 2020 at 12:36 pm
    drunk troye

    highscore_show doesn't show up?

    Reply
  • July 10, 2020 at 12:36 pm
    Evan Jerick Pili

    when the snake hits the food the head bounces the opposite direction and hits the tail? 🙁

    Reply
  • July 10, 2020 at 12:36 pm
    mrflamefire90

    my game fails to load. compiler states "entering main loop" but nothing happens afterwards

    Reply
  • July 10, 2020 at 12:36 pm
    Falipe Games

    Highscore_show appears to have disappeared in the GML's functions ?

    Reply
  • July 10, 2020 at 12:36 pm
    Kadro Mohamed

    Hi,everything else works with your project execpt my snake keeps moving right and then it repeats and repeats:I also cant control it.Please help.

    Reply
  • July 10, 2020 at 12:36 pm
    The Code Messiah

    Coders help! Line 9 is giving me a compile error. I have no idea why, and I made sure it's the same code as in the video. I'm still new to GML so if i were more experienced I'd probably understand what happened, but I think that the compiler is generating too many tails :/ PLZ HALP

    global.spd = 5
    global.canwarp = true //If true, the snake will warp through walls.
    canturn = false
    image_speed = 0
    alarm[0] = global.spd

    //Generate a short tail behind the snake when the game starts.
    repeat(5) {
    tail = instance_create(x-32*n,y,obj_tail)
    tail.alarm[0] = global.spd*(6-n)
    n-=1
    }

    Reply
  • July 10, 2020 at 12:36 pm
    The Code Messiah

    You should make a new video about this, seeing how it got tons of views, and please write comments on the code if you do c: I had to do so in my own, because I couldn't tell what was happening most of the time :/ But awesome video dude!

    Reply
  • July 10, 2020 at 12:36 pm
    flango

    I did something wrong?

    FATAL ERROR in
    action number 1
    of Draw Event
    for object obj_hud:

    global variable points(100001, -2147483648) not set before reading it.
    at gml_Object_obj_hud_DrawEvent_1 (line 4) – draw_text(room_width/3*2,0,"Score: "+string(global.points))

    Reply
  • July 10, 2020 at 12:36 pm
    Vincent Hoffman

    okay, so I'm doing this for school, right. well, I did everything up until the first test of the game correctly. I checked the codes and everything three times even. but when I tested it it only popped up with the even Made with Game Maker Studios and gets stuck. Does that mean I did something wrong somewhere even after checking all that or Game Maker is just screwing up and I have to start over? also, how could I make my snake have like a more realistic tail (y'know, pointed instead of square) cause if I do it this way with the pointed tail the snake will look odd.

    Reply
  • July 10, 2020 at 12:36 pm
    Jason Cramer

    how would you add an object that on collision, would add like 5 tails instantly to your tail

    Reply
  • July 10, 2020 at 12:36 pm
    Alexandre Slama

    I have the exact sale thing but it won't work PLEASE HELP MAN

    Reply
  • July 10, 2020 at 12:36 pm
    Ba nánek

    When i launch the game i can see only gamemaker studio write on the screen vut nothing launches :/

    Reply
  • July 10, 2020 at 12:36 pm
    JoshJ5Hawk

    Hey bud, nice tut! If I might ask, do you happen to know what the "Magic Number" is for have the tail length go up by 1 for every point you get?

    Reply

Leave a Reply