Alexstardust Posted August 17, 2008 Report Share Posted August 17, 2008 Hi i'm french so sorry for my english Can I make a ball mouvement myself and how to make it ? it's for created an homing attack in my project Link to comment Share on other sites More sharing options...
Blue Frenzy Posted August 18, 2008 Report Share Posted August 18, 2008 Yeah, you can use trigonometry to do it. Just need the angle and this: conditions for start movement: object.set flag 0 on. if object.flag 0 is on set object.x (object.x + speed*sin(angle)) set object.y (object.y + speed*cos(angle)) Well, I can assume you are new into this, so i will tell you an easier way to do it. Your character ha a movement, right? then, when you enable the homming attack, create an invisible point with ball movement. When the number of those points is greated than 0, disable the sonic movement and do this: set sonic position at 0,0 from point. Just remember to destroy the object after homming is done and set the right speed values. You can also make it a big circle instead a point, with the size of the "detection" area and the hotspot in the centre. When you make homming, create a circle object. If that object doesnt overlap an enemy, destroy it and give sonic the speed desired (to make him move forward). If the sensor is overlapping an enemy, disable the sonic movement and set a flag on. If that flag is on, set sonic position at 0,0 of the circle, start the circle movement and make circle to look at the enemy. Be sure to check that if no enemy is over the sensor, destroy the circle and give sonic a certain speed. That is less "clean" but it will be easier for unexperienced programmers. If the circle object Link to comment Share on other sites More sharing options...
Alexstardust Posted August 18, 2008 Author Report Share Posted August 18, 2008 Thanks for the answer My Sonic object dont have mouvement because I use an 360° engine (ss16) This is the .mfa of my project : http://www.megaupload.com/fr/?d=C1GZJTLS In this mfa, the mouvement of the Homing attack is not very good Can you help me please Link to comment Share on other sites More sharing options...
Blue Frenzy Posted August 18, 2008 Report Share Posted August 18, 2008 No no, you didn't understand. The one with the ball movement should be t he invisible object. Sonic should be at 0,0 of the invisible object. Link to comment Share on other sites More sharing options...
Alexstardust Posted August 18, 2008 Author Report Share Posted August 18, 2008 Yes this technic works good but when I lanch the homing attack it's work and when the invisible object collision on the ennemis, the position of sonic set as when I jump (lol i'm very sorry for my english ^^) exemple : Jump : (position X(sonic) is : 5) (position Y(sonic) is : 9) and when the homing attack is finish the position of sonic set : (position X(sonic) is : 5) (position Y(sonic) is : 9) Normaly the position of Sonic remains the lasted position XandY of the ennemi So I cant created object with ball mouvement I'm obligate make the mouvement myself Link to comment Share on other sites More sharing options...
Blue Frenzy Posted August 18, 2008 Report Share Posted August 18, 2008 You mean that when you finish the homming, sonic returns to the original position? This is caused because of the inner variables. There is a variable that stores the X position and another that stores the Y position (they are counters or alterable values of a V shaped object). Be sure to change those values when doing the homming attack to the current position of sonic. If homming is enabled: set XX to sonic.x ser YY to sonic.y 1 Link to comment Share on other sites More sharing options...
Alexstardust Posted August 18, 2008 Author Report Share Posted August 18, 2008 Ok please look my mfa If you can make me an exemple with my mfa because the programation of the engine prevent me to do an homing attack Link to comment Share on other sites More sharing options...
Alexstardust Posted August 20, 2008 Author Report Share Posted August 20, 2008 lol it's good It's work perfectly Thanks for your help Link to comment Share on other sites More sharing options...
Blue Frenzy Posted August 20, 2008 Report Share Posted August 20, 2008 I suposse you don't need the exe anymore, so mods can now lock this. Link to comment Share on other sites More sharing options...
Recommended Posts