UevKF8zjRV_WEtpJsXhr
We use cookies on this site to enhance your user experience

Session Lesson Plan

4 - Adventure Game Pt. 2

Developed by Roblox
Students continue developing the adventure game. They'll create scripts for using tools, selling items, and upgrading their spaces.
10 and up Computer Science Game Design
English 1 hour
ISTE Standards: N/A

Learning Objectives:

  • Apply knowledge of if/then statements to create collectible items.
  • Demonstrate knowledge of functions to create functions that allow players to sell items and upgrade their spaces variable.

Player running around with tool in world

Skills and Concepts:

N/A


Getting Ready

Preparation:

  • Print out handouts
  • Download the starter tool and load it on every student’s desktop.

Lesson Overview

5 min

Introduction

Introduce the project and lesson structure.

50 min

Guided Tutorial
Scripting Game Mechanics

Have students create scripts for tools, selling items, and upgrading spaces.

5 min

Wrap Up

Recap the lesson and concepts learned.


Lesson Plan

Introduction
5 min
  1. Explain that students will be adding the core gameplay mechanics of the adventure game today: using a tool to collect items, selling items, and upgrading their spaces to collect more items.
  2. Point out that the next session will be light on tutorials. Students can use that session to catch up on previous work or add new things to their game.
Guided Tutorial - Scripting Game Mechanics
50 min
  1. Lead students through the following tutorials:
    1. Creating Tools
      • Students will use the pre-loaded tool.
    2. Selling Items
    3. Upgrades
      • Remember that click detectors on the upgrade cannot be clicked if a player has a tool active. Press 1; to show/hide a tool.
Wrap Up
5 min
  1. Recap what students have created.
  2. [Optional] Ask students what feature they’re excited to work on or add tomorrow as they finish their games.

Appendix

Troubleshooting Tips

General Troubleshooting

  • While students code, leave up example scripts for students to reference. The Tool script is especially helpful as it has nested if statements.
  • Check that students are indenting their code to look like the code samples. This makes code more readable and reduces the possibility of errors.

Scripting Game Mechanics

  • Remind students to always add a comma between multiple parameters in a function, like in sellItems(playerItems, playerGold).
  • In the Upgrade script, the order of functions matters. Make sure that the function giveUpgrade() is above clickDetector.MouseClick.
Classroom Management

Facilitation Tips

  • To keep students on track, set a strict time limit for playtesting, like one minute.
  • Encourage students to remember a specific goal whenever playtesting, such as check if a tool harvests an item as intended. This helps them stay focused.
Customizing the Lesson

Expand the Lesson

  • More than one item can be added to harvest, just remember that each item needs a BoolValue with CanHarvest set to true.
  • Tool appearances can be customized. For more information, see Intro to Player Tools.
    • For a simpler alternative, students can just customize the colors of each part of the starter tool.
  • Surface GUI's, like the Upgrade Sign, can be customized. Encourage students to explore properties of TextLabels, like color and fonts. For more information, see Intro to GUIs and Surface GUI's.
Misc. Resource

Final Project Example - An example of the final project with all included scripts.


Previous Harvestable Items Next Creating Tools