How do I make my Boss AI ?

Get help using Construct 2

Post » Sat Oct 17, 2015 5:44 pm

Hello guys !

So, I'm making a platformer game and I'm in the first boss level.
I want when the player is next to the Boss, this last move away and shoots when he's away.
Sometimes, the Boss come next to the Player for draining his life.
At 50% of his life, the rythm speeds up.

The little problem is : How can I "program" it ? :?: :?: :?:

Please help me with some details !
I'm stucked in this for about 4 months.
B
4
Posts: 3
Reputation: 206

Post » Sun Oct 18, 2015 12:38 am

You just have to code things step by step.
If you want the ai to do things at certain times give him modes
So mode 1: move towards enemy. If im too close, set mode to 2?
Mode 2: move away from enemy.

If ai at certain distance { shoot shot function}
If at another distance { swing axe function}

And have a variable on the ai for time for attacks, so if timer1 <= 0 do special life drain attack
on life drain attack set timer to #
then just speed him up, or reduce timers.
B
10
S
4
G
3
Posts: 223
Reputation: 3,458

Post » Sun Oct 18, 2015 8:09 am

When I said "this last", I meant the boss and... modes ? What and where are those ?
B
4
Posts: 3
Reputation: 206

Post » Sun Oct 18, 2015 8:26 am

I'm new to construct 2 and still figuring this out myself but...

modes could be done via instance variables, the trick is to set what changes the instance variable, it could be random or triggered by x position...
B
7
S
1
Posts: 29
Reputation: 514

Post » Sun Oct 18, 2015 8:50 am

If you want the boss to have certain actions under certain conditions, you have to create those conditions and attach the actions..

It's like programming anything else..
First decide what you want the boss to do..
then decide when he should do itband when not..
then create the events/conditions based on that..

let's for example say your boss has an attack he only performs when the player is within 100 to 200 pixels to the left of the boss

system is between values : player.x (is between) boss.x-200 (and) boss.x-100
> boss play attack
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Dec 20, 2015 9:26 am

I did the shooting and the draining(only when I go next to him), I need the moves and the "Sometimes, the Boss come next to the Player for draining his life"

Please help me !
B
4
Posts: 3
Reputation: 206

Post » Sun Dec 20, 2015 12:30 pm

When should the boss move?
When should the sometimes be?

What are the conditions for those actions?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: alextro, tarek2, wenwen11212016, Yahoo [Bot] and 10 guests