This lesson is designed by people familiar with ClickTeam Fusion, and who have read previous lessons on Simple Sonic Worlds,posted on this site. For this reason, in this tutorial I will look at the way to create bosses, as brieflyas possible.
Also, in the previous lessons I made a mistake,it was necessary to check the conflict with "Player_CharacterSensor", and not with the sonic sprite. Ask what's the difference? The difference is that , "Player_CharacterSensor" is present in all the characters (Sonic, Tails, Amy, etc.), whereas the sonic sprite belongs only to the sonic. Thus, the collision is checked regardless of the selected character.
First, let's create 2 active objects and drag 1. Boss and Boss Triggerare the new active objects. Boss Cam,drag and turn from the stage of the boss with mecha-sonic.
Download sprite mugs,you can on MEGA.
Let's add 3 new variables to our circle. The HPvariable, which stores the number of HP bosses, and 2 flags invulnerability and lockCamera,which will store the states of immortality and fixed camera.
Now, go to event List Editor (Ctrl+L), in the section [Stage 00 – Gimmicks].
Let's analyze each of the conditions.
When"Player_CharacterSensor"collides with Boss Trigger (overlapping), the lockCamera flag switches the value on. This action will occur only 1 time (Repeat 1 times).
Let's move on to the next condition.
- If the flag invulnerability = off (the boss is not immortal)
- and the player comes into contact with the boss (mug).
- and the player attacks (Attacking = 1)
- and also, he jumped (Action = 1)
- We play the sound of the blow. (Play sample Sound_BossHit), after stopping it ( Stop sampleSound_BossHit)
- Invert the player's speed along the Y axis (in practice, this means that the player will lean back).
- Set the mode of immortality (invulnerability = on).
- Run the timer, which in a second will create an event "canBeat". This timer we need something, in a second,to make the boss again mortal.
- Set effect to"Inverted"to identify the immortality mode.
- Reduce HP boss on 1.
- Invert the player's speed along the X axis (in practice, this means that the player will lean back).
Let's move on.
In the event "canBeat"
- Remove effects (Set effect to "None")
- And turn off immortality (Set invulnerabilty off)
If HP = 0 (the boss died) then:
- CameraMode to 0 – the camera now follows the player.
- lockCamera off – event that did not allow sonic to go beyond bossCamera, disabled.
- CameraAction to 0 – sonic, can go beyond bossCamera.
- Destroy – destroy the boss object.
Now, let's move on to the most delicious,to the cycle that locks the sonic in the arena with the boss.
- The first 4 commands,set the coordinates limiting the movement of the sonic. The coordinates are calculated relative to bossArea.
- Set the CameraAction value to -99. Thus, the player is locked inside the camera.
- And the value of CameraAction too, set to -99. Now, the camera is fixed in one place.
That's it, done. If you did everything right, then when you encounter Boss Trigger, the boss battlewill begin.