How do I Group a cluster of bullets?

Get help using Construct 2

Post » Tue Aug 29, 2017 2:59 pm

Hi guys!

In my game i need to spawn 5 stars, from the center outwards, whenever an enemy is killed, like in a "poof!" cloud

I created the sprite STAR with bullet and fade behaviours.

As a test, I put 5 in the layout, i rotated them by hand in the layout and place them close to each other, to preview it and see how they bullet outwards and fade. It worked fine!


But as far as i know, when event "enemy - on destroyed" occurs, i should set the star spawn 5 times, each with its own angle and position, like this:
System - create object - Star
Star - set angle
Star- set position

System - create object - Star
Star - set angle
Star- set position

System - create object - Star
Star - set angle
Star- set position

System - create object - Star
Star - set angle
Star- set position

System - create object - Star
Star - set angle
Star- set position


Isn't there a way i can take the 5 i put in the layout as a test, group them and turn them into an object "star cluster", remembering how many instances there are/position/angle/scale from each other?
And then just make an event be:
Enemy - on destroyed - System - create object - Star cluster
B
5
Posts: 25
Reputation: 271

Post » Tue Aug 29, 2017 3:20 pm

I want to help you, but I do not know exactly what you want. Can you tell me clearly?
B
10
S
2
Posts: 24
Reputation: 723

Post » Tue Aug 29, 2017 4:55 pm

omerturac wrote:I want to help you, but I do not know exactly what you want. Can you tell me clearly?



Thanks! i'm sorry for not being clear.
I'll try to be as clear as i can;

In my layout i have placed 5 instances of a bullet (a star shape).
they are all angled differently and fade out after 1 second.

i want every enemy to spawn this chunk of stars on destroyed.

Is there a way i can GROUP these 5 instances on my layout, and turn them into an object? (name eg: chunkOfStars)

So i can make:
Enemy - on destroyed : Enemy - Spawn object - chunkOfStars

or there's no other way than making an action for each individual star spawned and the specific angle?
B
5
Posts: 25
Reputation: 271

Post » Tue Aug 29, 2017 7:03 pm

B
41
S
25
G
87
Posts: 305
Reputation: 48,088

Post » Tue Aug 29, 2017 8:07 pm

Message: chrisyamao can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
tarek2 wrote:@chrisyamao

Maybe something like this?
https://www.dropbox.com/s/jbdmeobuycms5te/ShootingStars.capx?dl=0



This is precisely what i needed. Thanks so much tarek!
B
5
Posts: 25
Reputation: 271

Post » Tue Aug 29, 2017 8:18 pm

@chrisyamao

Cool Buddy
B
41
S
25
G
87
Posts: 305
Reputation: 48,088

Post » Wed Aug 30, 2017 2:44 pm

chrisyamao wrote:
omerturac wrote:I want to help you, but I do not know exactly what you want. Can you tell me clearly?



Thanks! i'm sorry for not being clear.
I'll try to be as clear as i can;

In my layout i have placed 5 instances of a bullet (a star shape).
they are all angled differently and fade out after 1 second.

i want every enemy to spawn this chunk of stars on destroyed.

Is there a way i can GROUP these 5 instances on my layout, and turn them into an object? (name eg: chunkOfStars)

So i can make:
Enemy - on destroyed : Enemy - Spawn object - chunkOfStars

or there's no other way than making an action for each individual star spawned and the specific angle?


Yes, Projects Bar ▼ Families
B
10
S
2
Posts: 24
Reputation: 723

Post » Wed Aug 30, 2017 4:54 pm

@chrisyamao

Probably you spot it already by now but I will mention it just in case, I forgot to reset the Global variable "StarsAngle" to (0) other ways it will keep adding the numbers to the "StarsAngle" and it will keep getting bigger the value unnecessary

So in Event 3 you can just add one more action to reset it to 0 before destroying the enemy

Mouse>> On left clicked >>on enemy
>>SubEvent Repeat 5 times
>>>>>>>>Actions: set "StarsAngle" To 0
>>>>>>>>Actions: Destroy enemy

That will keep the variable between 0 to 360 Max
B
41
S
25
G
87
Posts: 305
Reputation: 48,088


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests