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

Flying Baddies


Recommended Posts

Alright, it isn't too hard to make an effective flying baddy that flies toward you. However, I was wondering how to effectively create a baddy similar to the hornet in Sonic the Hedgehog 1 (Or whatever that enemy is that comes in GHZ. It flies toward you, stops to shoot a bullet thing at you, and flies away.)

Is there a way I can effectively achieve this?

Thanks :)

Link to comment
Share on other sites

It seems simple enough. Just have a condition that compares the robot's X position to Sonic's. When it's in a certain range (IE : 10 pixels away), make it stop for a few seconds. Then, have it shot it's bullet. Finally (depending on it's direction), have it accelerate to the left or right until it's off-screen, at which point it's destoryed.

I'm not sure if you're using GM or MMF/CNC, so I can't give specific code. Still, does that help any?

Link to comment
Share on other sites

first you make a transparent item and put it on the right side of the screen,next you give the buzz bomber path movement,you make it go across right side of the screen.

then place the bomb on the gray part of the screen,next you make a another

transparent item and place it on the left side of the screen.then you go to step

through,then when the buzzbomber goes to the left it will touch the invisible item

then a message will pop up,you click on the buzzbomber and click on stop.this will make it stop right there.click on it again,then go to shoot an object,choose the object you want to be shot by the buzzbomber and then choose the direction.this will make it stop then shoot.click ok.now you want it to go back to

the right side of the screen.next,the buzz bomber will touch the other invisible

item on the left side.another message will appear.click on the buzz bomber and

click on reverse.this will make it go back to the other side.and that's how you do it!:D

Link to comment
Share on other sites

Pseudocode ahoy! For my... guestimation at a buzz bomber


In the buzz bomber class

constructor requires:  xPosition, yPosition
vars:  xPos, yPos

ctivate these actions when the Buzzbomber gets near the visible window.

This is the loop for the buzzbomber's main actions
{
     if (!inRange) // inRange boolean variable is false
     {
          flyLeft();
          inRange = checkPlayer();
     }

     else
     {
          shoot();
     }
}

flyLeft()
{
     xPos -= 2;  //changes buzzbomber's x position to 2 left of its previous x position
}

shoot()
{
     change animation to Buzzbomber's idle animation
     idle in location for .5 seconds
     shoot projectile with x and y velocity of -3 and 3 respectively if -X is left and +y is down.  Naturally you'll want to spawn the projectile from its gun.
     resume flight animation
}

checkPlayer()
{
     boolean test = false;
     if (absoluteValue((xPos - player.getXPos()) - (player.getYPos() - yPos)) < 5)
     test = true;
     return test;
}

Anyway, thats it in a nutshell...  And yes, it could be more comlicated depending on what manner of freakscript you are using.

  • Like 1
Link to comment
Share on other sites

what the f*ck is wrong with you, he said MMF damn it, not freaking code. (lol)

just make the freaking buzz bomber ball movement, and make sensors for it to bounce off from ( bounce function? ), and when the character in question comes between the object ( Player X = BuzzBomberX ), point its direction to either 14 or 20. done.

oh btw guyz, save the " ____ with the new guy! " stuff for General discussion, its REALLY not funny anymore. assholes.

Link to comment
Share on other sites

Well, I imagine that depends on how you set him up. If it were a method where you have the enemy with an x and y velocity, you would just set those to 0 for a while. If it were a method where you have the enemy fly left or right whenever he is just supposed to do that, then I guess you just wouldn't do that... I'm not sure.

I noticed I got a rep point for this working, so I'm wondering... did you already figure that part out?

By the way, thanks for that. I'm now "on a distinguished road" and that exudes hotness.

Link to comment
Share on other sites

Ultimate Sonic if your still having trouble, I will make a short (very short) tutorial on it later. It won't be fancy, but it should help you.

Please, Immediately let me know if you are all set, I don't want to make this Tutorial for nothin'.

Btw, I will have a static and platform tutorial on it, I'll give you both.

Link to comment
Share on other sites

Easiest way to make an enemy pause in MMF.

When you want it to pause ( lets say it's distance is about.....60-100 pixels away from you ), set its speed to 0. While its speed is 0, set value A of the enemy to 51. Then make an always event that checks if value A is bigger than 1 and if yes, subtract 1 until it equals 1. Since the game is on average 50fps and an always event occurs once every frame, it should get to 1 in the matter of about exactly one second. When value A is equal to 1 ( add an 'only one action when event loops' condition ), set the enemy speed back to normal. ( You could also set it at a higher rate of speed if you want the enemy to flee. Just make sure though that you have an event that restricts it if you're too far from the enemy. )

Btw, I used 1 and 51 instead of 0 and 50 for value A since if you made the minimum 0, then when you first saw the enemy it would dash out to you at its fleeing speed. By making the minimum for value A 1, it'll only happen after it counted down the second. The 51 came from that since the minimum is 1, I added 1 to 50 making it 51.

And if you're wondering how to get the number to count down from, take the time you want ( i.e. 1 second ) and multiply it by your fps. ( In MMF, the fps is 50. )

Edit:

Since TRD was going to make you wait until he released a demo, I decided to take a little time and make a tutorial for you to use. It's fully commented in the events and I even explained things unrelated to the Buzzbomber itself.

Download Buzzbomber Tutorial

If you can't find any of the extensions it requires at Gamerdude's Extension List or at Clickteam, let me know.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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