Set explosion to size of destroyed rock

0 favourites
  • 4 posts
From the Asset Store
Retro Weapon Sprites suited for classic style RPG games.
  • Hello all,

    Just wrote a whole story to see it destroyed by the forum because there was a link in it <img src="smileys/smiley19.gif" border="0" align="middle" /> no way to get my original question back. So here we go again..

    I'm new to Construct 2 and trying to recreate an old game I once made in Div-gamestudio.

    I had a link to the start of my game here, but that's not allowed, so I don't know how to show it to you. So I hope you can help me with just the explanation of my problem.

    In the game you shoot rocks that fall from the top of the screen. All the rocks get a random size (random width and height) when they get created.

    Now when I shoot a rock, I want to know the width and height of this particular rock. I want to use this to make the explosion bigger for bigger rocks and smaller for smaller rocks. Also I want to make the point you get and powerups dependent of the size of the rock you shot.

    I don't seem to get this to work. When is set the size of the explosion to the self.height and self.width of the rock (in the event that checks the collision of the rock with the bullit) the values that are returned don't seem to be of the rock that is destroyed.

    I hope I made my problem clear, thanks in advance!

    *now copy my text so I don't loze it again <img src="smileys/smiley1.gif" border="0" align="middle" />

  • self.width is the width of the object referenced in the action.

    this should work though

    Rock on collision with bullet - rock spawn explosion

    blank subevent:

    • explosion set size to rock.height, rock.width
    • Rock destroy

    Maybe the subevent isn't even needed, but I think it keeps the event-sheet cleaner.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would like to believe I did a similar thing, but your method works perfectly, thanks!

  • Your problem could have been in the order of the events and or actions, but also in the picking of the objects.

    Glad this works for you!

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