Due: in final period — Monday, December 7, 12-2:30pm
Goal: In this assignment you will apply what you've learned of basic WebGL and GLSL to build a simple game.Submission: Submit your partial and final assignment using this Google Form, and demo your assignment during the final exam period.
BASIC GRADING:
The main components of this programming assignment are:
- 5% Part 1: properly turned in program (new requirements!)
- 5% Part 2: display mushroom field, a centipede and bug blaster
- 10% Part 3: animate the centipede
- 10% Part 4: animate the bug blaster
- 10% Part 5: animate the bug blaster shots
- 10% Part 6: add the spider, flea and scorpion
- 10% Part 7: add at least three levels
- 10% Part 8: add scoring and multiple lives
- 10% Part 9: add animated effects and sounds
- 20% Part 10: make it your own
- Participation credit: Receive participation credit (outside of this assignment) for posting your resulting imagery and video, good or bad, on the class forum!
Note that there is no partial turn in for this assignment.
General:
Our suggested game is a modern 3D version of Centipede. If you are not familiar with the game, you can play it online here (2600) or here (arcade), view some historic gameplay on arcade or console, and find more information about the game at its Wikipedia entry here. There are also many other sources online.
If you would rather implement a different game, you may do so, providing you ask for instructor's approval by Wednesday November 18. To obtain that approval, submit your proposal using this form. Small teams are also acceptable, but the scope of the project must increase to match. Use the same form if you wish to propose a group project. For example, we will approve two-person teams that propose building Centipede as described below along with all extra credits to earn 100%.
Unlike previous programs, your game is not required to load specific assets (models, textures or lighting). You are free to hard-code paths to the assets your game requires.
We prefer you continue to improve your mastery by using WebGL. However, you may use any 3rd party game or graphics libraries you find, including three.js and Unity, but with a penalty of -20%. You may not use code from any implementation of Centipede you find online. We are aware of several such implementations and will be comparing them to your code.
Part 1: Properly turned in program
Remember that 5% of your assignment grade is for correctly submitting your work! For more information about how to correctly submit, see this page on the class website. Since we encourage variation in your games, make sure to include a readme file.
For this assignment only, you can also earn 1% extra credit by allowing us to make your assignment public, and providing us with some extra material to aid us in that. We will pick a few of the best assignments and publish them on our course website. If you wish to allow us, please also deliver:
Remember that 5% of your assignment grade is for correctly submitting your work! For more information about how to correctly submit, see this page on the class website. Since we encourage variation in your games, make sure to include a readme file.
For this assignment only, you can also earn 1% extra credit by allowing us to make your assignment public, and providing us with some extra material to aid us in that. We will pick a few of the best assignments and publish them on our course website. If you wish to allow us, please also deliver:
- a description: your game in four sentences or less
- a screencast: a video walking us through your game within a few minutes.
During the final exam period, you may optionally demo your game in front of the class (without a separate demo to staff). If you do, you will enter a competition for a $20 Amazon gift card. You will win if your fellow students vote your game the best. Students in teams will be in a separate competition from individuals (if there are enough teams).
Part 2: Display mushroom field, a centipede and bug blaster
Create and render the player's bug blaster, one 12-segment centipede, and field of mushrooms. The field should be divided (not visually outlined) into at least 30 rows, and at least 32 columns, with each cell potentially holding a mushroom. Each mushroom should be slightly smaller than its containing cell. At least 46 mushrooms should be randomly distributed across the grid, with 2 mushrooms per row. At least three rows at the top and four at the bottom should remain mushroom-free. Models should be 3D (full models or sprites, as you prefer), and the view projection must have perspective, with some foreshortening with distance. Fancy modeling is not necessary; cubes, spheres etc. are enough. Nothing needs to move.
Part 3: Animate the centipede
The centipede head enters at the top center, and randomly chooses an immediate left or right turn. It then proceeds along the row until it hits the end of the row, another centipede (see below), or the end of the row. It then moves down one row, and proceeds down the new row in the opposite direction to the previous row. If the new row has a mushroom in the cell the centipede enters, it does not move horizontally on the new row and proceeds to the next (third) row down. The other segments of the centipede simply follow the head.
When the centipede reaches the bottom row, it moves upward rather than downward. When it reaches the top row the player can reach, it moves downward again. This pattern repeats.
Part 4: Animate the bug blaster
The player's bug blaster can move to any cell in the bottom 20% of rows (for a 30 row field, that would be 6). It cannot move into a cell containing a mushroom. It can move in any direction, and need not be centered on any cell. You can move it with keys or the mouse, or both.
The player's bug blaster can move to any cell in the bottom 20% of rows (for a 30 row field, that would be 6). It cannot move into a cell containing a mushroom. It can move in any direction, and need not be centered on any cell. You can move it with keys or the mouse, or both.
If the centipede hits the bug blaster, the bug blaster dies, and the game ends if there are no more lives.
Part 5: Animate the bug blaster shots
When the player presses the space bar or mouse button, the bug blaster shoots one shot upward straight across the field. The player cannot shoot again until that shot either flies off the field, or hits a mushroom or centipede. The shot follows a straight line at a fixed velocity, so the player must shoot ahead of moving centipedes to hit them. One successful shot destroys a centipede segment, while it takes four shots to destroy a mushroom.
When the player presses the space bar or mouse button, the bug blaster shoots one shot upward straight across the field. The player cannot shoot again until that shot either flies off the field, or hits a mushroom or centipede. The shot follows a straight line at a fixed velocity, so the player must shoot ahead of moving centipedes to hit them. One successful shot destroys a centipede segment, while it takes four shots to destroy a mushroom.
When the centipede segment is destroyed, it turns into a mushroom in the cell where it was hit. If the centipede head is hit, the second segment becomes the head. If an internal segment is hit, the centipede becomes two centipedes, with those segments in front of the hit segment continuing as they were, and those behind the hit becoming a second centipede, with the segment just behind the hit becoming a second head. Any solitary segment is a head, which moves at a faster speed than a 2+ segment centipede. When a mushroom is hit, it should change to indicate how many times it has been hit.
Part 6: Add the spider, flea and scorpion
The spider appears once in the first level, and with increasing frequency on later levels. It moves using a random polyline, in the bottom third of the field. On later levels, that will change to the bottom fourth, fifth, etc. It eats any mushrooms it touches, making them disappear. If it hits the bug blaster, the blaster dies.
The flea appears first in the second level, whenever the number of mushrooms in the bug blaster's movement zone (see part 4) falls below 5. It appears at the top of the field, in a random column, but never in the left- or rightmost column. It moves downward quickly, dropping mushrooms behind it in empty cells 25% of the time, but never in the bottom-most row. When hit once, it moves twice as fast. In later levels, the likelihood that a flea will drop a mushroom increases.
The scorpion appears first in the second level and with increasing frequency on later levels. It moves slightly faster on each succeeding level. It moves from the left to the right side (or vice versa), within one row only, in the top half of the field. Any mushroom it moves through is poisoned, changing color. When a centipede hits a poisoned mushroom, it moves at its faster (head-only) speed and straight down, cell by cell, through any mushrooms, until it reaches the bottom row of the field.
Part 7: Add at least three levels
Whenever all the centipede's segments are completely destroyed, a new level appears. The health and number of the mushrooms is unchanged (including poisoned mushrooms), but they do all change color. Any spider, flea or scorpion remains, with only its color changing. In the nth level, the centipede will appear in n parts, including n-1 solitary, fast-moving head segments, and one 12-(n-1) segment connected centipede. For example on level 2, there should be one, fast, solitary head segment, and one slower 11-segment centipede.
Whenever all the centipede's segments are completely destroyed, a new level appears. The health and number of the mushrooms is unchanged (including poisoned mushrooms), but they do all change color. Any spider, flea or scorpion remains, with only its color changing. In the nth level, the centipede will appear in n parts, including n-1 solitary, fast-moving head segments, and one 12-(n-1) segment connected centipede. For example on level 2, there should be one, fast, solitary head segment, and one slower 11-segment centipede.
Part 8: Add scoring and multiple lives
Add scoring, with points awarded when:
Add scoring, with points awarded when:
- 1 mushroom destroyed: the 4th hit is made.
- 5 mushroom regenerated: the bug blaster dies, for each damaged or poisoned mushroom.
- 10 centipede body segment destroyed: the segment is shot.
- 100 centipede head destroyed: the head is shot.
- 200 flea destroyed: the 2nd hit is made.
- 300/600/900 spider destroyed: the spider is shot at far/moderate/near distance.
- 1,000 scorpion: it is shot.
When a bug blaster dies, it can respawn twice at the bottom center (the player starts with three lives). For every 12K points you score, you get an extra life. When it respawns, each damaged mushroom regenerates to full health, one by one, changing back to its original appearance. The centipede(s) do(es) not regenerate, but moves back to the top of the field. Any flea, scorpion or spider disappears.
Part 9: Add animated effects and sounds
Add distinct sounds when the:
Add distinct sounds when the:
- Bug blaster fires
- Centipede moves normally
- Centipede moves quickly
- Spider is present
- Flea drops down the field
- Scorpion moves across the field
- Enemy is hit (centipede, spider, flea or scorpion).
- Bug dies
- Mushroom regenerates
- Extra life is earned
You can use the original sounds, or completely different ones if you prefer.
Add animated effects when
- The centipede walks: legs move left and right
- A mushroom is damaged: it changes color or shape when it is hit first three times; gone on 4th hit
- An enemy is hit: a brief explosion animation
- The spider bounces: legs move around
- The flea drops: legs move up and down
- The scorpion scuttles: legs and tail twitch
- A mushroom is poisoned: it changes color
- The bug blaster dies: a brief explosion animation
Part 10: Make it your own
In the previous parts of this assignment, you strove to make your game work "right". Now you should use the techniques you have learned to make the game "different". To earn full credit, you must change the theme and play of your game, making your game substantially different from the standard game and from your fellow students' games. Simple changes of appearance will not earn full marks, but the gameplay need not change completely. Your "different" game version should appear after you press the exclamation mark (!).
In the previous parts of this assignment, you strove to make your game work "right". Now you should use the techniques you have learned to make the game "different". To earn full credit, you must change the theme and play of your game, making your game substantially different from the standard game and from your fellow students' games. Simple changes of appearance will not earn full marks, but the gameplay need not change completely. Your "different" game version should appear after you press the exclamation mark (!).
EXTRA CREDIT (TEAM REQUIREMENTS):
Extra credit opportunities include the following. For a two-person team, these features are required, not extra credit. Other extra credits are possible, but must be approved by teaching staff in advance to ensure credit:
Extra credit opportunities include the following. For a two-person team, these features are required, not extra credit. Other extra credits are possible, but must be approved by teaching staff in advance to ensure credit:
- ⅓% — add a third-person view, with the camera attached to the back of the bug blaster. Two-person teams should also include a first-person view, with adjustments to make the game stay playable.
- ⅓% — add two power ups, e.g. temporary freeze, brief invulnerability, or area bombs. Two-person teams should also include three more power ups, each with corresponding sounds and visual effects.
- ⅓% — support a second player, either with different keys or the mouse. Two-person teams should support both players on the screen at the same time, with the possibility for players to destroy one another.
- ½% — add better/different physics, e.g. curved shots, or bug blaster movement with acceleration/deceleration. Two-person teams should add gravity to shot trajectories, and acceleration/deceleration to centipede movement as well.
- 1% — 3D gameplay: a field of play with at least two different elevations, and the bug blaster switching between these elevations while shooting and/or moving. Two-person teams should turn the game into tower defense, with the blaster at a fixed elevated location, rotating 360 degrees and shooting downward at different angles.




