How do I Group a cluster of bullets?

0 favourites
  • 8 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • 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

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

  • 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?

  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • chrisyamao

    Cool Buddy

  • > 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

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)