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

direction+5?

V

veko

Guest
Hello, you know how you can for example make instance_create(x+5,y,obj_test)
Is it possible to make +5 for direction, to be 5 pixels in front of the direction of player.
If yes, how?
Thank you!
 

matharoo

manualman
GameMaker Dev.
Hello, you know how you can for example make instance_create(x+5,y,obj_test)
Is it possible to make +5 for direction, to be 5 pixels in front of the direction of player.
If yes, how?
Thank you!
Code:
var xx = lengthdir_x(5, direction);
var yy = lengthdir_y(5, direction);
instance_create(x + xx, y + yy, obj_test);
 
Top