Re: Piranha Plant Movement
Test for the distance between X Mario and the X of the Pirana Plant to be greater than Y by using the ADO and doing Distance("Advanced Direction Object", X("plant"), 0, X("mario"), 0) > value
Then do the movement actions. Basically the movement should probably be an animation, one that ends with a blank frame.
EDIT: LB has the opinion that Abs(X("plant")-X("mario")) would be better. I think they are equal. Take your choice.
Re: Piranha Plant Movement
Yea, a min after posting this, I also had the idea by just making an animation, and not restart it before mario is X pixels away.. Ill try doing it on my own, but most likely Ill end up with the issue I always have.. Which ofcourse LB knows all about :p
Re: Piranha Plant Movement
How about this?
Always: Set Player Distance (Alterable Value) of Pirana Plant to Abs(X("Mario")-X("Pirana Plant"))
Player Distance of Pirana Plant is > 15 & Animation Chomp Chomp CHomp is over: Play Animation Chomp Chomp Chomp
Re: Piranha Plant Movement
Gonna try in a few mins, gotta finish the animation :)
Re: Piranha Plant Movement
Can you be more specific on the animation event?
I have
Player Distance of "Pirana" > 50
+ "Pirana" animation "Stopped" is over
= Start Animation
I have the Always event.. Shall I set the animation on "Loop"?
Re: Piranha Plant Movement
Never mind, I found out myself :) Ill edit this post and explain what I did, incase someone else need it later :) Thanks LB and Ricky :D
------------- RESULT ---------------
My animation contains 57 frames. Even tho, the last 10 frames are just blank (Its here the Piranha Plant is down in the tube).
Always
Abs(X( "Player" )-X( "Piranha" ))
Alterable Value A of "Piranha" > 100
+ Current Frame of "Piranha" >= 56
Start Animation
Alterable Value A of "Piranha" < 100
+ Current Frame of "Piranha" >= 56
Stop Animation
To a noob like me, this are the events that makes most sense. I appreciate Ricky's help aswell, but it was a little more complicated, at least to a math noob like myself (I have not worked with MMF for a very long time).
PS: Set each frame's Hot Spot thingie to the middle to make the distance on each side as correct as possible :)
Re: Piranha Plant Movement
I would just do the reverse kinda. Give the piranha the path movement where i moves up and down again with a pause built into the path. Be sure to not make it repeat the movement. After it moves it will go into a stopped state. Then it is easy for you to test if mario is *further* away than the distance and if it is then start the movement again. Doing this probably only takes 2 events and gives you smoother movement than drawing an animation where it moves up and down.
Re: Piranha Plant Movement
The first thing I did was also a path movement, but that "bugged" due to a specific reason. If I went futher into the frame, and I left the plant half way up or down in the tube, and then went back to the plant, the path movement started from that location until it had completed, and was then repositioned to its original place. But if you have enough frames, and the right programs, an animation like this works just fine :) Even tho I totally get your point.. It sure takes a lot of frames :)