Flashlight type effect on an image

0 favourites
  • 6 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • 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?

  • 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.

  • 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 ?

  • 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 :).

  • 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.

    - 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)