End of Level Boss
zamboni77
Member Posts: 40
Hi there
Anyone know of a tutorial on how to make an end of level boss with its own AI?
Cheers
Anyone know of a tutorial on how to make an end of level boss with its own AI?
Cheers
Comments
The boss will have four states:
0 = waiting
1 = active
2 = firing
3 = dead
1. Have the boss use a self.integer variable to control its states.
2. Have the boss use another self.integer variable to have its own counter
3. When a certain condition is reached (e.g. end of level) have the boss change state to 'active' (e.g. from state 0 to state 1).
4. Put X and Y coordinates in a table. When the state is 1 (active) have the boss move to a certain point chosen off the table.
5. When the boss reaches these coordinates, change the self.integer state to 2 (firing)
6. When the boss has finished firing, change state back to 1 to choose another location to move to.
7. Repeat.
8. If the boss's health is less than or equal to 0, change the state integer to 3.
9. When the level is cleared or restarted set the boss state to 0 again (this is because I'm planning on using the same actor for multiple bosses across multiple levels with no loading in-between).
For more advanced users, you can probably use tables to hold all sorts of information about boss mechanics (e.g. images used for boss, images used for bullets, movement etc)
Hope that helps someone!
QS =
D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I love when people really helps!
Reading through it again, I forgot to mention what the counter was for.
You can use this to set off certain actions.
e.g.
If state = 1 every 1 second make counter = counter +1
This will start your counter going!
You can then base certain actions on the value of the counter e.g. if counter = 10 and state is 2 (firing) shoot 1 bullet.
If counter = 20 then shoot 2 bullets etc etc
Best thing to do is experiment and see what works for you!
QS =
D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io