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

Post Reply  Post Oekaki 
 

Posted By Message

Lonesome Drifter



Registered
  28/05/2012 18:24:24
Points
  14
29th June, 2012 at 29/06/2012 01:07:24 -

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
  07/01/2010
Points
  273
29th June, 2012 at 29/06/2012 02:24:20 -

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

 
n/a

Lonesome Drifter



Registered
  28/05/2012 18:24:24
Points
  14
29th June, 2012 at 29/06/2012 05:29:18 -

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
  07/01/2010
Points
  273
29th June, 2012 at 29/06/2012 06:00:12 -

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

 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
5th July, 2012 at 05/07/2012 22:22:51 -

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

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

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 06/07/2012 05:31:24 -

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