Please enable JavaScript to use CodeHS

Introduction to Game Design with p5play

Description

In this lesson, students begin to reflect on the variety of games they have played and what actually makes a game a game.

Objective

Students will be able to:

  • Identify the variety of games they have played
  • Identify what aspects they like in games
  • Begin to explain what makes a game a game
Description

In this lesson, students explore and learn to identify game elements, mechanics, and components that make up the overall gameplay experience.

Objective

Students will be able to:

  • Identify game components
  • Identify game mechanics and how they impact player interactions
  • Identify game elements and how they define a game
Description

In this lesson, students explore game genres and perspectives that are used to categorize different types of video games.

Objective

Students will be able to:

  • Identify different perspectives in video games
  • Identify different game genres
  • Categorize games based on perspective and/or game genre
Description

In this lesson, students will learn about the aspects of computational thinking that will help them be successful problem solvers.

Objective

Students will be able to:

  • Explain what computational thinking is.
  • Describe problem decomposition and use it to break down larger tasks into smaller ones.
  • Describe what an algorithm is and be able to write one for a process in their life.
Description

In this lesson, students will learn about JavaScript, how to print messages to the console, and about debugging programs.

Objective

Students will be able to:

  • Write a JavaScript program by typing commands with proper syntax in the main function
  • Write a program that prints out a message to the user
Description

In this lesson, students learn how to assign values to variables, manipulate those variable values, and use them in program statements. This is the introductory lesson into how data can be stored in variables.

Objective

Students will be able to:

  • Explain what variables are and what they are used for
  • Create their own variables
  • Print out the values stored in variables
Description

In this lesson, students learn how they can allow users to input information into their programs, and use that input accordingly.

Objective

Students will be able to:

  • Create programs that ask the user for input
  • Store user input in variables and print it back to the user
  • Choose the proper input function to use depending on the type of information needed
Description

In this lesson, students learn about the different mathematical operators they can use to perform mathematical computations and create useful programs that compute information for the user.

Objective

Students will be able to:

  • Describe the different mathematical operators we can use in programs
  • Create programs that use basic math to compute useful things
  • Create programs that take in user input, do simple computations with the input, and produce useful output
Description

In this lesson, students will learn how to create basic functions using JavaScript and use them to improve the organization, readability, and flow of their programs.

Objective

Students will be able to:

  • Define JavaScript functions
  • Call JavaScript functions within the main function
  • Use functions in order to manage the flow of their programs
  • Increase the readability and organization of their code using functions
Description

In this lesson, students learn about the p5play library and see examples of what can be created with it.

Objective

Students will be able to:

  • Describe what a JavaScript library is
  • Provide an overview of what features the p5play library offers
  • Describe their experience running p5play programs / games
Description

In this lesson, students will learn about the two main functions in a p5play program, setup() and draw().

Objective

Students will be able to:

  • Describe the role that the setup() function plays in a p5play program
  • Describe the role that the draw() function plays in a p5play program
  • Code the standard structure of p5play program
Description

In this lesson, students will learn more about the p5play canvas, including how to set one up and navigate its X-Y coordinate system.

Objective

Students will be able to:

  • Explain what the p5play canvas is
  • Set up a canvas in their code with specified dimensions
  • Understand how the X-Y coordinate system works
Description

In this lesson, students will learn about p5play sprites and how to control their appearance with properties like size, position, and color.

Objective

Students will be able to:

  • Define a p5play sprite
  • Describe some of the properties of p5play sprites and how they are used
  • Create a p5play sprite in their code
  • Use dot notation to set the values of a sprite’s properties
Description

In this lesson, students will learn about more sprite properties and how they relate to p5play’s built-in physics engine.

Objective

Students will be able to:

  • Describe what a physics engine is and how it impacts program development
  • Turn on gravity in their programs
  • Identify and use the different sprite colliders
  • Identify and use additional sprite properties that change the sprite’s behavior in the scene
Description

In this lesson, students will kick off their mini golf project and learn more about the project design process.

Objective

Students will be able to:

  • Talk about the different stages of the project design process
  • Understand what the mini golf project entails
  • Decompose the larger, complex project into smaller parts
  • Set up the project’s structure and canvas
Description

In this lesson, students will add p5play sprites for their grass, hole, walls, ball, and putter. They also learn how to use a random number function in order to randomize where the hole sprite is placed.

Objective

Students will be able to:

  • Create sprites and set properties
  • Use the random() function to generate random numbers for their game
  • Use comments to document their code
Description

In this lesson, students will learn more about boolean values and p5play boolean expressions.

Objective

Students will be able to:

  • Write and understand Boolean questions
  • Understand how p5play uses expressions that evaluate to a Boolean true/false value
Description

In this lesson, students learn about if/else statements as a way to make decisions and execute specific code depending on the validity of a condition.

Objective

Students will be able to:

  • Explain the purpose of if/else statements
  • Understand how to use p5play Booleans as a condition in the if statement
  • Create their own if/else statements to choose which code is executed in their programs
Description

In this lesson, students will apply their new knowledge of Booleans and if/else statements to create interactions between the player and the sprites.

Objective

Students will be able to:

  • Use pseudocode to help plan out if/else blocks
  • Integrate p5play Boolean expressions with an if/else block to create branching interactions
  • Use p5play methods like moveTowards(), rotate(), and remove()
  • Use a greater than operator to check the speed of the ball
Description

In this lesson, students will enhance the player experience by adding background music and a score counter to their mini golf games.

Objective

Students will be able to:

  • Add sounds to their p5play programs
  • Add text to their sprites
  • Apply their knowledge of sprites and if statements to create a score counter
Description

In this final project lesson, students will design, plan, develop, and test a second custom mini golf hole for their game.

Objective

Students will be able to:

  • Plan, design, develop, and test their own program
Description

In this lesson, students will kick off their projectiles project and create the basic structure of their game.

Objective

Students will be able to:

  • Understand what the projectiles project entails
  • Decompose the larger, complex project into smaller parts
  • Set up the project’s structure, canvas, and the scene’s ground sprite
Description

In this lesson, students are going to create a cannon that players can move and rotate on the canvas.

Objective

Students will be able to:

  • Use an image as the appearance of a sprite
  • Use the scale property to adjust the size of the image
  • Allow the player move and rotate the cannon with key presses
Description

In this lesson, students will learn about p5play Groups and Tiles, two features that make it easy to create and manage many sprites in a p5play program.

Objective

Students will be able to:

  • Define p5play Groups
  • Explain the benefits of using a Group
  • Create a Group and a sprite in that group
  • Explain the benefits of p5play Tiles
  • Create and customize a Tile system
Description

In this lesson, students will apply their knowledge of p5play Groups to create cannonballs that fire from the cannon.

Objective

Students will be able to:

  • Create a group of cannonballs
  • Allow the user to fire a cannonball with a key press
Description

In this lesson, students apply their knowledge of the p5play Groups and Tile system to create the tower in their projectiles game.

Objective

Students will be able to:

  • Create two block groups with different physical properties
  • Modify the tile system to add blocks to their tower
Description

In this lesson, students will implement code that will remove the wood block tiles when struck by an incoming cannonball.

Objective

Students will be able to:

  • Use a prototype to test an algorithm
  • Implement a nested if statement
  • Understand the basics of for loops
  • Remove sprites from the canvas
  • Use a comparison operator to check the size of a sprite’s speed
Description

In this lesson, students will add a win condition and message to their game.

Objective

Students will be able to:

  • Create a win condition for their game
  • Add a UI element that conveys a message to the user
Description

In this final project lesson, students will design, plan, develop, and test a second custom level for their projectiles game.

Objective

Students will be able to:

  • Plan, design, develop, and test their own program