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

Help-Homing attack


Filipe Santos

Recommended Posts

There are some tutorials on the main site, but here's a basic idea you can build off of...

--------------

Okay, first check to see if the jump button has been pressed again once Sonic's in the air (assuming this is how you want the homing attack to be activated).

Now, check to see if there are any enemies within a certain range around Sonic (Say, a X position of +/- 80 from Sonic's current position, and a Y position of +/- 40).

**If they are, set a flag ON. While this flag is on, add/subtract from Sonic's X & Y position until it equals the enemy's coordinates, then set the flag OFF.

**If there aren't any enemies, just make Sonic's X velocity a little higher in the direction he's facing.

-------------

Hope that's of some help to you.

Link to comment
Share on other sites

There are some tutorials on the main site, but here's a basic idea you can build off of...

--------------

Okay, first check to see if the jump button has been pressed again once Sonic's in the air (assuming this is how you want the homing attack to be activated).

Now, check to see if there are any enemies within a certain range around Sonic (Say, a X position of +/- 80 from Sonic's current position, and a Y position of +/- 40).

**If they are, set a flag ON. While this flag is on, add/subtract from Sonic's X & Y position until it equals the enemy's coordinates, then set the flag OFF.

**If there aren't any enemies, just make Sonic's X velocity a little higher in the direction he's facing.

-------------

Hope that's of some help to you.

I do not understand this and the tutorial of the site are not working for me! :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

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