Legacy GM We need better touch controls for Top Down

L

lord_berto

Guest
Hello, im making this post because i think we need better controls for touch down games, specifically top down games.

I am working on a game, and am avoiding joystick controls because they are horrible for aiming in top down shooters.

I want my player to rotate towards (gradually look towards, not instantly like image_angle=point_direction(x,y,mouse_x,mouse_y)

so to illustrate more. imagine dragging downwards, this would be considered 180 degrees. the player will gradually "per swipe", look closer and closer to the direction that is being dragged on, "until" it reaches that point of direction. not only does this create much more precision, but it is also alot faster and easier to use because one can drag anywhere on the screen to rotate the player.

I have not played one game on my phone that uses this, and it frustrates me that people simply turn to joystick as the way to go,
we should all look into this and try to perfect touch controls on mobile games.

what i have done so far is this.

Creation Code:
mx=0
my=0
mx2=0
my2=0
H=0
Y=0
lastang=0



STEP
:
if mouse_check_button_pressed(mb_left)
{ ////Code to record first x,y coordinate of mouse
mx=mouse_x
my=mouse_y
}

if mouse_check_button(mb_left)
{ /* second coordinate, FROM the initialize mouse click. (if player has not moved the mouse/dragged theyre finger, the distance between mx, and mx2 is 0. once they move it, distance will be calculated starting from mx,my */

mx2=mouse_x-mx+mouse_x
my2=mouse_y-my+mouse_y



H=point_distance(x,y,mx2,my2) /// distance from player to mx2
A=point_distance(mx,my,mx2,my2) /// distance from mx to mx2

// here we are calculating the degree from the distances above
image_angle=radtodeg(cos(degtorad(A/H)))*100+lastang //lastang is the last angle we were in
}




if mouse_check_button_released(mb_left)
{
lastang=image_angle //the angle we stopped at
}



so please may we have a big discussion about this topic?
I am not even sure if im at a good starting point with this code,
i just hope that all our combined efforts helps me and as well as others, to have good code for better
touch screen controls. Thank you.
 

Attachments

Top