Fade ground to black as Terraria?

Get help using Construct 2

Post » Sun Aug 11, 2013 12:12 am

So here's the example:



As you can see in the image,
ground is lighter near grass,
and as it goes deeper it fades to black.
How can I do that in C2?
I use 2 sprites, 1 for grass tiles and 1 for ground tiles.

Any idea?
B
6
S
1
Posts: 67
Reputation: 636

Post » Sun Aug 11, 2013 3:54 am

@martinx09,

There are probably loads of different ways to achieve this effect - here is just one possible solution.

https://dl.dropboxusercontent.com/u/184657779/ground%20shading%20example.capx

You could probably automate the creation of alternative shading effects on layout start if you wanted - but, unless your game is massive, this should probably suffice...

Budgie
B
7
S
1
Posts: 11
Reputation: 599

Post » Sun Aug 11, 2013 5:33 am

[QUOTE=Budgie] @martinx09,

There are probably loads of different ways to achieve this effect - here is just one possible solution.

https://dl.dropboxusercontent.com/u/184657779/ground%20shading%20example.capx

You could probably automate the creation of alternative shading effects on layout start if you wanted - but, unless your game is massive, this should probably suffice...

Budgie[/QUOTE]

It says that I can't open the file because it was saved in r140 and I have r139 but that's the latest version in the download section :S
B
6
S
1
Posts: 67
Reputation: 636

Post » Sun Aug 11, 2013 5:37 am

139 is the latest Stable release, r140 is the latest Beta release. You need to get the Beta version. If you are on steam right click Construct 2 and choose to opt in to the beta releases.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Sun Aug 11, 2013 5:39 am

[QUOTE=BluePhaze] 139 is the latest Stable release, r140 is the latest Beta release. You need to get the Beta version. If you are on steam right click Construct 2 and choose to opt in to the beta releases.[/QUOTE]

Oh thanks!
If I update to r140,
I'll still be able to open files made with r139?
B
6
S
1
Posts: 67
Reputation: 636

Post » Sun Aug 11, 2013 6:04 am

Can't open r140,
downloaded 2 times on steam,
steam says it can't open the file :/
B
6
S
1
Posts: 67
Reputation: 636

Post » Sun Aug 11, 2013 7:51 am

Made a game ages ago that uses a very simple technique for that effect
All you need to do is

Make a new layer call it 'FOG OF WAR' or whatnot

Place a new object sprite in that layer
That is an Alpha blended PNG Sprite Blackout mask

much like the following

FOG OF WAR OBJECT


I tend to favor a HEXAGONAL shape but you can use any shape you like (you can even put WEB GL effects on it if you like for extra cool stuff ) as long as it has a well blurred overlapping area and a solid black area of reasonable size.
in the editor adjust its size to what ever requirements you require.
then spend the time either duplicating it manually or use a spawning script to cover your layout at the start of the layout.
There are plenty of easy ways to do this...

The add a 'FADE'behavior to the sprite...and set it to
'Active at start NO'
Leave FADE IN AT ZERO
Then set your delay and fade OUT times to what ever suits you
and finally destroy on fadeout yes

Then make a new event ..

->> player (or whatever you want to remove the fog of war)
is overlapping the Fog of war object
->> and another condition ->>'For each' Fog of war object

action
->>Fog or war -fade out Start
and thats it

each blob of black should fade out when your player touches it and stay gone...

The only issue is layout out all of the objects either manually (takes a long time unless you make duplicates 'ctrl drag') or use the script to

populate your layer via a spawning code that will overlap each Fog or war object
Adjust the Fog of war spacing and fade timing is really all you have to perfect...


See this capx for a very simple demo
:)

FOG OF WAR DEMO

Same system can be used for any game...platformers ..8 dir anything!!mystazsea2013-08-11 07:58:52
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Sun Aug 11, 2013 3:37 pm

@martinx09

Blast it! I reverted my version and re-saved it as r139 so it should work for you now. Give it and let me know if you get stuck.

Budgie.
B
7
S
1
Posts: 11
Reputation: 599

Post » Sun Aug 11, 2013 5:15 pm

[QUOTE=Budgie] @martinx09

Blast it! I reverted my version and re-saved it as r139 so it should work for you now. Give it and let me know if you get stuck.

Budgie.[/QUOTE]

Thanks!
I get it,
my game generates the world randomly,
so I'll need to think some way to spawn the black faded squares,
but I think I can do that. :)
B
6
S
1
Posts: 67
Reputation: 636

Post » Mon Sep 01, 2014 9:20 pm

Hey, sorry for bumping this.. but anyone got the dropbox links above? or atleast a solution for making the terraria block shading thing?
B
21
S
6
Posts: 244
Reputation: 2,655

Next

Return to How do I....?

Who is online

Users browsing this forum: jkmalau, MoscowModder, terence951, vegapomme27 and 9 guests