Light is vertical scrolling platformer with focus on the preservation of light. The goal is to reach the end of the level before the light reaches zero; along the way, the player can pick batteries which will recharge the light’s battery.
The game incorporated a number of techniques that I learned during a 2D graphics course taught by John Pile at Champlain College. The techniques consist of particle effects, shaders, parallaxing, animations, interpolation, and more.
Light was developed using XNA 4.0, and it’s configured to run on both the PC and the Xbox 360.
As a graphically focused game, gameplay is limited to the preservation of light and the search for an exit. Navigation consists of walking and jumping. At one point during development I prototyped a climb function, which works but needs improvement before it’s added game.
The following images show the basic concept before development started. The only features that remain incomplete are the enemies and elevators. Since the project was used to demonstrate 2D graphics techniques, enemies were not critical; however, if I decide to continue working on this project, enemies and several additional game objects will be added.
During the development of Light, I built an in game level editor. New levels can be constructed in-game on the PC or Xbox 360 using a keyboard or gamepad. The editor is configured to expand infinitely in the vertical direction and with some minor modification the levels can be expanded in the horizontal direction as well.
Important Editor Functions:
- Cycle through tiles
- Set tile position
- Set tile rotation
- Set tile depth (0 to 1)
- Quickly place tiles
- Increase/Decrease rows (vertical height)
- Change background color
- Change levels
- Save levels
The editor uses the tiles pulled in from the games texture atlas. Here’s a subset of the tiles contained in the atlas:
Levels are read in and saved out to XML files. The level XML files look something like:
The editor currently functions as indented, but the addition of a GUI interface would simplify the level creation process. Currently the only way of viewing tiles is by cycling through them one by one, it would be much easier to scroll though a visual list that presents multiple tiles at once. Providing menus and mouse input in addition to the keyboard controls would simplify some of the complex keyboard and gamepad input.
The following HLSL shader is used to create a gradient circle around the player. The size of the circle will changes according to the remaining battery power.
Battery Particle Effect
The core of Light is the preservation of the battery power. Batteries have been placed throughout the levels to refill the player’s battery. When the player collides with a battery pack the shell of the battery breaks away leaving the battery power. The visual feedback for the shell breaking is generated using a particle effect:
For more particle effects, see my previous post.
While developing the game I didn’t have time to create a character walking animation, so I used a circle that gradually rotated to demonstrate the functionality. The animation will change according to the characters current velocity. While cel animations work well for simple animations, a more robust skeletal animation system would allow for more flexibility. When I have more time, I’d like to work on developing a 2D skeletal animation system.
change frame (not taking time or velocity into account): frame count++ if (frame count >= number of frames) current frame = 0
November 28, 2011