CS315 Game Programming: Exercises

Schedule

Exercise Deadline
Exercise 0: An Unskippable Tutorial Tuesday, September 1
Exercise 1, Increment 1: 2D Physics-Based Gameplay Tuesday, September 8
Exercise 1, Increment 2: Game Logic and Assets Tuesday, September 15
Exercise 1, Increment 3: Titles and Animation Tuesday, September 22
Exercise 2, Increment 1: 2D Platforming Basics Tuesday, September 29
Exercise 2, Increment 2: Juice and Polish Tuesday, October 6

General Instructions

Submission and Deadlines

All repositories must be in our course organization on GitHub. The default deadline for all work is the start of class on the indicated date. Projects must be completed by the deadline in order to be eligible for course credit.

Completing a project means that it follows the naming convention, has a GitHub release before the relevant deadline, and follows the semantic versioning requirements described in the style guide. There is no separate submission process to this.

Evaluation Criteria and Save Points

Each exercise specifies the criteria on which it will be evaluated. To earn a particular grade in an exercise, one must meet that grade’s criteria as well as all previous criteria. For example, to earn a B, one has to complete the criteria for levels B, C, and D.

I will give feedback via GitHub Issues. If you have no submission, there can be no feedback.

Each student is given two Save Points to use during the semester on individual work. If you miss the original deadline for a project, you may spend a Save Point to turn it in up to 48 hours after the original deadline. Alternatively, if my feedback indicates an error in your self-assessment—that is, something you thought you had correct was actually incorrect—you may spend a Save Point to address the deficiency within 48 hours of the original feedback.

To use a Save Point, release the new version as a bugfix, incrementing the patch number and explaining the change in the release notes, then email your request to the instructor. Include a link to the repository in the email.

Self-Evaluation and the README.md file

Your project’s README.md file must include a self-evaluation under its own heading. The self-evaluation documents which evaluation criteria you have satisfied and states what grade you have earned.

Document in the README.md file any gameplay instructions that are not otherwise explained to the player.

Exercise 0: An Unskippable Tutorial

Objectives

This project will introduce you to Godot Engine as well as the norms of the class.

1. Preliminaries

Complete the account registration form that is linked from Canvas. This will get you access to the class’ private GitHub organization, which is required to complete later steps of this project.

Install Microsoft Visual Studio Code (VSCode). We will be using VSCode as a robust Markdown editor. If you already know Markdown and have a preferred editor for it, use that. If not, use VSCode.

Make sure you can run git from the command line. Windows users will use Git Bash, which is part of the git installation for Windows.

Set up your identity following the setup instructions.

Configure git to use VSCode as your editor.

2. Tutorial

Work through the “Your first 2D game tutorial” using GDScript.

3. Version Control

You should have previous experience with distributed version control from the prerequisite courses. This semester’s work builds upon that experience with more professional techniques.

Set up a git repository for your project. For example, you can use the command line to navigate to your project folder and then issue the command git init.

When you make a new project, Godot Engine will create appropriate .gitignore and .gitattributes files that tell git what files to ignore and how to deal with different kinds of files, respectively. Take a look at the .gitignore file, opening it in a plain text editor such as VSCode. You should see that .gitignore is ignoring a folder called .godot, and that this folder contains all manner of gobbledygook. Godot Engine uses that folder to hold its generated content—the files it needs to edit and build your project. Since it is generated content, it should not be tracked in version control. Three cheers for Godot Engine’s helpful default git configuration files!

If you are using macOS, you need to edit your .gitignore to ignores the .DS_Store files created by your operating system. Once you are done, your .gitignore will look like this:

# Godot 4+ specific ignores
.godot/

# macOS ignores
.DS_Store

Use git status at any time to see what is currently being tracked by git. You will see me use this comment a lot to make sure my mental model matches the computer’s state.

From the project directory, you can add all the non-ignored files with the following command. That is, this tells git to stage these files for commit.

git add -A

This would be a good time to do git status and compare the previous results to these.

You should now be ready to commit. Tell git to commit all of the staged flags (the -a flag) and also that you will give the commit message on the command line (the -m flag, which is combined with the previous into the string -am). Notice that this commit message follows the style guide.

git commit -am "Complete the tutorial"

Once again, git status is informative here. This is also a good time to try git log. If you want to get fancy, try this expanded version of the command:

git log --abbrev --decorate --online --graph

With your local repository ready, it’s time to make a remote one. Create a repository in our course organization on GitHub, naming it E0-myname, where myname is your BSU username or your surname. This naming scheme identifies the repository as being yours and corresponding to Exercise 0. Make sure it is an empty, private repository.

When you create the repository, follow the instructions GitHub shows to set your remote origin and push your changes to GitHub. One of the steps renames the default branch from master to main, and this step is optional.

Reload your page on GitHub, and you should now see that your remote repository is an exact copy of your local one.

Confirm that you have handled these steps properly by cloning your remote repository to a new location on your workstation. Do this by clicking the “Code” button on GitHub to get the HTTPS URL to your repository. It should look something like https://github.com/bsu-cs315/E0-myname. From your terminal, go to any convenient location in your filesystem and clone the repository using the git clone command, like this:

git clone https://github.com/bsu-cs315/E0-myname

This will make an exact copy of what is on GitHub. You can open this project using Godot Engine and verify that everything is working properly.

4. The README.md File

Use VSCode to create a README.md file at the root of your project.

The README.md file is in Markdown, which is a plain text format. VSCode has built-in support for Markdown editing. A useful feature is that you can bring up an HTML render preview using Ctrl-K, V (that is, hit Control and k together, release both, then tap v). This can help you ensure that your Markdown is well-formed.

Here are the most important Markdown features you need to know to get started.

One of the most important parts of the README.md file is your self-evaluation. The evaluation criteria for this exercise are simple:

A, C, and D grades correspond to 3, 2, and 1 points following the standards of triage grading.

When you’re done, keeping in mind the self-evaluation requirements, your README.md file will look something like this:

# Project 0: An Unskippable Tutorial
A tutorial implementation by (Your Name Here).

This project follows the
[Your First Game tutorial from
godotengine.org](https://docs.godotengine.org/en/stable/getting_started/first_2d_game/index.html).

## Self-Evaluation

I have completed the exercise and have therefore earned an A.

## Third-Party Assets

- "art/House In a Forest Loop.ogg" Copyright © 2012
[HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0:
Attribution](http://creativecommons.org/licenses/by/3.0/). Source:
https://opengameart.org/content/loop-house-in-a-forest

- Images are from "Abstract Platformer". Created in 2016 by kenney.nl,
[CC0 1.0 Universal](http://creativecommons.org/publicdomain/zero/1.0/). Source:
https://www.kenney.nl/assets/abstract-platformer

- Font is "Xolonium". Copyright © 2011-2016 Severin Meyer
<sev.ch@web.de>, with Reserved Font Name Xolonium, SIL open font license
version 1.1. Details are in `fonts/LICENSE.txt`.

Once you have created the README.md file, remember to use git status to see that it is not yet tracked by git. Follow the steps above to add this file to git, commit your changes, and push the latest changes to GitHub. Make sure you follow the style guide requirements for your commit message as we did above.

5. Release

Once you are confident that your work is complete, use GitHub’s web interface to create a GitHub release in accordance with the style guide. This marks your work as complete and ready for instructor evaluation.

Exercise 1, Increment 1: 2D Physics-Based Gameplay

Overview

This is the first of a multi-part project in which you will build a 2D physics-based action game along the lines of Angry Birds. This first part focuses on core physics-based gameplay. Future parts will build upon this to improve the player experience.

You have creative freedom to choose a theme for your game. In my sample solution, I have been inspired by Kenney’s Physics Assets pack.

User stories review

User stories are a common method of articulating functional requirements, particularly on teams that employ agile approaches. We will write our user stories following Mike Cohn’s approach. Each story is expressed as a statement of user desire followed by the conditions of satisfaction that explain how to confirm that the desire is satisfied.

User stories

As a player, I want to fire a projectile so that I can watch it fly.
  • When I give the right input, the projectile is launched across the screen at a 45° angle.
  • The projectile behaves like a real-world object affected by gravity, following a parabolic path.
  • The projectile is fired from the ground, and I can see it arc across the screen and hit the ground.
As a player, I want to control the angle at which the projectile fires.
  • Before firing, I can adjust the firing angle up or down.
  • Angles are clamped to the range 0° (straight forward) and 180° (straight up).
As a player, I want to adjust the power of the projectile.
  • Before firing, I can adjust how hard the projectile will be shot.
  • The power is clamped to a range that makes sense for the screen size.
As a player, I want to hit a target with the projectile so that I can confirm my skills.
  • There is a target that can be hit or missed depending on how I play.
  • Like the projectile, the target is also a physics object, and it reacts appropriately to being hit (for example, it topples over).

Evaluation

Name your repository E1-myname where myname is your BSU username or your surname. You will use the same repository for all three iterations of the project; use the release name and number to mark your submission for each iteration.

Stories CompleteGrade
4A
3B
2C
1D

From this exercise until the end of the semester, you must follow our style guide to earn a C or better grade. Be sure to review that page regularly, ask about anything that is unclear, and use peer review to help catch errors.

Suggestions

Angry Birds uses a cleverly-designed touch interaction to launch birds from a slingshot. It is sufficient for us—and a lot simpler—to use keyboard controls. If you were pursuing this as a final project, you might aim a bit higher, but keyboard input is perfectly appropriate for now.

For this first iteration, you do not need any images at all: you could just have every visual node draw itself by overriding the _draw function. That said, it can be easier to bring in images as you did in the previous project. Either approach is fine for the first iteration.

The projectile should be a RigidBody2D since it will be controlled by the physics system. It will have a child which is a CollisionShape2D. If you are using sprite images, then it will also have a child which is a Sprite2D.

Use apply_impulse to give a one-time boost of force (“impulse”) to the projectile.

An easy way to make the ground is with a StaticBody2D. An alternative is to use a TileMap, although this requires many more steps. If you go this way, make sure you have collision boxes set up correctly.

In order to get notification of a physics collision, you need to set the contact_monitor property and non-zero contacts_reported property of a RigidBody2D, as explained in the Godot Engine physics introduction. Only then will the body_entered signal be emitted.

I recommend that you try to get as far as you can using the official documentation and your experience from the previous exercise. This will help you think about the extents of your current understanding. I have a video from Fall 2020 that shows the first few steps of the project, but again, I would treat that as a safety net rather than a tutorial. (Also, the video uses an older version of Godot Engine.) Keep in mind that there are always more than one way to approach game programming problems.

Exercise 1, Increment 2: Game Logic and Assets

Overview

Now that you have the core gameplay in place, it’s time to add some features to make it more playable. You will limit the number of projectiles that the player can fire, and you will incorporate appropriate graphics and sound effects.

User stories

As a casual player, I want to fire a projectile at a target so that I can win the game.
  • I can adjust the angle and power of a projectile and then fire it.
  • The projectile behaves like a real-world physical object, flying in a parabolic arc.
  • The projectile is shown with an image that captures the game's theme.
  • Firing the projectile plays a sound effect.
  • It is possible to hit or miss the target based on how I fire the projectile.
As a competitive player, I want a limited number of tries to hit the target.
  • I have a small number of projectiles that I can fire.
  • I can fire only one projectile at a time.
  • The game ends when I am out of projectiles.
  • A HUD shows how many projectiles I have left.
As a new player, I want to know how to play the game.
  • The main game screen shows what inputs are required to play.
As a new player, I want to understand the game through the level design.
  • Use images for the ground, background, and target.

Evaluation

Stories completedGrade
4A
3C
2D

Sound

Never underestimate the power of good audio to improve the player experience. At a minimum, we want to have some kind of sound when the player launches the projectile. You can make your own sound effects, and there are plenty of places on the Web where you can find public domain and attribution-licensed assets. Personally, I am fond of freesound, which makes it easy to filter by license. For homemade sounds, I like the old-school sounds generated through the sfxr plugin in to LMMS. There’s an online sfxr port called jsfxr. Chiptone is more modern, but I have not used it myself.

The AudioStreamPlayer node provides an easy way to play sound effects. You can specify the audio asset to play in the Inspector and then call play when you want it to play. Sound effects should be .wav files. If you want to incorporate music, those audio files should be Ogg Vorbis files (.ogg), and you will probably want to set them to looping in the import settings. (This happened by default in older version of Godot Engine.)

Limited ammunition

One of the goals for this iteration is to ensure the player is only launching one projectile at a time. A problem you may run into here is determining when a projectile stops rolling after hitting the ground. Depending on your implementation, one approach is to listen for the RigidBody’s sleeping_state_changed signal. A physics body “sleeps” when no forces are acting on it. This saves the engine the trouble of processing that object each frame. You listen for the sleeping_state_changed signal to determine when a physics body has gone to sleep and use this in your game logic.

What happens if your projectile falls off the end of your world? If it falls forever, it will never change its sleeping state. A common solution to this problem is to set a “kill” line: if any object falls below that line, it is destroyed. This can be done by checking the Y coordinate of the projectile in the _physics_process method. Another approach is to add something like an Area2D to the level that can watch for overlapping projectiles and handle them appropriately, but this can be error-prone if a projectile overshoots your area.

To successfully complete this iteration, you need to be able to spawn multiple projectiles, one at a time, in succession. Defining the projectile in its own scene is an important step here. Remember: a Godot Engine scene is like a class in object-oriented languages. Once you have a scene (class) defined, you can make as many instances (objects) as you need. Of course, if you create projectiles programmatically, you will also need to connect their signals programmatically; you can read more about this in the signals documentation.

You might consider a flow of logic like the following.

  1. Specify a spawn point as a Marker2D. At the start of the game, the main level’s script instantiates projectile.tscn and places it at the spawn point.

  2. When the projectile is fired, the main level script listens for its sleeping_state_changed signal or for tree_exited if it is killed by passing the kill line.

  3. When either signal is received, as long as there are projectiles remaining in the inventory, instantiate a new one at the spawn point and decrement the inventory.

Keep in mind that there are two ways to listen for signals. One is to use the Node dock within the editor, and the other is via scripting. Read more about this in the signals documentation.

HUD

The Heads-Up Display (HUD) is a trope of video game design through which the internal state of the game is exposed to the player. You have already done some work with Godot’s UI system in the first exercise. I encourage you to read about sizes and anchors and containers so that you understand the fundamentals of Godot’s UI system.

For this project, your HUD does not have to be fancy: simple, static labels are sufficient. The main idea for now is to move anything that the player needs to know away from print statements and into the HUD. Your HUD should show how many projectiles the player has remaining. You might also use it to show a score, firing angle, or firing power.

Exercise 1, Increment 3: Titles and Animation

Overview

In this final iteration, you will pull all the pieces together to make something that feels like a finished game. We are also going to step up the quality of our implementations to match the richness of our understanding.

User stories

As a traditionalist, I want to start on a main menu screen.
  • I can start the game from the main menu screen.
  • When a game session is over, I return to the main menu screen.
As an achiever, I want to win the game.
  • Incorporate clear and achievable winning and losing conditions.
  • Show me if I have won or lost.
  • Allow me to play again after winning or losing.
As a new player, I want to be impressed by the title screen.
  • The title screen catches my attention with animated elements that are created in-engine with AnimationPlayer or tweening.

Evaluation

Stories completedGrade
3A
2B
1C

The evaluation covers only the stories for this iteration. It is more important to gain practice with this iteration’s goals than to revisit last week’s.

Advice

Notice that the title screen is the first thing the player sees, but it is among the last things we have implemented. It is a common novice mistake to try to create games in the order the player experiences them. Instead, we prioritize that which has the most value to the player.

Your title screen is best kept in a separate scene from the rest of the game. One easy way to move forward is to create a new scene with the logo as a Sprite2D. Give a prompt to the user about what button to press to start the game, write a script that listens for that, and then replace the title scene with the game scene.

There are two common ways to create animations within Godot Engine: using the AnimationPlayer node or by tweening. If your animation depends on the dynamic state of the game, then the latter is the best approach.

Exercise 2, Increment 1: 2D Platforming Basics

Overview

This project will introduce you to kinematic motion in Godot Engine by building a simple 2D platforming game. Whereas Exercise 1 used the physics engine to determine the position of game elements, the kinematic approach means that you will directly, programmatically control each element.

Name your repository E2-myname where myname is your BSU username or your surname. You will use the same repository for both iterations of the project; use the release name and number to mark your submission for each iteration.

User stories

As a new player, I want to navigate the game world.
  • The player can move left and right to explore a 2D platforming world.
As a player, I want a core loop.
  • There is a clear way to start playing.
  • There is some kind of goal-directed gameplay—something for the player to do or accomplish.
  • The game ends in a predictable, genre-standard manner. It is clearly communicated to the player that the game is over.
  • The game is entirely playable with the keyboard and mouse.
As a fan, I want to play again.
  • There is a clear and easy way to play again without having to relaunch the application.
As an explorer, I want to do something besides run and jump.
  • There is custom gameplay beyond what is available in the CharacterBody2D template (namely, running and jumping).
  • This gameplay is documented in the README.md file.

Evaluation

Stories CompleteGrade
4A
3B
2C
1D

Platforming

2D Platforming games are a staple of the industry, and recent years have seen them as a darling of the pixel art indie scene. You have a lot of creative freedom in determining what you want to build for this project. Follow your inspiration and keep track of the goals. Be sure to keep your scope under control, though: this is a short exercise, so aim for something modest that demonstrates understanding rather than something overly ambitious that will lead you into dead ends or require inordinate effort. There will be room to expand on these creative ideas in the final project.

You can find many tutorials and samples to help you in a pinch. A general word of caution is in order: a lot of tutorials are essentially cut-and-paste exercises. These can be a rewarding for novice developers, but don’t mistake cut-and-paste programming for the kind of understanding that we expect from an upper-level Computer Science elective. As always, you are responsible for understanding and being able to explain every line of code in your system. You are going to learn much more through struggle than you will by typing someone else’s ideas.

If you possess a niggling doubt about your understanding, try one of the following:

Either of those options would demonstrate satisfactory understanding. After all, it is demonstration of understanding that is fundamentally the point of these exercises. Satisfying a user story doesn’t just mean “it works” but rather that you understand how the thing is done. If your code looks too much like tutorial or example code, and you don’t take the steps to show that you understand it, then you cannot in good faith claim to have met the goal, even if the “feature” is in the game. To do so would be a violation of the Academic Integrity Policy.

A Sample Path Forward

If you are not sure where to start, here is a sequence you might consider.

  1. Read the documentation about CharacterBody2D so that you can understand the context in which we will be working.
  2. Download Kenney’s Abstract Platformer pack and import the PNG tilesheet into your assets folder. Use this to make a TileMapLayer in your level, and draw a simple floor for your character to stand on. Remember to add a physics layer so you can paint collision rectangles on your tiles, and of course, list the asset pack as a third-party asset in your README file.
  3. Create a PlayerCharacter scene that is a CharacterBody2D. Give it an AnimatedSprite child with idle and walking animations using one of the characters from Kenney’s Platformer Pack Redux. Set up a CollisionShape2D around the sprite and instance the PlayerCharacter into your test level. The template code will give you character that is affected by gravity and that can move left or right in a conventional manner.
  4. Create your own input mappings for character movement to replace the UI-related template ones. Even if you use the same input methods, it will be better to have clearly named, single-purpose input mappings for character controls. Feel free to add gamepad support, but make sure keyboard input is an option.
  5. Set up the character so that it is facing the direction of its movement. Note that you can flip an animation by scaling it by -1 in the y axis; this is an easy way to turn a right-facing walk cycle into a left-facing one.

Exercise 2, Increment 2: Juice and Polish

Overview

In this iteration, you will finish up the demo you built in the previous iteration, making it into a fully-playable—though small—game.

User stories

As a platforming game enthusiast, I want a juicy gameplay experience.
  • Include at least one example of “juice” besides sound effects.
  • Explain what you added and why in the self-evaluation.
As a game enthusiast, I want game content that reinforces the theme of the game.
  • The game includes thematic visual assets, sound effects, music, and fonts.
  • There are no un-themed game objects such as placeholder images or the default engine font.
As an achiever, I want the HUD to tell me how I am doing.
  • There is a HUD that provides real-time information to the player about the state of the game.

Evaluation

Stories CompleteGrade
3A
2C
1D

Gameplay

Draw from what you learned in the first exercise to complete the player experience loop: some kind of title or introduction; active, goal-directed gameplay; and some kind of ending. You have creative control over the gameplay. Choose a common, genre-appropriate condition for ending the game, such as gathering all the collectibles or running out of time. Keep in mind the level design constraints described in the previous iteration: don’t make the game too long or too abstruse for our goals.

When incorporating assets, make sure you follow all the steps documented in the style guide, and make sure you are following the requirements of the licenses you use. You do not have to concern yourself with distributing copies of the licenses when required (as required by common Open Source licenses such as the MIT License, for example) since we are not deploying these games.

Juice

What’s the difference between a great game and a mediocre one? One of the terms used in the industry is “juice.” Perhaps the most referenced source on the topic is Juice It or Lose It. An captioned version of the video is also available. If you have already seen that one, check out Juicing Your Camera with Math or Fast and Funky 1D Transformations. Watch one or more of these videos and incorporate some juice into your game. Be sure to document, in your project report, the source for your ideas and how you implemented them.


CS315 Course Plans (Fall 2026) © 2026 by Paul Gestwicki is licensed under CC BY-SA 4.0