mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
refactor 'dir = ' into 'set_dir()'
This should have little/no gameplay effect right now, just paving the way for directional lights. Replaced handle_rotation() on buckly things with this. Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
@@ -23,16 +23,16 @@
|
||||
|
||||
if(dy || dx)
|
||||
if(abs(dx) < abs(dy))
|
||||
if(dy > 0) usr.dir = NORTH
|
||||
else usr.dir = SOUTH
|
||||
if(dy > 0) usr.set_dir(NORTH)
|
||||
else usr.set_dir(SOUTH)
|
||||
else
|
||||
if(dx > 0) usr.dir = EAST
|
||||
else usr.dir = WEST
|
||||
if(dx > 0) usr.set_dir(EAST)
|
||||
else usr.set_dir(WEST)
|
||||
else
|
||||
if(pixel_y > 16) usr.dir = NORTH
|
||||
else if(pixel_y < -16) usr.dir = SOUTH
|
||||
else if(pixel_x > 16) usr.dir = EAST
|
||||
else if(pixel_x < -16) usr.dir = WEST
|
||||
if(pixel_y > 16) usr.set_dir(NORTH)
|
||||
else if(pixel_y < -16) usr.set_dir(SOUTH)
|
||||
else if(pixel_x > 16) usr.set_dir(EAST)
|
||||
else if(pixel_x < -16) usr.set_dir(WEST)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user