How do I make a boss?

Get help using Construct 2

Post » Tue Sep 08, 2015 10:50 pm

I am looking to make a boss for a top down style adventure game. I want this boss to have different phases that it goes through and it will play animations as tells so the player can predict what it is going to do. I do not want the boss to do the same phase more than once in a row. Does anyone have any good ideas on how to achieve this?
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Tue Sep 08, 2015 11:15 pm

You could use instance variables on the boss for what phase it's in. Go to the layout, and click your boss sprite. To the left you'll see where you add behaviors and what not. Add an instance variable called phase. You can use either a number, or a string. Set the starting phase, could be anything, call it "form 1". Then you would just use that instance variable in your event sheet to do what ever you want. You could do something like every tick, add another condition, click your boss sprite, go to compare instance variable = "form 1" -> action: set boss animation form 1. It might just be glowing red, or whatever.

Of course this is a bare bones starting point. You'll want to use variables like this to decide what animation is playing, and use events to control the flow of form changes, and what not, but once you learn what I'm talking about the picture will come a little clearer.

Also as a note you can use events to set this variable to something else. Just make the conditions, the action will be in the sprite, set instance variable..

Variables are your friend for helping control flow, and keeping track of states.
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 09, 2015 12:52 am

yeah I been doing something like that but the way I am doing it makes the boss repeat the same action on random, I think my problem is when i select to do another phase.

As an example I have a instance variable called phase on the boss and while than = 0 the boss will do a animation then change phase to a random number based on how many phases I have total. At the end of each phase I have it change Phase back to 0.

What my problems are is it will select to do the phase that it did before again so it will go from 0,1,0,1,0,1 and sometimes it will rarely go to the other phases.
Another problem I have is it will not full finish a phase and try to jump to another one. ( this has to be a problem with the way I set up what makes it change.)
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Wed Sep 09, 2015 1:35 pm

every tick set the phrase number to random and then you can also do "Every X Seconds".
For the X put Random (10,20) (Or however long you want the time between attacks to be.)
and than for you action just make the boss do his attack and phrase. To make him not do the same attack twice you add another variable for "Last attack used".
Everytime the boss uses an attack set the Last Attack Used to what every phrase number that was and then add a condition to the attack checking if the new random number is NOT equal to the current one.
B
5
S
1
Posts: 24
Reputation: 650

Post » Wed Sep 09, 2015 2:57 pm

Check out this capx. It's not perfected yet, but it's a start on phases. I'm gonna create my own thread to get suggestions on it. I've got a lot to learn myself. It turned out to be an interesting project helping here. One thing, this is a little rough. In a professional project of my own I would have set the boss to near it's original position after any moving left, right, up, or down, but it's something to work with.

https://www.dropbox.com/s/yvqcmko3sew70 ... .capx?dl=0
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 09, 2015 5:10 pm

Thank you all for the help, I been working on using the phases for the boss for a bit now but I was wondering how others would do it. It gives me ideas on how to make the boss more dynamic.
Currently my boss is set up using animations to control when it changes it phases. This makes the phase take the same amount of time each time it goes into it which can make it easier for the player to predict the boss and fight against it. Something I did is make it where the boss has a default phase I call Phase0 and after each phase the boss goes into phase0.
Phase0 is the phase that controls which phase it goes into next. What I want to do is make it where it cannot go into the same phase it was in before it went back to Phase0.
So an example would be
0,1,0,2,0,1,0,3
0 is the default phase and 1-3 are the other phases.
an example of what I dont want it
0,1,0,1,0,1,0,3
I do not want the boss to be able to keep repeating the same phase over and over again. This way it makes it more likely the player will see more of the bosses phases and keeps switching up what it is doing.
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Wed Sep 09, 2015 5:11 pm

Thanks again for the feedback it is really helping me structure my boss better.
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Wed Sep 09, 2015 7:22 pm

Yeah, the example isn't perfect, but at least it's a stepping stone. If you can debug it a little, you'll have a pretty good place to draw ideas from.
B
7
S
2
Posts: 92
Reputation: 663


Return to How do I....?

Who is online

Users browsing this forum: Cryptwalker, Yahoo [Bot] and 4 guests