LEARNING TO MAKE AN RPG STYLED GAME IN GAME MAKER PART 2

LEARNING TO MAKE AN RPG STYLED GAME IN GAME MAKER PART 2

As stated at the end of my last blog post found here :

Learning to make an RPG styled game in game maker Part 1

I wrote “I now have a empty “room” with a sprite that moves left , right , up and down with walking animations.” , I am now going to work on developing this more , here is the video i am now following (part 2 in the playlist) if you would like to watch it :

 


Step 1 : Creating A Background / Creating A TileSet

Just like previously i am going to need some resources from online as i do not have our games resources to use , i found this nice set online which is also used in the game , this set of props is called a Tile Set , just like the character sheets we can select certain things from the sheet and it is easy to keep them all together.

Now i have the image , i create a background in game maker named “background_tileset_main” in the properties i have ticked the box that creates this into a tile set and left the option on the default 16 pixels by 16 pixels , this option allows me to select 16 pixels by 16 pixels of the tileset at a time.


 

Step 2 : Creating The Floor Of The Level

Now i have created my tile set i can take it into the “room” that i have which is currently plain and just holds my sprite and i can edit it. When holding shift i can paint the tile i have selected across the grid. First i add the 4 corners and then i add the inside. Here is a GIF of me “painting” the tiles on to the level:

floor

 


Step 3 : Add Detail To The Level

Now i have a plain for me to work on , like a background to the world , now lets add more detail to the level , i now added small things like grass. To do so i need to go on the room and create a new layer above the layer i just filled with dirt/basic grass.

I was also instructed when making a level to note down what is on each layer in a text document so here is mine so far :

1000000 – floor (Default Layer)
999990 – paths and grass

As it is not anything important of a game i am not paying to much attention to detail and making levels look good as my main aim is to get better at coding.

 

 


Adding My Own Touch

I decided to pause the video and before my next step see if i can add my own touch to the code.

1st personal addition 

Add a run feature , here is the code that made such a thing happen :

if (keyboard_check(vk_left )and keyboard_check(vk_shift)){
sprite_index = sprite_dwarf_left
x -= 4;
image_speed = 0.3;
}

So , as well as having the normal code that walks i added 4 of these sections of code corresponding to each direction left , right , up and down. This code basically means if left and shift is pressed together then increase the movement speed to 4 and also increase the walk animation to 0.3 meaning he walks faster and also moves his legs faster.

2nd personal addition

When the user did not press anything the character would run/ walk on the spot so i decided with the help of a friend id add this piece of code in :

if keyboard_check(vk_nokey){
image_speed = 0;
}
It is pretty simple , it just means when no key is pressed the character will stay on the sprite part of the animation it was on , in the future i will have an animation for when they are inactive / when the user is not pressing anything so the character does not freeze mid running however id prefer this to running on the spot.

3rd personal addition

i decided that the default tutorial code of when the game is started that the character was still running on the spot was strange also , so i changed that to

image_speed = 0;

so it was just a still character sprite

 

Graphics wise i also added a path through the middle of the room.


So then that’s video number 2 done and i feel i’m making allot of progress and i’m happy that i could add my own little touch to the code , i know its nothing amazing or in depth but being able to know what the little bits of code mean and be able to use them myself when not following a tutorial shows i am learning it. Here is a little GIF of my progress so far including  :

  1. walking
  2. running
  3. path and grass
  4. standing still has no animation

walkandrungif.gif

 

Leave a comment