Flashlight type effect on an image

Get help using Construct 2

Post » Sun Jun 10, 2012 6:50 pm

Hi I am begining a new project whereby the player can see a map but can only see the geographical info. As the game continues the players influence increases and so they can see more things on the map e.g. cities armies etc.

I realise I could make each individual item an image and it appears as the influence gets bigger, but ideally i would like to do it with two images. 1 which is the background and has everything on it and then a top image that has no objects on it.

Then like the flashlight example the sphere of influence would show the sprite below rather than the top object or create a hole in the top sprite. I would ideally like to do it this way as it will be a lot easier to build the game with a simple set of events like this than creating every city and item on the map as a seperate object.

Any thoughts on how this could be achieved?
B
25
S
7
G
5
Posts: 185
Reputation: 5,056

Post » Sun Jun 10, 2012 8:14 pm

The flashlight and effects examples pretty much show what you need to know, but here is an example with a complete treasure map on one layer, and a blank map (just the second frame of the default map animation) and view hole sprite (with effect set to Destination out) on another layer which has Force own textures set to Yes.

Where ever you touch the map a view hole is created so that the player can see the completed portions of the map. There is a fade behavior on the view hole to make it fade in gradually just for kicks.

Of course if you want to expose certain locations on the map, you would carefully position the view hole rather than creating it where the player touches.

treasureMap.capx

EDIT: I'm making a quick tutorial right now that goes into a little more detail about placing points of interest and exposing them through events. Should have it done by tomorrow.kittiewan2012-06-10 20:32:14
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Sun Jun 10, 2012 9:10 pm

Hello @Kittiewan
Your exemple is really interesting. I was wondering. How would it be possible to make the "X" active as a link/trigger once it is revealed on the map ?
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Sun Jun 10, 2012 9:47 pm

hi @kittiewan thank you for the capx thats exactly what i needed to know, was having issues with it, and this solves my problem perfectly thank you.

A tutorial on this combining it with events would be awesome naturally :).
B
25
S
7
G
5
Posts: 185
Reputation: 5,056

Post » Mon Jun 11, 2012 3:42 am

@Laurent - To make the X interactive just spawn a sprite at that location that triggers some events when it is clicked. I'll add that to the tutorial.

@AGTilley - Glad it is what you had in mind. I'm almost done with the tutorial project. Just going to add the X hotspot Laurent asked about and then write the actual text.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Tue Jun 12, 2012 7:50 pm

The tutorial morphed into something a little different. Rather than spawning the map locations they are placed and ... well, just go take a look.

Making an Interactive Treasure map

B
29
S
11
G
12
Posts: 281
Reputation: 11,888


Return to How do I....?

Who is online

Users browsing this forum: spcsmrf and 22 guests