Set explosion to size of destroyed rock

Get help using Construct 2

Post » Thu Oct 24, 2013 11:28 am

Hello all,


Just wrote a whole story to see it destroyed by the forum because there was a link in it 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    
B
6
S
1
Posts: 14
Reputation: 566

Post » Thu Oct 24, 2013 11:41 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 11:56 am

I would like to believe I did a similar thing, but your method works perfectly, thanks!
B
6
S
1
Posts: 14
Reputation: 566

Post » Thu Oct 24, 2013 12:03 pm

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!
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests