Introduction
Create an interactive game inspired by "Shark Lady." Students will design a marine environment game where a character moves using buttons, and sharks move randomly across the screen. They will code animations, use number variables for random positions, and implement collision detection for a game-over condition.
Objectives
Students will:
- Understand basic movement, the pixel coordinate system, and pixel usage in coding.
- Design a game reflecting the marine environment inspired by "Shark Lady."
- Code animations and use number variables for random positions.
- Implement collision detection for a game-over condition.
Code Stories and Games with Elementari
Students will use Elementari to create and code their interactive game. Elementari’s platform makes coding accessible and enjoyable, integrating arts and literacy. Students will design their game, program movement and collision events, and use number variables to enhance their coding skills.
New to Elementari? Click on the orange Start button to jump right into the lesson for free. Check out our Getting Started Guide for an overview of how Elementari works with your class. Get started for free for up to 35 student accounts.
Lesson Resources
Coding Concepts Covered
Duration Loop Relative Position User Navigation Collision Number VariableStudent Instructions
View the example Shark Lady Game project.
Use the Coding Blocks Handout (PDF or google doc) to see what coding blocks are needed to code your game.
Create your game start menu with a button to start the game. Follow the instructions to a template!
Add your main character and control buttons to the game.
Code your character to move up ⬆️ when the player clicks the up button.
Code your character to move down ⬇️ when the player clicks the up button.
Add a shark and code it to move right to left across the page.
Code a loop so the shark swims continuously across the page. Use the following functions in loop:
- Moves across the page from right to left.
- Sets the position of the shark back on the right.
Make the shark's Y position random.
Make a game over page for when the character hits a shark.
Program the game to show the Game Over page if the character hits a shark.
Make sure the game works and fix any problems. Add the final touches to your game.
Then test each other’s games and give feedback before publishing!
Project Example for Students
Play through this lesson's example project created on Elementari. Use this example to guide and motivate your students.
Standards
CSTA K-12 Computer Science Standards (2017)
Algorithms & Programming
1B-AP-09 - Create programs that use variables to store and modify data.
1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.
1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
1B-AP-12 - Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.
1B-AP-15 - Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
2-AP-10 - Use flowcharts and/or pseudocode to address complex problems as algorithms.
2-AP-11 - Create clearly named variables that represent different data types and perform operations on their values.
2-AP-13 - Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
2-AP-17 - Systematically test and refine programs using a range of test cases.
ISTE Student Standards
Creative Communicator
6b - Students create original works or responsibly repurpose or remix digital resources into new creations.
6d - Students publish or present content that customizes the message and medium for their intended audiences.
6c - Students communicate complex ideas clearly and effectively by creating or using a variety of digital objects such as visualizations, models or simulations.
Computational Thinker
5a - Students formulate problem definitions suited for technology-assisted methods such as data analysis, abstract models and algorithmic thinking in exploring and finding solutions.
Innovative Designer
4a - Students know and use a deliberate design process for generating ideas, testing theories, creating innovative artifacts or solving authentic problems.
4d - Students exhibit a tolerance for ambiguity, perseverance and the capacity to work with open-ended problems.
4c - Students develop, test and refine prototypes as part of a cyclical design process.
4b - Students select and use digital tools to plan and manage a design process that considers design constraints and calculated risks.
AASL Standards
Inquire
I.A.2 - Recalling prior and background knowledge as context for new meaning
I.B.3 - Generating products that illustrate learning.
I.C.4 - Sharing products with an authentic audience.