My favorite part was the part when all the dummies mob you and also when the entire place breaks out into flames Also the hallucination parts are cool. The end boss was kinda anticlimactic though.
Also it's not as fun the second time around
My favorite part is when you fall down into the Hallway of Shortening doom
So when will you add the next level?
It's being worked on right now
It has a lot of new features so its taking a long time, lots to code!
Remember earlier, when I said I was interested in porting this game to Xbox 360? I still am. Could you post, in detail, how you go about casting shadows?
Alright, there are 4 types of shadows that are cast by light sources (yes plural) in the game. 2 types of shadows cast for each of the 2 types of light sources. The two types of light sources are the single Dynamic Light Source, and all of the Static Light Sources. There is only a single Dynamic Light Source, but there can be any number of Static Light Sources. As per their names, the Dynamic Light Source can move freely, and the Static Light Sources are fixed once they are created.
First, here are all the Shadow Buffers I have in the game. Shadow buffers are overlayed over the world Tilemap using OR logic. Transparent parts of a Shadow buffer represent lighted areas, while black areas represent shadow.
Primary Shadow Buffer:Shadows cast by the tilemap walls and objects are cast onto this buffer.
Secondary Shadow Buffer:Shadows cast by certain objects are cast onto this buffer.
Flashlight Buffer:This buffer creates shadow anywhere the flashlight beam is not pointing, as well as 'cutting holes' in the darkness wherever Static Light Sources are.
Darkness Buffer:This buffer controls the overall darkness of the world. 100% is pitch black, while 0% has no effect (normal shadows).
The only reason there are 2 Shadow Buffers is so they can have separate transparency levels (since setting the transparency of a single image is faster than drawing many transparent rectangles). The Primary Buffer is usually set at 100%, while the Secondary can be set to any level to give certain object shadows that are partially opaque. The Flashlight Buffer also has a variable opacity, and can be changed to represent different 'intensities' of darkness. The Darkness Buffer can be used to completely black the screen, and is actually a virtual buffer located inside the Flashlight Buffer.
Dynamic Light Source (DLS)The Dynamic Light Source is usually tethered to the players flashlight, but can under certain circumstances be latched onto other objects such as Static Images or other NPC's, or simply set by the scripting engine to a certain location. The Dynamic Light Source is represented by a pair of position coordinates, which is a global offset from the top left corner of the map.
Wall Shadows:Wall shadows are shadows that the DLS casts on the walls of the tilemap. All opaque walls are tile number 0, and are 40x40 pixels. To cast the shadows, the engine readies a transparent Primary Shadow Buffer the same size of the screen. The engine loops through all tiles that are on the screen, and chooses the sides that are facing towards the location of the DLS. Using that side, and similar triangles, form a rectangle where the two sides next to the tiles side extend away from the location of the DLS all the way off screen, and are then connected with a 4th side to form a rectangle. Fill this rectangle onto the Primary Shadow Buffer and repeat for all sides for all tiles on screen. (this can be optimized by not drawing tiles that cannot be seen, but I haven't optimized it yet).
Object Shadows:Object shadows are shadows that the DLS casts onto objects which support shadows. Every object in the world has a Shadow Value, which ranges from 0 to 2. 0 means the object casts no shadow. 1 means the object casts shadow onto the Primary Shadow Buffer. 2 means the object casts shadow onto the Secondary Shadow Buffer. Shadows for the Objects are cast in much a similar way as Wall Shadows. Each object that casts shadows also has an array of lines that represent the bounds of the object shadow. When the object's shadow is displayed, each line in the list of lines is extended away from the light source and draws a filled rectangle onto the Shadow Buffer that the object defines.
Static Light Sources (SLS):Static Light Sources are pretty memory intensive. Each SLS contains an image representing the light gradient it casts onto the world. All of these gradients are sent to the Flashlight Buffer, where their images are subtracted from the overall buffer to create a kind of 'cut out' in the darkness of the flashlight.
Wall Shadows:Static Light Sources are static so that Wall Shadows can be precalculated when the SLS is added into the world. The method to do this is pretty much exactly the same as for the DLS, except you are casting shadows onto your own private gradient buffer instead of the Primary Shadow Buffer. Static Light Objects also are initialized with a brightness value, which controls the transparency of the buffer upon initialization, and costs no extra CPU. Transparency can also be changed dynamically during game, but at a small cost to recalculating the transparency controller.
Object ShadowsThese are also done in a similar fashion as the DLS object shadows, but everything is handled by the Flashlight Buffer code. When the SLS gradient is sent to the Flashlight Buffer code, its position, gradient bounds, light radius, and other information are also sent, to determine when an object is in reach of the light. If it is, it uses the same arrays of lines in the object to cast a shadow onto the Flashlight Buffer.
I hope that was enough detail for you, the shadow engine is very complex, and there is still more I could go into detail with. You could always check out the source code, as it is open source