Something moves in pretty much every game believe it or not. This section will go over coding motion into your game. you will learn how to use collisions, friction, and speed to improve the quality of the games movement system. We will first start with making your characters move. There are several ways to do this.
The first method is with Hspeed and Vspeed Hspeed is your horizontal speed. You set it by saying Hspeed = #. The same goes for Vspeed. This will make your object move based on the value of your vspeed and hspeed.
To set up a collision for Hspeed or Vspeed, you simply check for contact with an object.
if Place_meeting(x+4,y,obj_wall) { hspeed = 0; }
Another useful method is to simply change your X and Y values This is simple and easy to set up. You use the code x+=1 to move right, x-=1 to move left. The same goes for moving up and down. Y+=1 to go down and y-=1 to go up! What is great is you can set up collisions the same way as above, but I will show you another method to avoid sticking to walls.
In a Platformer, to have contact with the ground, simply check that your vspeed is greater then 0. This simply means your falling. You then move to contact so you have a close to pixel perfect collision! You then set vspeed to 0.
if vspeed>=0 { move_contact_solid(270,12); vspeed=0; }
Now to stop yourself from running into walls, we use !instance_place. This checks if there is anything in the place specified. If there isn't, it continues on to the code.
if !instance_place(x-3,y,obj_wall) { x-=3 }
These are just 2 easy ways to do movement, but these systems should be done how you want and how you feel they affect your game.