W
WalkerTxsRngr7
Guest
When I click I have a weapon object spawn in and start moving towards where I clicked. It rotates counter-clockwise if thrown left and clockwise if thrown right. I have this code placed in the create event.
wpn_rtn = 0
if (wpn_throw = 1)//Thrown Left
image_angle += 10
wpn_rtn += 10
if (wpn_throw = 2)//Thrown Right
image_angle -= 10
wpn_rtn -= 10
Then in the step event I have...
image_angle += wpn_rtn
I used a collision event with obj_wall and then bounce against solid objects and code...
wpn_rtn = -sign(wpn_rtn)
wpn_rtn *= 10
I really want the weapon to rotate as it moves and change directions (ccw/cw) when it bounces. Right now it does not keep rotating as it moves. I originally had the two "if..." statements in the step event and it would rotate while it moved but I felt it was resetting the rotation angle every time I tried to change it by bouncing so I moved it to the create and now it doesn't rotate while moving at all.
All help is greatly appreciated!
wpn_rtn = 0
if (wpn_throw = 1)//Thrown Left
image_angle += 10
wpn_rtn += 10
if (wpn_throw = 2)//Thrown Right
image_angle -= 10
wpn_rtn -= 10
Then in the step event I have...
image_angle += wpn_rtn
I used a collision event with obj_wall and then bounce against solid objects and code...
wpn_rtn = -sign(wpn_rtn)
wpn_rtn *= 10
I really want the weapon to rotate as it moves and change directions (ccw/cw) when it bounces. Right now it does not keep rotating as it moves. I originally had the two "if..." statements in the step event and it would rotate while it moved but I felt it was resetting the rotation angle every time I tried to change it by bouncing so I moved it to the create and now it doesn't rotate while moving at all.
All help is greatly appreciated!