Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2] Homming Attack in Sonic Worlds ALPHA


Magican

Recommended Posts

Check out how to move Sonic toward a specific point.

Try having him home attack toward a single enemy, and when you got that down, you'll only need to check the distances of multiple enemies to select the nearest one ( may want to only start the homing attack if the distance is less than a certain amount too so you don't try to attack something that's far away ). I'll hint at Pythagorean's theorem to achieve this. ;>

If you have any troubles, you may consider consulting Azu for I've helped him implement this into Worlds recently.

Link to comment
Share on other sites

Check out how to move Sonic toward a specific point.

As I am the most curious one in the world, I tried to make it work.

And as I am lazy, I've used an active object as homming sensor to check the enemies near to Sonic.

But the problems are:

1- On the Theorem, try not to foret about Sonic's direction. If you're using MMF2, create a new value called "Direction", which one turns 1 if you're faced right and -1 if you're faced left. So, the equation becomes:

TrajectoryLength=(SquareRo ot((DeltaX*DeltaX)+(Delta Y*DeltaY)))*Direction
[/CODE]

Simple, eh? Let's get to the next 'negative' point.

2 - Ok... instead of mathematic comparisions, I was using an active homming sensor, as you know, because it makes you spend less time (I know that it's not the best way and actives charge the memmory, btw). BUT...

I dunno if Lark and Azu have noticed it, but this kind of homming doesn't works properly when you're under an enemy (yes, Sonic gets out of the focus and goes floating to nowhere. So, I had to make my homming sensor smaller on the top and ground to make it work properly. Yea, I know, it make it less powerful. But as BlazeHedgehog said once, Homming Attack is too much powerful for 2D games.

I still prefer using the old method, that the mask and the anim are at (0,0) from a bouncing-ball-moved active.

Link to comment
Share on other sites

  • 3 weeks later...

Because we'd learn how to actually do it ourselves if someone taught us rather than just having a code stuck in there for us.

Thats how I've asked my questions so I could actually learn how things work. The only thing is that mine was getting Knuckles into Worlds, and it'd probably take a while to do anyway.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...