Today I started to familiarise myself to GameMaker: Studio. GameMaker was used to created games such as the popular Hotline Miami and Spelunky.
I started by creating a simple sprite, rotating and saving it 4 times facing up, down, left and right. I designed a quick background to look like grass and made a room to contain it. Finally, I created an object using my sprites as the base, adding events to allow the player to move in the four directions using the directional key pads.
keyboard_check(): Selects which key you wish to assign the command to.
direction: Using 0 – 360 degrees to select which direction you wish to move.
speed: The higher the number, the faster the movement in the given direction.
sprite_index: Selects the sprite you wish to use once the key is pressed.
As a result, the games now runs like this.