Scroller Game
Write a Python program using the Arcade module that allows the user to play a game in which they dodge or shoot at scrolling objects. The scrolling objects should be read from a file, stored in a list, and only drawn or collided with when they are actually on the screen.
For example, the popular old scrolling game, Marvin Spectrum, is about a character running through a research laboratory encountering different gates along the way that he must either jump, dive, or slide through depending on their position. While the game is cleverly created such that it appears Marvin is running down a long corridor, the reality is that Marvin is essentially standing still and the lab is moving towards him! This is the challenge of scrolling games, creating a series of obstacles off screen that move towards you in a compelling and challenging way (note this is different than the object just warping or looping around after it passes the character).
This game is based loosely on the following games as well: Flappy Bird (dodging), Doodle Jump (dodging), River Raid (shooting), or Defender (shooting).
Here is a video discussing the basics of the game genre and implementation suggestions.
Getting Started
You can write this game from scratch, by extending one of the games you made earlier in the semester, or by starting with this template.
As a reminder, to use the Arcade module, you will need to include it within your project's Python Interpreter Environment before you will be able to import it:
- Create a
New Project and replace the default code given in the Python file with the basic code below to get started:
"""
Created on Oct 13, 2022
@author: YOUR NAME HERE!!
This module represents my first Arcade game.
"""
import arcade
# Open up a window with a width, height, and title
arcade.open_window(600, 600, "My First Arcade Game")
# Keep the window up until the player closes it
arcade.run()
- You should see an error in the code, red underlining the word
arcade, that PyCharm can fix for you:
- hover your mouse over the word
arcade until a Tooltip appears saying: No Module named 'arcade'
- select the left option given:
Install package arcade
- you should then see a progress bar updating at the bottom of the PyCharm window and then a popup in the bottom right corner saying:
Packages installed successfully
- Now run the program by right clicking on the file
main.py from the Project File List on the left side and selecting: Run 'main'
Specifications
Complete these minimal requirements:
- any number of scrolling objects that are created by reading a file and stored in a list
- an object that is controlled by the player (e.g., using the mouse or keys to move)
- a score that is updated when objects are dodged, hit, landed upon, etc. (with possibly different values for different obstacles)
- a number of lives so that the player gets multiple chances to play the game before it ends
- an end condition for the game, such as clearing all the objects or counting down an amount of time (i.e., when it gets to zero, the game should end)
- stop the game actions and display separate winning and losing messages when the game ends
- reset the game after losing a life or starting a level by making a standard starting situation (i.e., the player is on one side of the screen and the first obstacles is ready to scroll)
- allow the user to restart the game by resetting all the game objects, scores, and options to their starting values
Beyond the basics, you must add at least two features to make your game more fun to play, such as:
- multiple bullets: allow the player to shoot any number of bullets (i.e., stored in a list that is checked against the list of moving objects)
- effects: give different moving objects different effects on the game (i.e., require the player to change to a matching color, respond differently to being hit, act as a power-up, give extra lives or time, etc.)
- levels: so that game pieces reset and some aspect of the game harder (e.g., faster, more obstacles, less distance) after a certain number of points or time
- waves: create moving objects in different patterns (using different files for each wave or level)
- shield: let the player protect themselves from being hit by an obstacle for a limited amount of time (either by pressing a key, hitting a specific object, getting a specific score, etc.)
- reactions: give the player a reaction to being hit by an obstacle (e.g., changing color, an explosion, spinning wildly, etc.)
- background: add an image that scrolls with the obstacles (and repeats when necessary) to improve the appearance that the player is moving
- high score: also show the maximum score ever on the screen (by saving it to a file at the end of each game and reading it in at the start of the game)
Using images or sounds in your game will not impact your grade, but will likely make it look nicer and more fun to play. Arcade makes it easy to add resources in a variety of formats (not just GIF!), and even includes some that do not need to be downloaded. If you choose to download your own sounds and images, they must be royalty free and not "stolen" off of the web, using sites such as:
In the comment at the top of the Python file add:
- Your name
- How long you spent coding it
- Acknowledgments for any online or human resources used
- Acknowledgments for any resource files (images, sounds, etc.) used
- How to play your game (so I know how to play the game and what you intended to do and what is not completely working)
- Discussion of the fixed values you choose to make your game fun to play: distance between and speed of the obstacles, how high (or low or far away) each obstacle is, the time it takes to complete a jump, duck, or shot, etc.