Skip to content

enemy assitence #171

Discussion options

You must be logged in to vote

The "Sol" enemy has a similar function, where it will fire the fireballs if it detects the player, specifically this line of code:

// Check if the player is within range and not controlled
if abs(_dist_x) < 160 && abs(_dist_y) < 80 && _player.state < PLAYER_STATE_NO_CONTROL
{
state = SOL_STATE_SHOOT;
}
}

x -= 0.25 * image_xscale;
angle = (angle - ANGLE_INCREMENT * image_xscale) % 360;

for (var i = 0; i < fireball_count; i++)
{
var _fireball = fireballs[i];
if _fireball == noone
{
continue;
}

I'd suggest using this badnik (and all other enemies included in Orbinaut) to help you make new ones.
Hope this helps.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by SonicVHSOfficial
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants