Edited by zeninja, 11 July 2012 - 09:06 PM.
Changing (joystick) aim speed? [SOLVED]
#1
Posted 11 July 2012 - 08:57 PM
#2
Posted 11 July 2012 - 09:21 PM
Code something like : move_towards_point(x.target,y.target,0.5)
Where x.target is to be replaced with targets object name or other variable that holds it's current location, same for y.target.
Adjust 0.5 to the speed you require.
Zzz
Edited by ZingZingZap, 11 July 2012 - 09:29 PM.
#3
Posted 12 July 2012 - 05:29 AM
To make the laser lag, in the step event, make the object move towards the site, using move towards D&D function: set the speed slower than the sight moves.
Code something like : move_towards_point(x.target,y.target,0.5)
Where x.target is to be replaced with targets object name or other variable that holds it's current location, same for y.target.
Adjust 0.5 to the speed you require.
Zzz
The thing is, since I'm using lasers and not bullets, it just draws a line straight from the player to the point. At the moment I'm using the move to contact Dragndrop function and then draw_line in the draw step. Is there a way to convert this to the move towards function?
#4
Posted 12 July 2012 - 05:29 AM
To make the laser lag, in the step event, make the object move towards the site, using move towards D&D function: set the speed slower than the sight moves.
Code something like : move_towards_point(x.target,y.target,0.5)
Where x.target is to be replaced with targets object name or other variable that holds it's current location, same for y.target.
Adjust 0.5 to the speed you require.
Zzz
The thing is, since I'm using lasers and not bullets, it just draws a line straight from the player to the point. At the moment I'm using the move to contact Dragndrop function and then draw_line in the draw step. Is there a way to convert this to the move towards function?
#5
Posted 12 July 2012 - 07:06 AM
using that script you can change the angle like so:
aim_dir = point_direction(x,y,mouse_x,mouse_y) diff = angle_difference( direction, aim_dir ) // might need to change the order on those 2 direction += min( abs(diff) , 5) * sign(diff) // where 5 will be the max turnrate
#6
Posted 12 July 2012 - 06:24 PM
#7
Posted 15 July 2012 - 06:23 AM
#8
Posted 15 July 2012 - 06:47 AM
direction is where you are moving towards (when the speed is set)
image_angle is your facing direction
#9
Posted 15 July 2012 - 09:14 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











