Posted in Game Maker Studio

Game Maker Studio Post #4 Temporary Hiatus?

Well this post kinda took some time to be generated… I had my placement training in the morning so yeah… here I am like a little late I suppose?

Any way I haven’t done much, and I just realized that my Game Maker Studio hangs and it doesn’t actually run my game… I don’t know if my games work… I did read from a forum that the game will eventually appear after multiple tries. So I am gonna do that… *sigh

And while I do that let me layout the logic for another game that I usually exploit when I learn something new that is capable of creating a game…

The almost infamous snake game… I never actually liked playing this game as much as I liked making it using different tools …

Sprites

  1. Body – 16 X 16 green square
  2. Food – 16 X 16 red square
  3. Walls – 16 X 16 brown square

Objects

Head of the snake

Sprite Body Sprite

Events
Create – global variables for the length and speed and the future and actual direction
/*
global.length = 3;
global.step_time = 5;
alarm[0] = global.step_time;
dir_future = 0;
dir_actual = 0;
*/
Alarm – create the instance and assign the direction
/*
//Alarm = 0
instance_create (x,y,object_tail)
if dir_future = 0 {dir_actual = 0 ; x += 16 ;}
if dir_future = 1 {dir_actual = 1 ; y -= 16 ;}
if dir_future = 2 {dir_actual = 2 ; x -= 16 ;}
if dir_future = 3 {dir_actual = 3 ; y += 16 ;}
alarm[0] = global.step_time;
*/
Step – For the movement
/*
if keyboard_check (vk_right) && dir_actual != 2{dir_future = 0;}
if keyboard_check (vk_up) && dir_actual != 3 {dir_future = 1;}
if keyboard_check (vk_left) && dir_actual != 0 {dir_future = 2;}
if keyboard_check (vk_down) && dir_actual != 1 {dir_future = 3;}
*/
Collide – With the object wall or the full snakethen restart the game
/*
game_restart()
*/

Tail of the snake

Sprite – Body Sprite

Events
Create – The body logic
/*
alarm[0] = global.step_time * (global.length – 1);
*/
Alarm –  to destroy the body when it moves
/*
instance_destroy()
*/

Full Snake
Parent of the head and the tail

Wall

Sprite – Wall
Just line it up the border in the room… No coding here ?

Food

Sprite – Food
Events
Create – Randomize the position of the food
/*
spawned = false
x = random(room_width)
x -= x mod 16
y = random(room_height)
y -= y mod 16
*/
Collision – with the wall the replace the food
/*
x = random(room_width)
x -= x mod 16
y = random(room_height)
y -= y mod 16
*/

Collision – with the snake … and I am done with the logic I suppose?
/*
if spawned = true {global.length += 1;}
x = random(room_width)
x -= x mod 16
y = random(room_height)
y -= y mod 16
*/

Step – To alter the spawned variable, if when the food is present and when the snake hasn’t eaten it
/*
if !place_meeting(x,y,object_wall) && !place_meeting(x,y,object_snake) {spawned = true;}
*/


Room
Set the background to black. Place the head and the food on to the room… ? after drawing the wall I guess…?

.
.
.
I really find it surprising that I got carried away with this that I ended up totally ignoring my abusive use of Kamojis…

(๑°o°๑)ᵒᵐᵍᵎᵎᵎ

Update :
link

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s