TileLighting: a tilemap lighting system

(Alex Larioza) #1

TileLighting is tilemap-based lighting system, perfect for as rogue-likes and similar games. Please checkout the demo for example usage.

Note: demo requires Flash 11.2+


Flashpunk and lighting?
Rendering visible terrain only
Caved In 2 - Dig, dig, dig
A more efficient way to do tile-based lighting?
(Jacob Albano) #2

Very cool! I would suggest you mention that it requires a custom version of FlashPunk in the topic text, just so everyone is aware going in.

(Alex Larioza) #3

The engine does not require a custom version of FlashPunk, only the demo.

(Jacob Albano) #4

Ah, sorry, my mistake! I’ll definitely be using this in the near future. :smiley:

"Welcome Home" Game Jam!
Most efficient way to fake lighting
(Benjamin Snyder) #5

I was trying to run your demo, with your version of FlashPunk, and these lines are throwing errors:

FP.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, onMiddleMouseDown);
FP.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_UP, onMiddleMouseUp);
FP.stage.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, onRightMouseDown);
FP.stage.addEventListener(MouseEvent.RIGHT_MOUSE_UP, onRightMouseUp);

Those four mouse events are throwing the follow error.(I listed only one because they all were the same except for the property name)

Error: Access of possibly undefined property MIDDLE_MOUSE_DOWN through a reference with static type Class.

I went looking in the MouseEvent.as and I don’t see any references to those four. Is there a different version of said file that I need or am I completely missing something?

(Benjamin Snyder) #6

After some more digging and researching around I realized that my project was using 10.1 and I needed to use one more recent(11.2) to get access to those and it works great now.

Thanks for posting this its really great and is giving me some ideas of a few things I want to try to create using this.

(Alex Larioza) #7

Ah, I had made a note on Github, but I’ve added one to the post here too. :smile:

(ampersandbear) #8

It seems I just came about a weird bug, inexactitude or something. Well, there’s a difference in how lighting sources affect horizontal lines of blocks according to their relative position. Approaching a wall from above gives this result:

Approcahing from below gives a different one:

Could you please help me out with this problem? Thanks.