I have a partial solution to the Mythic 2D project, which illustrates one way to control the camera and user movements. You can get it with a Subversion client from the following URL.
https://web1.ias.csusb.edu:8443/my_mythic2d_cs
Move the mouse with the left button down to turn, and use the AWSD keys for standard movements.
For mid-term project, you have the option to complete the project defined on this page. The project is to create a foundation on which the AI and game play elements can be prototyped for a 3D multi-player role playing game under development at CSUSB called Mythic. Mythic can be described as a multi-player version of Oblivion. The resulting program should provide a means to develop the following elements of Mythic without relying on the existence of a 3D graphics engine, physics engine and sound system.
The mid-term project is not to do any of the above, but rather, is to create a foundation on which the above elements can be built.
The Mythic mid-term project is to complete Stage 1 as described below. The remaining stages can be done to satisfy requirements for the final exam projecct.
The camera sits above the 2D plane of the world and looks directly down. Through the screen, the user only sees a subarea of the world that is ViewWidth units in width. (The amount of area visible in the horizontal direction depends on the dimensions of the user's monitor.) When the user moves his or her character, the camera moves to display other areas of the world.
The player controls a character in a manner similar to a first person shooter. The character is represented with an image that is located in the center of the bottom edge of the screen.
The player moves using WASD keys in the typical manner. W means move forward in the direction the character is facing. S means move in the direction opposite to the facing direction of the character. A and D means strafe left and right, respectively. However, when pressing these keys, character symbol remains stationary in the center of the bottom edge of the screen. Instead, the world rendered around the character changes.
The mouse is used to move the direction that the character is facing. Moving the mouse will therfore rotate the visible world around the point that is at the center of the bottom edge of the screen, which contains a visible symbol of the character.
The purpose of making implementing the camera like this is to better capture the feeling of the user interface when the game play elements are later moved into a 3D game engine.
The area should be filled with regions that represent impassable barriers. Make these black, so they contrast with the white background. When the player moves through the area, his character should not be able to pass through these barriers. The following illustrates a state that the game may be in at some particular time.
The following image shows what the user would see in the screen for the above state of the world.
The line down the center of the screen represents what would be the crosshairs in a first person 3D view.
The user is not permitted to move the character beyond the extents of the area. If the user moves the screen to the edge of the area so that the screen footprint goes beyond the extents of the area, then fill the outside region with black.
Add enemies. When the player comes within a give radius of perception of an enemy, the enemy charges the player. When the enemy is within a melee striking radius of the player, it instantly kills the player.
The player has a ranged attack that is activated by pressing the C key (for cast). A projectile is launched in the direction of the crosshairs that instantly kills the enemy.
When the player dies, the game screen is frozen for 3 seconds and then the program resets to the initial state of the area.
Make the ranged attack a homing projectile.
Add health to the player character and enemies. Add mana (magic capacity) to the player character. Display the health of enemies by a green disk around the center of the enemy image. Maintain the area of the health disk to be in proportion to the enemy's health.
Display a green disk in the lower left corner of the screen to represent the health of the player. This is part of the heads up display (HUD). Also display a blue disk that represents the amount of mana the player has. The amounts should be proportional to the areas of the disks.When the player presses C to launch a projectile, decrement the current amount of mana by some cost.
Continue to build out the game. Here are some ideas: