Interactive Animations and Games - Lesson 21
Name: Caroline Twomey Period 1st Date Feb. 21, 2024
Project Guide - Side Scroller
Overview
In this project, you’ll use what you have learned to make a side scroller, a type of game with backgrounds that move
across the screen from side to side. There’s a sample side scroller in Code Studio.
Before you jump into programming your scene, you need to plan! Let’s use our handy Problem-Solving Process to help
us! You can refer back to the Problem Solving Process and Programming handout to help you with the steps!
Define
Play the sample game a few times. You can make your game just like this one, or change it to fit your preferences. Fill
out the chart below with what you want to keep the same about each of the requirements listed and what you want to
change about the requirements.
Requirements Example Game Things to Keep the Same Things to Change
At least 3 sprites Frog (player), fly (target), none Snake(player)
mushroom (obstacle) Berry(target)
Ball(obstacle)
Player controls Up key to jump none Used space to jump
instead
Other sprite Target and obstacle both The target and obstacle goes left none
controls loop back to the right side and loops back to the right
Sprite Target disappears and Kept the target interaction the Obstacle is always
interactions loops and points same rotating since its a
increase. Obstacle ball but it does turn
rotation changes and red when you touch
health decreases. it
Variables score and health The same format by how health The location of
goes down 1 tick at a time and score and health
how score goes up by 1 slightly
Background none Different
background
Prepare
What parts of programming this game are you not sure how to do yet?
Jumping sequence properly
Sprites: You need at least 3 sprites. The sample game has the player (frog), the obstacle (mushroom) and the target
(fly). If you plan on using different sprites, fill out the chart below with what you want to use for your player, obstacle,
and target, and where you will find the images.
Sprite Sample Your Choice Image/Animation Source
Player frog Snake A snake image which is used as the
player
Obstacle mushroom Ball A ball image that rolls at you and if you
touch it, it will turn red and you take
damage
Target fly Berry A purple berry image which you collect
for your score
Background: What do you want the background to look like? Draw a picture, and describe the shapes you will use to
make it.
Background Description:
Trees and mountains in the background
with an inserted cloud in the upper
middle of the screen to be used as a
collider.
Player Controls: Fill in the chart below to plan how you are going to use conditionals to control your player sprite’s
movement.
Condition (example: up key) Action (example: move player sprite up the screen)
Up key snake sprite’s y axis will go up
If snake sprite collides with snake sprite’s y will go down
the cloud’s collider
If berry goes -10 x Berry’s x axis will loop back to 400 and be at a random speed between 1-5
Other Sprite Controls: Fill in the chart below to plan how the other sprites are going to move and how you are going
to use conditionals to control your sprites’ movement.
Sprites Movement Condition (example: x < Action (example: reset x to right side of screen)
0)
Obstacle Right to left Ball.x < -10 Loops back to the right side of the screen
2
Target Right to left berry.x < -10 Loops back to the right side of the screen
Sprite Interactions: Fill in the chart below to plan how each of the sprites are going to interact with each other.
Sprite Interactions Result
snake With ball Ball = snake’s health ticks down
With berry Berry = snake’s score goes up by a point
With cloud Cloud = snake’s y axis goes back down to the ground
ball With snake Snake = turns ball red until snake is off of ball
berry With snake Snake = makes the berry set back to 400 x axis and go at a
random speed between 1-5
Variables: Fill in the chart below with the variables you plan to use during the game and display on the screen
Variable Label Description
score Keeps track of how many berries you collect
health Keeps track of your health and how it goes down with each interaction with the
ball sprite
Try
Now go to Code Studio to create your game.
Check your program to make sure it has everything it needs.
Reflect
Answer at least three of the reflection questions below:
1. Compare your program to the defined problem … Were you successful in solving all aspects of the problem?
How do you know?
I was able to get the jumping sequence done properly. I knew when I could run the program and
constantly jump without being still at the bottom.
2. Ask a classmate to try your program … Are there places where they struggle or show confusion?
Not much showed difficulty but at the start its not stated that the jump button is space compared to the
up key.
3. Ask a classmate to read your code … Is your code and documentation clear and accurate?
It is, the code is spaced out evenly and not all lumped together to the point where you can’t read it.
4. Try to "break" your program … Did you find types of interaction or input that you could handle better?
The jumping, it took me a while to make the cycle work and even with it working it seems it could’ve
been better.
5. Are there any changes or improvements you can make to this program or another like it in the future?
3
Maybe having the berries also increases your health or have heart sprites to heal you since you can
die rather quickly. Just have a more detailed game and more code with less errors.