Light Sources
raze_struck
Member, PRO Posts: 141
Hello all,
I'm trying to find a way to make several torches in a scene where you can tap on one of the torches and a small light source will appear, illuminating a small area around that torch. The entire screen is dark, with the exception of the torches being visible and light when touched.
Thank you
Raz
Comments
I've found this demo to be helpful: https://www.dropbox.com/s/hxu4kgdonpropmk/flashlight_demo.gameproj.zip
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You could have a self.boolean in the torches and when touch is pressed spawn light source at torch XY position.
You can even choose to spawn above or below the actor or at the top or bottom of the scene.
Darren.
First, check out this lighting tutorial video tutorial from tshirtbooth. The video should already give you a couple hints at how to achieve what you want.
For your game, you'll probably make use of multiple Actors that act as unlit/lit areas.
There will be multiple ways to go about this.
The first to come to mind would be to make use of two images, one similar to the one used in the video above (lit), and another that is also similar to the one used in the video but a lot darker (unlit) (you probably wouldn't want it pitch black).
Or, you can play with opacity instead. It's up to you
Hey, ill definitely check out the link, its not the logic that's troubling me its the graphical aspect behind, thanks Darren, but i'm more concerned about the layering of the images.
How do I open the windows based file ? Its says its 1 kb?
It's important to plan ahead before executing anything art-related, so I can agree with your concern.
Will your lit areas be overlapping? It might be easier to pull this off if they won't.
I really want to create mock images for you, but I'm using my work laptop and I don't have editing software at my disposal right now.
Thanks Gabfather, well essentially its a side scroller, so I just need to be able to provide light on a platformer perspective. So far example, when you tap the torch a light source will show up and you can see where to jump to, and then move on. That's the kind of idea.
When I download the file, its showing up as 1kb, how do i open the windows file in gamesalad, do I have to rename something?
Are you using Windows? You posted to the "Working with GS (Mac)" subforum so I just assumed you were using a Mac. If you Google convert windows gamesalad mac you'll see links to videos that explain how to convert from Mac to Windows.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Borrowed someone else's computer here you go, something like this.
4 Actors in this rough example, but they don't overlap which makes things easier (doesn't always look the best though).
edit: I realise you'll need to find a way to make the rest of your scene unlit. Should be easy enough to figure out from this point on.
Sorry, I typically use a mac, but im @ work, will do thanks
ahhhh, I see what you mean now, thanks !
Are you moving the torch around to see areas or just tapping on the torch to uncover areas?
Just tapping to uncover areas
How many torches would be displayed at once?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support