0 Favourites

Copy a specific object type from within a family

  • Sorry if this has been covered, but I wasn't able to find anything.

    Let's say I want to make copies of sprites on click. With a single sprite, we'd see something like this:

    On click Monster -> Monster spawn Monster

    Now, let's say I want to do that with a whole lot of different types of monsters. We have our family (BadGuys) and our sprites within that family (Bad1, Bad2, etc.). I want to make an event to the tune of:

    On click BadGuy -> Spawn BadGuy

    but the way Construct handles this, it is spawning a random sprite from the BadGuy family. I was thinking of trying to use instance variables, something like:

    On click BadGuy

    ->Set BadGuy.clicked to true

    ->Create BadGuy of same type as BadGuy with clicked=true

    or even:

    ->Set BadGuy.type to "Bad1"

    ->Spawn BadGuy.type

    but I can't find any way to do this. Help?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)