Forums → Programming Forum → Flash game - light in the dark
- 5 Replies
What I want to do is have a scene that is in total darkness, so effectively just a black screen, but where the mouse moves I want to reveal a circle of the scene as it would be if it were lit (does that make sense?) I still want to use the mouse to select items at the same time though.
Really all I'm after is a starting point rather than code to do it, has anyone got any ideas? I've been reading and reading, but can't figure it out from the books I have.
The only thing I can think of would be to have a circle that would follow your mouse around that would be a mask to reveal the level below.
This is how you would layout your levels.
Black Rectangle over level
The mouse mask would reveal the level below while keeping the rest of the level black.
Hope this helps. If you have any questions feel free to ask.
Thank you! I have a starting point, thats the main thing.
I desperately want to do this entire project on my own, but you know, it is becoming impossible to do what I want because the books I have are limited and I'm not familiar enough with Flash to realise its full potential.
Again, thank you though. No doubt I'll be back soon with more questions as I'm trying to tackle something right now that is a complete nightmare!
Definitely familiarize yourself with masks, they're a little tricky to understand. You should check out videos on youTube, that's what helped me out a lot.
Even if you can't get it right away keep up the good work.
It isn't the most pro way to deal with it, but you could make a big black rectangle with a hole in the middle, set the registration point in the center of the hole and make it follow the mouse.
(ignore my comment if this is what freck suggested...)
If you wanted to do an extremely complicated one made out of small boxes (not to small), you can create an array of black boxes that cover the whole screen and either
A) Make their opacity lower as your mouse gets closer (flash probably can't handle this many distance calculations)
B) Have invisible circles with larger and radii following the mouse that change the opacity of these objects as they pass over, and each farther circle will lower the opacity less. You can also just use one circle if you don't want it to be as smooth. This method is more complicated but will probably run more smoothly.
You must be logged in to post a reply!
We strive to deliver the best gaming experiences... on the internet and on your mobile phone. Play thousands of free online games, get access to free mmorpg games, online rpg games, fun online flash games, and more.
We offer free flash games in many different genres: online shooting games, online puzzle games, online war games, free online car games, free online hidden object games and dozens more.
This is the best place on the web to play online games for free... play on Armor Games! No matter what game style you prefer, we've got it here.
Gaming websites, passionate bloggers, and quirky streamers are welcome to share or review our games. If you need game keys, art, trailers, screenshots or more check out our press kit website.
Game developer? Visit developers.armorgames.com to request AG developer status, find documentation on our APIs, and get access to our development environment. Let's make sweet, sweet games together.
Looking for a publishing partner that can help your app rocket to success? Contact the mobile team to learn more about how we can help!