![]() |
Help please =)
What i eventually want this to do is to have 1 ball chase the mouse and have 2 ball chase 1st ball, 3 chase 2 etc.
Currently the balls float from mouse x and y to player co-ordinates. Can someone tell me whats wrong? //#CLIENTSIDE function onCreated() { for ( i = 0; i < 5; i ++ ) showimg(i,"light4s.png", mousex, mousey).follow = findimg(i - 1); settimer(0.1); } function onTimeout() { for ( i = 0; i < 5; i ++ ) { with ( findimg( i )) { if ( this.follow.type() ) { temp.angle = getangle(( this.follow.x - this.x),( this.follow.y -this.y)); temp.distance = (( this.follow.x - this.x)^2 + ( this.follow.y - this.y)^2)^0.5; } else { temp.angle = getangle((mousex - this.x),(mousey-this.y)); temp.distance = ((mousex - this.x)^2 + (mousey - this.y)^2)^0.5; } temp.speed = (temp.distance / 15); this.x += cos(temp.angle)*temp.speed; this.y -= sin(temp.angle)*temp.speed; } } setTimer( 0.05 ); } |
| All times are GMT +2. The time now is 11:36 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.