Mr.S Posted March 31, 2008 Report Share Posted March 31, 2008 Well i been trying for a long time to get a boss to work but i am having a problem with a few things: 1. Getting Sonic to bounce in the opposite direction when he hits the boss 2. Getting the boss to flash and be invincible when the boss flashes. Can anyone help me with those problems ? I am using Kains Sonic 3 Engine. Link to comment Share on other sites More sharing options...
USC Posted March 31, 2008 Report Share Posted March 31, 2008 Some quick and dirty solutions... #1. When Sonic hits the boss, do a one-time multiplication of his X and Y velocities by -1; this will make him go in the opposite direction until he decelerates and returns to normal. #2. I would guess putting the drawing function for Robotnik inside an IF statement, where it's only draw while a variable equals 0 (we'll call it Flash). Then, just toggle it between 0 and 1 for a while, to create the flashing effect. As for "invincibility", put all the damage code inside another IF statement, and have it only work if the flashing code isn't going on. Does that help any? Link to comment Share on other sites More sharing options...
Chaos Rush Posted April 1, 2008 Report Share Posted April 1, 2008 Well i been trying for a long time to get a boss to work but i am having a problem with a few things:1. Getting Sonic to bounce in the opposite direction when he hits the boss 2. Getting the boss to flash and be invincible when the boss flashes. Can anyone help me with those problems ? I am using Kains Sonic 3 Engine. To set up a boss, first set up the boss object. In the Create Event, put in a code like this: BossHits = 8Invincible = 0[/CODE]In the Alarm 1 Event, put:Invincible = 0In the Collision W/ ObjSonic Event, make it so that:if jumping = trueif Invincible = 0<Start Of A Block>Set Alarm 1 to 10BossHits = -1 (Check the Relative box)YSpeed = -2 (Check the Relative box)Invincible = 1<End Of Block>I'm not sure if, "jumping" is the jumping variable in Kain's Sonic Engine, so you might have to check objSonic's variables. In the Step Event, do this:if BossHits is lower than 0<Start Of A Block>Destroy<End Of Block>In the Destroy event, do whatever you want, like making Eggman explode or creating a separate object that appears as if he is running away. In the Collision event, you might have to change how long the alarm is. Link to comment Share on other sites More sharing options...
Recommended Posts