Simple per pixel lighting system

BlitzMax Forums/BlitzMax Programming/Simple per pixel lighting system

@Jeroen
The artwork is not mine its from Zelda 3: A link to the past
But I'll take the credit, sure :)

@tonyg
My plan is to get a good amount of source code and graphics ready for a community project. The project should a tile-based game engine. My hope is that beginners will be able to learn how to program games from it. It will sort of be a framework to create games off of. Here are some things I had in mind:

* Console System - Will provide debugging and other
functionality. Variables can be viewed and changed,
commands can be issued, etc.

* Vector Math - Library with easy helper functions
(Finding angles, etc)

* Entity System - Each game object will be
an entity at the core

* Entity Collision - Box vs. Box(possible rotation support),
Ellipse vs. Ellipse, Ellipse vs. Box, Poly vs. Poly
All routines will detect overlap and will work with high
speed objects. Each test will also return the smallest
vector required to separate objects making collision
response a lot easier

* Basic Collision Response - An object's response type will
determine what will happen when a collision occurs.
Objects should also support bounce and friction.

* Sprite System - Easier (animated) image handling.
Some added special effects.

* Model System - This will handle each game characters
animations. For each state the character can have an
animation played. Each model can be saved to disk. So
creating a character animation set can be done easily with
a separate tool.

* Camera System - This will allow for multiple viewports in
the game. Each camera will be able to follow a game
object, zoom in and out, move(scroll), shake, etc.

* Tile Object - These can be animated, or static.

* Tile Map System - This will display all the map
information, and will provide coordinate conversion
routines. Each map can have multiple floors with a various
amount of detail/overlay layers. Each floor will have a
Collision map attached to it. Things like bridges will be
easily achieved.

* Player object - Will handle each player. Players will be
updated via Finite State Machine AI, which will be
triggered by Input from the user. Controls will be easily
defined and changed on the fly.

* Game characters - Will handle each character. They will
also be updated via Finite State Machine AI loaded from
external files. Each character will have different
attributes applied to it, that will affect its decisions.
When enabled to do so characters will be able to
communicate with each other, group together, etc.

* Particle System - This will allow for various special
effects in game.

* Lighting System - Per pixel lighting for creating
atmosphere in game. Image based for flexibility.
Ambient light can be set.

* Weather/Day-Night - This system will allow for additional
special effects like rain, clouds, fog, night, day, etc.
It will use the other special effect systems to achieve
this.

* In addition a Game Object will control the flow of the
game and its different levels and objectives.

Thats the plan anyway. I hope to most of it implemented before any project is started. If there is a solid base code a community project will be much more successful.