• 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!

Path not working

F

Frignate

Guest
I'm new to gamemaker and trying to make a shoot'em up game where enemy planes have a ramdomized path(out of 4 ones) each time but in this code, planes stay still. it works fine with just the path_start code.

Code:
randomize();
var path=random_range(0,4)
switch path
{
case 0:path_start(Enemy_path_1,30,path_action_stop,0)
case 1:path_start(Enemy_path_2,30,path_action_stop,0)
case 2:path_start(Enemy_path_3,30,path_action_stop,0)
case 3:path_start(Enemy_path_4,30,path_action_stop,0)
}
 

Mick

Member
Use irandom like @Michael Bateman suggested, you also need to add a break instruction after every case:

Code:
case 0: path_start(...); break;
Another note, you only need to call randomize() once at game start.
 
Last edited:
Top