UevKF8zjRV_WEtpJsXhr

Project: Story Games

Code Your Own Story Game

Developed by Roblox
Start your coding journey with Roblox while joining millions participating in the world-wide Hour of Code™ initiative.
10 and up Computer Science
English 1 hour
ISTE Standards: Innovative Designer 4a, 4c, 4d, Creative Communicator 6b, 6d

Learning Objectives:

  • Create variables for storing player input using Lua code in Roblox Studio
  • Combine player input with a pre-written story
  • Test and troubleshoot the resulting code

Skills and Concepts:

  • Variable - A placeholder for information in code.
  • String - A variable that can store whole sentences, written in quotations.
  • Concatenation - Combining two strings into one using ..

Getting Ready

Preparation:

Materials:

Lesson Overview

10 min

Introduction

Introduce the project and Hour of Code™ initiative.

5 min

Guided Work
Create Stories

Have students write their stories and create placeholders.

25 min

Guided Tutorial
Story Games

Lead students through a tutorial to build a story game

15 min

Independent Work
Finish Student Projects

Let students catch up or continue building stories.

5 min

Wrap Up

Recap the lesson and have student shares stories


Lesson Plan

Introduction
10 min
  1. Play this video about Hour of Code™, a nationwide initiative that introduces millions of students to one hour of computer programming.
  2. Tell students they will be building a game using Roblox Studio, the tool used to create all Roblox games. Students will write a story and then use player answers to replace words and names. For example: One day [name] woke up and ate a giant [player's favorite food].
  3. Play the project overview video to show students the game they will create and build excitement.
Guided Work - Create Stories
5 min
  1. [Optional] Provide students paper and pencil to write their stories.
  2. Lead students through the lessons Writing the Story and Creating Placeholders.
    • Have students do this activity away from computers to reduce distractions.
    • Brainstorming Tip: Have students generate ideas by having one suggest a character (wizard, chef, etc), and another suggesting what that character does.
Guided Tutorial - Story Games
25 min
  1. Continue by leading students through Lesson 1 - Opening the Template.
  2. Lead students through Lesson 2 - Asking Questions.
  3. Lead students through Lesson 3 - Write the Story.
    • In "Adding to the Story", some students may have a variable in the middle of a sentence. Show both how to concatenate a variable at the end and one in the middle of a sentence, such as "In a " .. place1 .. " lives the wizard."
    • Encourage students to check that each concatenation has two dots (..)and that their capitalization matches the example script, especially for words like storyMaker.
Independent Work - Finish Student Projects
15 min
  1. Show students Lesson 3 - Finishing the Story - Tips and Tricks.
  2. Have students catch up on their projects. If finished, add the following challenges, have them add two or more characters (each using a different variable: name2, name3).
Wrap Up
5 min
  1. Recap what students have created and vocabulary: variable, string, concatenation.
  2. Encourage 2 or 3 students to verbally share the story they wrote as a class.
    • For example, one student reads out the story and then calls on another student to provide an answer.

The Hour of Code™ is a nationwide initiative by Computer Science Education Week and Code.org to introduce millions of students to one hour of computer science and computer programming. These documents are licensed by Roblox Corporation under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Roblox, Powering Imagination, and Robux are trademarks of Roblox Corporation, registered in the United States and other countries.