I am trying to do a simple galaga type of game for practice and I have some projectile code set up. It works perfect, and displays the bullet properly if the player does not move, but once the player moves the bullet starts to appear more to the left and looks akward. Does anyone know a way to keep the projectiles loc from sliding over?
This is the code for the projectile:
standard
icon_state = "standard"
bound_height = 4
bound_width = 4
pixel_x = 5
pixel_y = 4
step_x = 10
step_y = 32
New(mob/shooter)
loc = shooter.loc
It appears that pixel movement is on and that is why it is doing this, but I need the smaller bounding box for the icon or I will have to set up 4 sepereate .dmi files which seems less efficient.
You need to set bound_x and bound_y for this. pixel_x and pixel_y are visual offsets, they don't change the bounding box at all.
You need to set the step_x and step_y values once the projectile is created, to line it up with the player.