Revert fade effect?

Get help using Construct 2

Post » Fri Aug 08, 2014 4:02 am

Hi there, I'm new to Construct and I'm trying to use the fade out behavior revealing the new rooms I enter, in a way that the room I was before fades to black. (So in a house with many rooms, the only one visible should be the one I'm in)

So far I'm able to reveal the new room with the fade behavior, but my problem is with the other room... How can I make it turn to black slowly and fluidly (sort of a reversal fade effect) and not all of a sudden?

I don't know if I'm being clear but thanks in advance!
You do not have the required permissions to view the files attached to this post.
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Fri Aug 08, 2014 1:34 pm

Try this...

fadetest.capx
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
1
Posts: 534
Reputation: 2,735

Post » Fri Aug 08, 2014 9:16 pm

it says i can't open the file because i'm using the version 173 and it was made in a 175 version... But the 173 version is the last one isn't it?

EDIT - I got it to work, thanks! But still, if I keep running quickly from one black area to another, right next to their borders, it kind of bugs...
Sometimes the area I enter gets black, sometimes the area I leave gets visible... Isn't there a simpler way to do this?
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Sat Aug 09, 2014 1:53 am

This is not as easy as it seems. I finally got something going with LiteTween. It's a 3rd party plugin but you can do some amazing things with it, if you can work it out! I'm still not 100% sure why this works and lots of other variations I tried didn't..

behavior-litetween_t70700

LiteTween is a behaviour so put it in the behaviours folder not plugins.

revert_fade_codah.png

revert_fade_codah.capx


For this I changed platform behaviour to 8-direction to navigate the 4 rooms. Just to demonstrate proof of concept.

4_rooms_codah.capx
You do not have the required permissions to view the files attached to this post.
Last edited by codah on Sat Aug 09, 2014 2:53 am, edited 1 time in total.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Aug 09, 2014 2:37 am

Give this a go - I hope it's the kind of thing you're after. I removed the fade behavior from sprite4 and added a FadeIn and a FadeOut boolean. The booleans are set according to whether or not the player is overlapping the shade sprite, another event then takes care of the fade in or fade out effect, using dt to ensure a smooth fade effect....

Edit - deleted the file because I was dumb - see below for a fully working example!
Last edited by Colludium on Sat Aug 09, 2014 11:53 am, edited 2 times in total.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Sat Aug 09, 2014 2:48 am

Colludium wrote:Give this a go - I hope it's the kind of thing you're after. I removed the fade behavior from sprite4 and added a FadeIn and a FadeOut boolean. The booleans are set according to whether or not the player is overlapping the shade sprite, another event then takes care of the fade in or fade out effect, using dt to ensure a smooth fade effect....


The right-hand room never fades out?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Aug 09, 2014 3:36 am

thanks for the answers, I'm trying them out!
the one from Colludium looks simpler, but yes, the right room doesn't fade... The events are only dealing with Sprite4, which is the one in the left
Any way to make all the shadow sprites behave the same way with these events?
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Sat Aug 09, 2014 3:46 am

Simpler than 2 events? :geek:

rogergaps wrote:Any way to make all the shadow sprites behave the same way with these events?


My demos do, see above... First has 2 rooms, second has 4. Event sheet unchanged.

If you don't have 176b
https://www.scirra.com/construct2/releases/r176
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Aug 09, 2014 4:06 am

thanks, codah, I'll try to apply this to the original game and come back to you

edit - it doesn't seem to work in the original project. When I enter a new shadow area all shadows disappear... maybe I'm missing something...
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Sat Aug 09, 2014 4:22 am

Hm that's a shame.. Be sure you have the initial opacity values, etc. correct on your sprites. Use mine as an example. You could post your capx, or PM it to me.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, ignaciosimo, nickar and 40 guests