Sign in to follow this  
Followers 0
shadowoffire123

Good static homing attack (MMF)

7 posts in this topic

I am trying to put in Static Movement, but I still need a homing attack for Sonic, in my game "Sonic Adventure 2: Advance." The tutorial that is already on the site doesn't seem to always work that well. In fact, it tends to multiply the main character and screw everything up. So, if anybody knows how to make some good static Homing Attack commands I can use, please do tell me. Thanks in advance.

Share this post


Link to post
Share on other sites

You could have a look at the Advanced Direction object, I'm sure it has some useful features for Homing Attack. I personally use it for Homing too.

Share this post


Link to post
Share on other sites

This isn't really that tough to make. I'd use a ball object for the homing procedure, but of course there's another way if you'd like a quick tutorial.

Anyways here's how you'd use the ball object.

First when you're not homing attacking, flag 0 of the black ball is off. This means to always position the black ball ( 32x32 & invisible ) on top of Sonic. This ball should have ball movement and for now the speed should be set to 0.

If you're jumping and you press the jump key again, you're jumping value is at the top of the jump or falling, and there is an enemy on the screen, turn on flag 0 of the black ball.

Now that flag 0 is on, speed for the black ball is set to 80 ( or whatever you feel best ), it's direction is set to the enemy ( you can also use the direction calculator ), Sonic is always positioned to the ball, and his jumping animation is triggered.

If you hit the ground while flag 0 of the black ball is on, turn it off.

If you hit an enemy while flag 0 of the black ball is on, turn it off. Even though it's off, any enemy destroying procedures should take place.

If you do the above, you should get a homing attack. Then you can add effects and whatnot and you're good to go. If all this confuses you ( at least try to attempt it first ), I can design a tutorial along with the alternative way I talked about above. I hope all this helps.

Share this post


Link to post
Share on other sites

First, I have it have anything that can be homed in on set to the 'nuetral' group. Then I have a sensor the size of my screen that will always be (0,0) from my character (or the static mask, if you want.) Then, you can set a counter that indicates when your character is jumping. If character is jumping, set counter to '1'. If character is jumping and you press the jump key again, set counter to '2'. This will set off the homing events. Have another 2 counters to store the enemy's x and y positions.

This event will store the enemy's x and y values.

Cause:

'Jump Counter' >< (does not equal) 2

Homing Sensor is overlapping 'Group: Nuetral'

Pick one of 'Group: Nuetral'

Effect:

Set counter 'enemy x' to x of 'Group: Nuetral'

Set counter 'enemy y' to y of 'Group: Nuetral'

This events will set up the actual homing:

1) Cause:

'Jump Counter' = 2

X of 'Sonic' > counter 'enemy x'

Effect:

Subtract 10 from X of 'Sonic'

2) Cause:

'Jump Counter' = 2

X of 'Sonic' < counter 'enemy x'

Effect:

Add 10 to X of 'Sonic'

3) Cause:

'Jump Counter' = 2

Y of 'Sonic' > counter 'enemy y'

Effect:

Subtract 10 from Y of 'Sonic'

4) Cause:

'Jump Counter' = 2

Y of 'Sonic' < counter 'enemy y'

Effect:

Add 10 to Y of 'Sonic'

This event will stop the homing once you hit an enemy. Sonic will go back to normal jumping mode.

Cause:

'Sonic' is overlapping 'Group: Nuetral'

'Jump Counter' = 2

Effect:

Destroy 'Group: Nuetral'

Set 'Jump Counter' to 1

That's the basic premise behind it. If you need help fine tuning it, I'm still here :0 Only problem with my method is it will pick a random enemy, not the one closest to sonic. To dget him to attack the enemy closest is complicated, but Mark the Hedgehog knows how to do it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0