UltimateSonic Posted October 23, 2006 Report Share Posted October 23, 2006 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 More sharing options...
USC Posted October 23, 2006 Report Share Posted October 23, 2006 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 More sharing options...
UltimateSonic Posted October 23, 2006 Author Report Share Posted October 23, 2006 Oops I should have mentioned that I'm using MMF. Can you please explain more in depth on how to do this? Link to comment Share on other sites More sharing options...
sonic122 Posted October 23, 2006 Report Share Posted October 23, 2006 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! Link to comment Share on other sites More sharing options...
Slingerland Posted October 23, 2006 Report Share Posted October 23, 2006 Whoa whoa...slow down, slick. Link to comment Share on other sites More sharing options...
DimensionWarped Posted October 23, 2006 Report Share Posted October 23, 2006 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. 1 Link to comment Share on other sites More sharing options...
MidimanNull Posted October 23, 2006 Report Share Posted October 23, 2006 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 More sharing options...
hRook Posted October 24, 2006 Report Share Posted October 24, 2006 Last time I checked, pseudocode was generally applicable. That being said, DW's pseudocode was like half-pseudocode, half-real code. Link to comment Share on other sites More sharing options...
MidimanNull Posted October 24, 2006 Report Share Posted October 24, 2006 My mistake then Link to comment Share on other sites More sharing options...
UltimateSonic Posted October 28, 2006 Author Report Share Posted October 28, 2006 Workin on it. How would you make the enemy pause for a second in MMF? Link to comment Share on other sites More sharing options...
DimensionWarped Posted October 29, 2006 Report Share Posted October 29, 2006 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 More sharing options...
Rael0505 Posted October 29, 2006 Report Share Posted October 29, 2006 I like how ultimatesonic actually gives rep points to those who try to help him. Link to comment Share on other sites More sharing options...
UltimateSonic Posted October 29, 2006 Author Report Share Posted October 29, 2006 Yep I figured it out =) Link to comment Share on other sites More sharing options...
TRD Posted November 6, 2006 Report Share Posted November 6, 2006 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 More sharing options...
Ryan Cordel Posted November 6, 2006 Report Share Posted November 6, 2006 If it works by Ball Movement, set it's speed to 0, and after it's done doing an action, set it back to it's original speed. (Or, heck, use Stop.) Link to comment Share on other sites More sharing options...
TRD Posted November 6, 2006 Report Share Posted November 6, 2006 Btw, I actually did something like that with a path movement, You know sth2 in emerald hill zone, that buzz bomber? He stops when shooting and then turns around and go, It's in one of my demos I have yet to show. Link to comment Share on other sites More sharing options...
UltimateSonic Posted November 6, 2006 Author Report Share Posted November 6, 2006 Ah, I'd be interested on how you do it. It may be a better way than mine Link to comment Share on other sites More sharing options...
TRD Posted November 7, 2006 Report Share Posted November 7, 2006 Its gonna have to wait til' I issue the demo. Link to comment Share on other sites More sharing options...
LarkSS Posted November 7, 2006 Report Share Posted November 7, 2006 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 More sharing options...
UltimateSonic Posted November 7, 2006 Author Report Share Posted November 7, 2006 Ah, VERY nice, LarkSS. Its similar to how I did it but there are many other things that make it much more efficient. Thakyou very much! Link to comment Share on other sites More sharing options...
TRD Posted November 9, 2006 Report Share Posted November 9, 2006 Looks like you beat me to it Larkss, I already put out the demo in the Fangame disscussion, the sonic & crash demo. But hell, you saved me alot of trouble making a tutorial on it though. Link to comment Share on other sites More sharing options...
Recommended Posts