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

[GM7] Sonic Revival Engine Homing attack


BOB_ROX

Recommended Posts

Hi I'd like some help with finding a homing attack that is compatible for the Sonic Revival Engine.:scool:

The Sonic Revival engine uses Damizean's old movement engine (before the X-mas engine came out).


if ( ground == false && key_action_pressed && action = action_jumping )
{
if (instance_exists(objBadnikParent)==true)
{
var nearestEnemy;
nearestEnemy = instance_nearest(x, y, objBadnikParent);
if (distance_to_object(nearestEnemy) < 60)
{
x_speed = (nearestEnemy.x - x)*0.1;
y_speed = (nearestEnemy.y - y)*0.1;
}
}
}[/CODE]

That's the main code for Homing Attack that I found by searching, anyway. You might have to define an extra variable that activates when Sonic is jumping, and then add something to the first line of code.

Also I don't like that some people are still using my old crappy Sonic Revival engine, and I would prefer it if people used a newer, more organized one:

http://www.sonicfangameshq.com/forum/showthread.php?t=5083

The homing attack code will work just fine with the new engine, simply because both engines use the same build Damizean made.

Link to comment
Share on other sites

More or less, is this:

in step event of objSonic:

if instance_exists(objEnemy){

near=instance_nearest(x,y,objEnemy);

if (distance_to_object(near)<300 && keyboard_check_pressed(homing_attack_key) && action=action_jumping) //for example

{

homing=1;

motion_set(point_direction(x,y,near.x,near.y),15);

}

}

In object Handling code, in the enemy handling:

if homing=1{

homing=0;

motion_set(0,0)

} //Make sure this code is applicated to sonic, maybe you want to stop hes motion.

And then, make the basic x_speed and y_speed works only when homing=0;

If you make this right I think it must work.

Good luck!

PD ChaosRush, that is not crappy, just incomplete.

you should know i'm using that engine right now xDD

Link to comment
Share on other sites

  • Recently Browsing   0 members

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