make the explosion smaller and fade out

Discussion and feedback on Construct 2

Post » Sat Oct 15, 2011 12:07 am

Hi, I'm a newbie here.
I just started using Construct2 few days ago.
I love this program so much.

I follow the tutorial of guy shooting monster.
Right now I want to make the explosion become smaller and fade out, otherwise it'll be on the scene and block Player's vision.

I think it should be in edit animaion, but I don't know how to set it.
Anyhelp,please?
B
3
G
1
Posts: 27
Reputation: 584

Post » Sat Oct 15, 2011 4:51 am

Hello imissu2

To make the explosion smaller click on, and select your explosion sprite. Then on the left in the properties window were it says size you can change the size of your sprites there.

To make it fade out, in the properties window select add/edit next to were it says edit behaviors. In the new window click on the add new button. Then in the new window under general select Fade then close window, and go back to properties window, and were it says fade out time you can adjust the speed. 0.5 is a good speed for an explosion.

Hope this helpsWink2011-10-15 05:01:36
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sat Oct 15, 2011 9:14 am

Hello, Wink.

Thank for your help. The fade works well.

But for make it smaller. I want to play with explosion.
Like when it explore, then it will get smaller and fade out of the scene.
B
3
G
1
Posts: 27
Reputation: 584

Post » Sat Oct 15, 2011 9:19 am

You mean you want to make it smaller as it plays?

Make a new event, "Every tick", and "Explosion - 'Exploding' animation is playing" with the conditions "Explosion - Set width to Explosion.Width-1" and Explosion - Set height to Explosion.Height-1".

You can change the "-1" to be bigger to make it shrink faster, or smaller to make it shrink slower. It might need to be smaller -- getting a pixel smaller every tick will make it shrink really fast.

Hope that helps.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Oct 15, 2011 9:32 am

Thank you so much SullyTheStrange. :D
I'm so exciting.


Now I'm looking for "Playagain" button Tutorial.
B
3
G
1
Posts: 27
Reputation: 584

Post » Sat Oct 15, 2011 9:35 am

To restart the level? You can use a trigger like, for example, "On key pressed - P" along with the action under System "Go to Layout" and set it to the current layout, which should restart it. However, I think the player will still be standing in the same spot as before, not the original spot, so you should also use the "Player - Set position to" and put in the starting X and Y.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Oct 15, 2011 10:17 am

SullyTheStrange :

I like to have a blackscreen say "Gameover" with the "Restart level" Button.

Can we do that in C2?
B
3
G
1
Posts: 27
Reputation: 584

Post » Sat Oct 15, 2011 10:21 am

Sure thing. But it'll take a bit of work.

You need to have a black sprite set over the screen, with an opacity of 0 so you can see through it while playing. Preferably on a layer ath the very top, where there Parallax on the left side is set to 0,0 -- that means it won't scroll, so it'll always be over the screen. When your health hits 0 and you want the black screen to appear, use the opposite of the Fade event you used to make the explosion fade. Instead of disappearing(going from 100 opacity to 0), like the explosion, you want the black screen to reappear(going from 0 opacity to 100).

Once it's there, you can either use a sprite that says "Game Over" or have a text object display the words. From there, you can use the events I suggested before to press a button and restart the level.

Hopefully I explained that well enough.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Oct 15, 2011 10:37 am

Hi,SullyTheStrange.

I tried add Gameover layout, put the restart button on it.
and add action
     system >set score to 0
     system >Go to main game.


Right now the problem is :
1. When start, it jump to Gameover page first.
2. After click play again, the Button still in the main page.
B
3
G
1
Posts: 27
Reputation: 584

Post » Sat Oct 15, 2011 10:39 am

Hm... Do you think you could post your .capx using Dropbox? It would be a lot easier to help if I could see exactly what you're doing.

If you've never done that before, it's definitely something to learn. Everyone here uses Dropbox to share files -- you make an account at dropbox.com, download the manager, and now you have a new folder on your computer called "Dropbox", which should be under Desktop and Downloads in Windows Explorer or whatever they call that. Next, move your .capx file into the Public folder of Dropbox and go to the website, copy the public link, and post that here. Then we can download it and help you further.SullyTheStrange2011-10-15 10:41:36
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, ishmaelmoreno and 13 guests