• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Moving Sprites (Players) according to a Random "Dice" Roll

T

ThatAsianLover

Guest
How do i make a character move when i use the dice and it tells how many spaces to move, so the players know how many spaces to move
 

Repix

Member
Well I don't know what kind of system you use.. but here is an example of something quick.

Code:
rand=irandom_range(1,6)

if place_free(x+32*rand,y) {

x+=32*rand

}
Now that will move the player to the right along a 32 pixel grid 1-6 times depending on what the dice chooses.

Now you just need to change that to fit your game! (Collisions/Movement system)
 
T

ThatAsianLover

Guest
Well I don't know what kind of system you use.. but here is an example of something quick.

Code:
rand=irandom_range(1,6)

if place_free(x+32*rand,y) {

x+=32*rand

}
Now that will move the player to the right along a 32 pixel grid 1-6 times depending on what the dice chooses.

Now you just need to change that to fit your game! (Collisions/Movement system)
Sorry I’m using game maker 1.4 thank you so much
 
Top