Code Your Own Story Game
Start your coding journey with Roblox while joining millions participating in the world-wide Hour of Code™ initiative.
Course Overview
Learning Objectives:
- Create variables for storing player input using Lua code in Roblox Studio.
- Combine player input with a student created story.
- Test and troubleshoot the resulting code.
Terms 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
..
- Windows or Mac computer with Roblox Studio installed
- Handout: Roblox Cheatsheet
- [Optional] Paper and pencil per student
- Make sure each student has a Roblox account and knows their login information
- Prep the following videos to show to students: Hour of Code™ and Project Overview (Download both videos)
Lesson Timing
Time | Lesson | Description |
---|---|---|
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 |
Have students write their stories and create placeholders. |
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 |
---|
|
GUIDED WORK Create Stories 5 min |
---|
|
GUIDED TUTORIAL Story Games 25 min |
---|
|
INDEPENDENT WORK Finish Student Projects 15 min |
---|
|
WRAP UP 5 min |
---|
|
Appendix and Resources
Troubleshooting Tips
General Troubleshooting Tips
- Introduce students to “Ask 3 Before Me”: a student needs to ask three peers before asking the instructor for help.
- Have neighbors test each others work. As they test, encourage students to look out for common errors like missing spaces in concatenation.
Lesson 1: Creating Variables
- To help students better find the Story Manger script, draw the order on a display board:
StarterGUI
>GameGUI
>StoryManager
. - As students type in their first variable, make sure it’s between the two dashed green lines. This will help avoid future errors.
Lesson 2: Getting Player Answers
- Stress strict capitalization and spelling as students type words like
storyMaker
andGetInput
. Having one letter misspelled or incorrectly capitalized will cause an error. - Remind students to press the Stop button whenever they’re done playtesting.
Lesson 3: Telling the Story
- As students type out sentences, they may notice extra spaces or some words combined together. String variables show literally everything between quotations.
- If the story writes words that are combined like, “wizardNia”, add an extra space before that variable.
Customizing the Lesson
Simplify the Lesson
- Have students focus on just writing one question, one sentence, and one variable.
Expand the Lesson
- Have students include at least one technique from Tips and Tricks.
- Allow students to trade places to play each other games when finished.
Check for Understanding Questions
Lesson 1 Questions | Answer |
---|---|
A variable is ... | A placeholder for information |
What does scripts hold? | Code to run programs |
Name an example of a good variable name: | adjective03 , name3 , myVerb1 |
Where in the script does the code need to be typed? | Between the two green dashed lines |
Lesson 2 Questions | Answer |
---|---|
Variables can hold more than one type of information. True or false? | True |
String type variables are sandwiched between what? | Quotation marks |
What can and cannot have spaces between them in your code? | String contents can have spaces (like "My name "), variables cannot (like name1 ) |
Lesson 3 Questions | Answer |
---|---|
What does concatenation do and how? | Combines two or more strings/variables together using .. |
Miscellaneous Resources
Course Description
Discover how to build the ultimate interactive word game using Roblox’s free coding and design tools. In this unique one-hour course, students will be able to explore the basics of computer programming and game design, then share their completed game online with friends to craft their own fun stories! Created specifically for students new to programming, this curriculum was developed in partnership between Roblox, the largest entertainment platform for user-generated 3D experiences, and Hour of Code™, a global movement that aims to broaden participation in computer science.
In this course, your student will:
- Learn and develop programming fundamentals with Lua.
- Use programming to create a story game in a 3D world.
- Take home a complete game that can be played and shared online.
Promotional Poster (Download)
Feel free to use this 8.5x11 print out to advertise your eventevent.
Useful Links
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.