Circulair movement scriptA script to let an object make a perfect circulair path around a given coordinate with a given speed and radius. |
| Circulair movement script |
//////////////// Circulair movement script //////////////////// // // Copyright Simon Donkers 27-1-2005 // www.simondonkers.com - gmmentor@simondonkers.com // // A script to make an object move in a perfect circle // argument0 is x coordinate of center // argument1 is y coordinate of center // argument2 is radius of circle // argument3 is angular speed. Positive is // clockwise, negative counterclockwise // This is the corner to turn a step. For instance // 5 means it will turn around in 360/5 = 72 steps // This script requires GM 5.1 or higher // ///////////////////////////////////////////////////// dir_now := point_direction(argument0,argument1,x,y); dir_new := (dir_now + argument3 + 360)mod(360); x := lengthdir_x(argument2,dir_new) + argument0; y := lengthdir_y(argument2,dir_new) + argument1; |
Tip: Have a look at the tutorial How to execute a script
User comments
| Yibbon(Chris Hines) posted at 2005-02-13 09:53:29 | ![]() |
| Bob posted at 2005-07-12 10:48:26 | ![]() |
| Rick posted at 2006-05-03 18:21:25 | ![]() |
| gmfreaky posted at 2006-07-06 17:25:21 | ![]() |
| Somebody posted at 2007-04-02 01:49:43 | ![]() |
| Simon Donkers posted at 2007-04-19 00:03:35 | ![]() |
| Jannes posted at 2007-05-13 20:22:03 | ![]() |
| Afromonkey0 posted at 2007-05-22 21:28:35 | ![]() |
| new001 posted at 2010-06-28 11:40:23 | ![]() |



