Close
Close full mode
logoMakeCode AP CSP

Local Multiplayer

Summary

Materials

Reference

Instructional Activities and Classroom Assessments

  1. Introduce Multiplayer games (10 minutes)
  2. Activity: Multiplayer (40 minutes)
  3. Reflection/Homework

Learning Objectives

  • AAP-2.E For relationships between two variables, expressions, or values:
  • a. Write expressions using relational operators. 2.B
  • b. Evaluate expressions that use relation operators. 4.B
  • AAP-2.H For selection:
    • a. Write conditional statements. 2.B
    • b. Determine the result of conditional statements. 4.B
  • AAP-3.E For generating random values:
    • a. Write expressions to generate possible values. 2.B
    • b. Evaluate expressions to determine the possible results. 4.B
  • CRD-2.C Identify input(s) to a program. 3.A

Essential Knowledge

  • AAP-2.E.1 A Boolean value is either true or false.

  • AAP-2.E.2 The exam reference sheet provides the following relational operators: =, β‰ , >, <, β‰₯, and ≀. Text and Block:
    Β§ a = b
    Β§ a β‰  b
    Β§ a > b
    Β§ a < b
    Β§ a β‰₯ b
    Β§ a ≀ b
    These are used to test the relationship between two variables, expressions, or values. A comparison using a relational operator evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise, it evaluates to false.

  • AAP-2.H.1 Conditional statements, or β€œif-statements,” affect the sequential flow of control by executing different statements based on the value of a Boolean expression.

  • AAP-2.H.2 The exam reference sheet provides

    • Text: IF(condition) { <block of statements> }
    • Block: IF condition block of statements in which the code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false.
  • AAP-3.E.1 The exam reference sheet provides RANDOM(a, b) Block: RANDOM a, b which generates and returns a random integer from a to b, inclusive. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3.

  • CRD-2.C.2β€―An event is associated with an action and supplies input data to a program.

  • CRD-2.C.3β€―Events can be generated when a key is pressed, a mouse is clicked, a program is started, or any other defined action occurs that affects the flow of execution.

Details

1. Introduce multiplayer (10 minutes)

  • Define multiplayer
  • Explain how multiplayer works
  • Demonstrate setting 2 players

2. Activity: Multiplayer (40 minutes)

  • Direct students to go to their Multiplayer page.
  • Direct students to complete Tasks 2 through 5.
  • If students have time, encourage them to recreate code segments in JavaScript.

3. Reflection/Homework

  • If you run out of time, you may also assign this as individual homework.
  • Students should complete their reflection.
  • How does having multiple players at once in a single game allow for new and compelling games?
  • Were there any difficulties in implementing the multiplayer game? Was it easier or harder than a single player game?
  • How might/did you debug multiplayer code?
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Day 12
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Multiplayer