Log in
Search
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.turn object to a point
2 posters
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
turn object to a point
This is a code that turns a object to a point. Unlike the function move_towards_point(x,y,sp) this turns the object at the given speed. this may seem simple to do but it is acutely very complicated.
//argument0 is x the point that the object should move towards
//argument1 is y the point that the object should move towards
//argument2 is speed that the object should tern towards argument0(x) and argument1(y)
//argument0 is x the point that the object should move towards
//argument1 is y the point that the object should move towards
//argument2 is speed that the object should tern towards argument0(x) and argument1(y)
- Code:
{
if (point_direction(x,y,argument0,argument1) >direction&&
point_direction(x,y,argument0,argument1) <180+direction)
{direction +=argument2}
else
if (point_direction(x,y,argument0,argument1) <direction-180)
{direction +=argument2}
else
{direction -=argument2}
if(point_direction(x,y,argument0,argument1)+(argument2+1)>direction&&point_direction(x,y,argument0,argument1)-(argument2+1)<direction){direction=point_direction(x,y,argument0,argument1)}
}
Similar topics
» Object changing
» The point of GML
» Point to mouse with lite.
» Finding a point relative to the x, y, and z angle?
» Listens to Mr. Jin and Yogi Ceramic sunglasses store that nothing new point
» The point of GML
» Point to mouse with lite.
» Finding a point relative to the x, y, and z angle?
» Listens to Mr. Jin and Yogi Ceramic sunglasses store that nothing new point
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|