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

Star Trek turbolifts with pathfinding

J

Jiří Čech

Guest
Hello, fellow programmers! I have a bit of troubles with my turbolifts. I have done pathfinding which i need becouse of the number of stops (something about 46 stops/floors).

///turbolit create event
xx = x;
yy = y;
tfloor = 1;
path = path_add();

///turbolift press enter
if tfloor = 1{
xx= 140;
yy= 320;
}
if tfloor = 2{
xx= 640;
yy= 80;
}
if mp_grid_path(global.grid,path,x,y,xx,yy,1){
path_start(path,1,path_action_stop,true);
}

///turbolift step event(for now only two stops)
if keyboard_check_pressed(ord("1")){tfloor = 1;}
if keyboard_check_pressed(ord("2")){tfloor = 2;}

And now i need player to be able to walk in the lift but i do not know how.
 
Top