The Daily Click ::. Forums ::. Klik Coding Help ::. Lighting Effect?
 

Post Reply  Post Oekaki 
 

Posted By Message

Lonesome Drifter



Registered
  5/28/2012 6:24:24 PM
Points
  14
29th June, 2012 at 6/29/2012 1:07:24 AM -

Hey, does anyone know how to pull off a lighting effect in MMF2 like the one in this video? http://www.youtube.com/watch?v=uVzPmPfyRBE

I could really use that for the dark underground levels in my current game project. I'm kinda stuck on how to make this kind of effect, so any help would be appreciated.



 
n/a

vetmora120



Registered
  1/7/2010
Points
  281
29th June, 2012 at 6/29/2012 2:24:20 AM -

Did you ever see this thread?
http://www.create-games.com/forum_post.asp?id=176985&show=all

It may be what you're looking for.

In particular, see Sketchy's posts. He posted a couple of examples.

Edited by vetmora120

 
The universe of Vetmora.

Lonesome Drifter



Registered
  5/28/2012 6:24:24 PM
Points
  14
29th June, 2012 at 6/29/2012 5:29:18 AM -

I'm surprised no one has attempted this light effect much since MMF2 launched. There has to be a way.

Yes, I looked at the thread, but a couple of the examples are just using a mouse-controlled spotlight effect, which is NOT what I want for my project. Mine, similar to the video I linked to above, is supposed to have a circle around the player character while the background is surrounded by darkness. I am looking for something simple, nothing extremely complicated.


 
n/a

vetmora120



Registered
  1/7/2010
Points
  281
29th June, 2012 at 6/29/2012 6:00:12 AM -

All you have to do is just always set the x and y coordinates of the light object to the players x and y instead of mousex and mousey...

Edited by vetmora120

 
The universe of Vetmora.

s-m-r

Slow-Motion Riot

Registered
  6/4/2006
Points
  3180

Candle
5th July, 2012 at 7/5/2012 10:22:51 PM -

Here's an example from Castles of Britain. Go to the menu for Examples 2, then select "Examples S-T." The one you're seeking is "Spot Light Example."

Here's the link:
http://www.castles-of-britain.com/mmf2examples.htm

 
.

Silveraura

God's God

Registered
  8/8/2002
Points
  6744

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
6th July, 2012 at 7/6/2012 5:31:24 AM -

This effect is incredibly easy to do in MMF2. I've done it for ArcaneTale. Unfortunately, I don't have MMF2 installed right now but I'll let you know how I did it.

Image

First and foremost, you have to be using Hardware Acceleration in order for my method to work properly.

Next, create a new layer and set the co-efficient for the layers position to be 0,0 that way the layer doesn't scroll with the rest of the frame, it follows the camera. Now from coordinate 0,0 create a white object that's as large as the target resolution. For example, if your game is 640x480, make a white object at 0,0 that is 640x480 big.

Now create a sphere or gradient that's black and make sure it's in the middle of the white object because this is where the player should be if the screen is centered on them.

Last, the most important step... under the layers effects, change it to Subtract. This will make the white black and the black transparent.

If you did everything correctly (and the layer is ontop of everything you want dark) then you should get the effect you're looking for.

If you change the color of the white object, you can get off colors. Just remember that it's subtracting, so the color of the active object is the opposite of the color your offsetting. So a light orange for example, will give you a dark blue, which is perfect for night.

I hope this helps. If you have a hard time, I'll see if I can find my MMF2 disk and make you an open source example.

Edited by Silveraura

 
http://www.facebook.com/truediamondgame
   

Post Reply



 



Advertisement

Worth A Click