Every Object has these variables built in:

x, y, speed, direction, friction, ...


Directions:
0 right, 90 up, 180 left, 270 down


To Create an Instance:

bob = instance_create(x, y, ball)

bob.speed = 10

bob.direction = 270



To Destroy an Instance:

instance_destroy() //this destroys the instance you are coding inside of


with other { //this destroys the instance that is known as the ‘other’ in a collision

instance_destroy()

}


To Create a Special Effect:

effect_create_above(ef_explosion, x, y, 1, c_red) //0 small, 1 medium, 2 large , c_red, c_blue, c_green, …


Sounds:

//add sounds to the sound folder first!

sound_play(boomsound)

sound_play(explosionNoise)

if sound_isplaying(scream) = false {

sound_play(scream)

}


Random:

num = irandom_range(10,20) //10-20 integers only

num = irandom(100) //0-100 integers only

num = random(100) //0-99.9999999 decimals included!

num = random_range(10,20) //10-19.9999999 decimals included!


Rooms:
room_goto(what_you_named_your_room)

room_goto_next()


Messages:

show_message(“Hi There”)


Draw Commands:
Make an object called
drawStuff. Put it in the room.
In the DRAW event, use code like
draw_text(50,100, “hit points”)
draw_text(70,100, string(player.hitpoints) )


Structures:

if x>10 {

//do some stuff

}

else if x>2 {

//do stuff

}

else {

//do other stuff

}


if name=”Bob” {

//hello bob

}

else{

//you are not Bob

}


if name=”Bob” && password=”abc” {

//you may pass

}

if name=”Bob” || name=”Mary” {

//you are my friend

}

&& is how we write AND (shift 7 key)
|| is how we write OR (shift backslash above enter key)