How do I make a dashing boss

Just started using Construct 2? Post your questions here

Post » Wed Jun 14, 2017 5:36 am

I'm trying to make a boss that moves around left and right and every once in a while dashes at the player. also the back would be the only weak spot.

this is what I have now and it's just not working very well... he stays in the dash animation (it's set to not looping and repeat once, 2 frames, speed 5). he doesn't always face the right direction either. no idea how to do the weak spot yet. And I guess I should so something where it checks if it's X is bigger or smaller than Player.X and then charge toward the player?

Image

So something like this: https://youtu.be/0bKBnyDcipU?t=232

I'm also thinking having the boss crash into walls and rocks droppping from the ceiling then but I'm trying to get this basic behavior down first
B
11
S
1
G
1
Posts: 26
Reputation: 550

Post » Wed Jun 14, 2017 6:22 pm

Hi,
I watched the video you referenced.
I think it is much simpler than all the weird stuff you have :D

So your boss is doing 2 things. 1) Moving after player and 2) Sometimes dashes at player.
So here is my suggestion to you:

Create 2 GLOBAL variables:
1) BOSS_moving = 1
2) BOSS_dashing = 0

Then you don't need all this direction stuff. The boss is simply going after the player in the video you referenced. So you simply say:

CONDITION #1: Player.X less than BOSS.X
and CONDITION #2: BOSS_moving = 1
ACTION = BOSS go left

CONDITION #1: Player.X more than BOSS.X
and CONDITION #2: BOSS_moving = 1
ACTION = BOSS go right

that's all there is to it for Part 1.
Then you have your Part 2: the dashing business. For this you simply say:

CONDITION #1: using SYSTEM every random(2,5) seconds
CONDITION #2: BOSS_moving = 1
ACTION #1: set BOSS_moving = 0
ACTION #2: set BOSS_dashing = 1

CONDITION: using SYSTEM >>> BOSS_dashing = 1
ACTION: BOSS super dash attack badaboom badabang

CONDITION: on end of animation of big BOSS badaboom
ACTION #1: set BOSS_moving = 1
ACTION #2: set BOSS_dashing = 0

And that's all there is to it :)
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152

Post » Tue Jun 20, 2017 7:24 am

DolyGamesCosmos wrote:
CONDITION: using SYSTEM >>> BOSS_dashing = 1
ACTION: BOSS super dash attack badaboom badabang

CONDITION: on end of animation of big BOSS badaboom
ACTION #1: set BOSS_moving = 1
ACTION #2: set BOSS_dashing = 0

And that's all there is to it :)


personally id prefer to put it as :

CONDITION: on end of animation of big BOSS badaboom
ACTION #1: set BOSS_dashing = 0
ACTION #2: set BOSS_moving = 1

, its not much of a difference, but can create animation bugs if 2 are on at once. something to think about also, is whether damage is done pre animation, during animation, or post animation. by doing post animation you could implement a block feature, where is if dashing = 1, and on collision, -sub event - x pressed damage = 0, x not pressed damage =20. sorry, thats nowhere near as nice as the prior badabooms, but i tried.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774

Post » Tue Jun 20, 2017 8:10 pm

Thanks for the replies guys! I've been traveling but I can try this tomorrow.


edit: I tried this but the boss is just stuck in place in the dash animation... (I set it at speed 5, loop Yes, count 3, repeat to 0, ping pong No. It has 2 frames)

Image

edit: actually the boss immediately dashes to the right (and then gets stuck there on an obstacle). I have no idea
B
11
S
1
G
1
Posts: 26
Reputation: 550

Post » Wed Jun 28, 2017 4:48 pm

The boss just keeps going to the right.
@the_Shit_hawk
@DolyGamesCosmos

Any ideas?
B
11
S
1
G
1
Posts: 26
Reputation: 550

Post » Wed Jun 28, 2017 5:35 pm

You took out the code that makes direction 1 and 0 mean something. The reason it's still moving and toward the right is because it's set to a bullet. I sent a PM anyway.
B
45
S
15
G
73
Posts: 2,026
Reputation: 43,434

Post » Thu Jun 29, 2017 12:35 am

plinkie wrote:You took out the code that makes direction 1 and 0 mean something. The reason it's still moving and toward the right is because it's set to a bullet. I sent a PM anyway.

theres this, unless its just unshown.
could also do something like,
If dashing = 1, set boss bullet speed to 80 , set bullet angle to player.x,player.y , set boss bullet enabled, wait .3 seconds, set boss bullet enabled.

if boss is in collision with player - do 20 damage
subevent- Dashing = 1 - do 40 damage

this would allow you to leave bullet behavior as stated above, but would "rocket" the boss momentarily at the players exact position. you could also set angle to player.x,player.y , and add a wait, to instill a "keep moving" aspect to the game. instead of attacking your current position, they would attack where you were X seconds ago.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774

Post » Tue Aug 01, 2017 12:11 pm

It was just unshown.
It's working ok now, thanks to plinkie
B
11
S
1
G
1
Posts: 26
Reputation: 550


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests