"

Introduction

Learn Coding and Animations in Lua Code

Hasan Malik; Rutwa Engineer; and Kyra Ma

Introduction

Welcome to the world of computer science and game development!

This curriculum introduces you to the fundamentals of programming through Lua, a beginner-friendly programming language, and Roblox Studio, a platform for designing and developing interactive 3D games. By combining these tools, you’ll learn how to bring your own Roblox games to life!

Programming is how we give instructions to a computer. In Roblox Studio, Lua scripts add functionality to our games—it controls how objects behave, how players interact with the world, and how game logic works. For example, you can use Lua to make a door open when a player steps on a button, track a player’s score, or create an enemy that chases the player.

Lua is widely used in game development because it is efficient (translation: it runs quickly without using a lot of computer power) and flexible (translation: it can be used for many different tasks). It has been used in games like Roblox, World of Warcraft, and Angry Birds to control animations, physics, and a variety of other gameplay mechanics.

Whether you are completely new to coding or possess prior experience, this curriculum will guide you through step-by-step lessons and interactive projects, giving you the skills to write your own scripts. By learning Lua, you’ll not only develop skills applicable to Roblox Studio, but also gain a solid foundation for understanding other programming languages, including—but not limited to—Python, C#, and Java.

Course Outline and Syllabus


  • Download Roblox Studios and sign in
  • Understand the basic interface of Roblox Studios
  • Create your first script
  • Run your first script
  • Learn how to save your scripts
  • Learn about Print Statements
  • Learn why we need data types
  • Learn about the following data types in Lua:
    • Boolean
    • Number
    • String
  • Learn how to use data types depending on the type of information needed
  • Learn why we need variables
  • Explore with different types of variables
  • Learn the conventions of variable naming
  • Learn about the following String Operations:
    • Concatenation
    • Length
    • Upper/Lowercase methods
    • Slicing (via the .sub method)
  • Be introduced to basic string methods
  • Learn about two notation styles for string methods in Lua
  • Learn the and operator
  • Learn the or operator
  • Learn the order of precedence of boolean operators
  • Learn about If-Statements
  • Learn about If-Else Statements
  • Learn about If-Elseif-Else Statements
  • Learn when to use each type of conditional statement
  • Learn the not operator
  • Learn how boolean variables interplay with conditional statements
  • Learn about the need for loops
  • Learn about for loops
  • Learn about while loops
  • Learn how to avoid infinite while loops
  • Learn about nested loops
  • Learn about breaks and continues
  • Learn the Importance of Taking Input
  • Learn to take string inputs
  • Learn to take numerical inputs
  • Learn what are lists in Lua
  • Learn to access, add, and remove elements in a list
  • Learn how to find the length of a list
  • Learn to loop through a list using a basic for loop and using ipairs()
  • Learn how to sort a list

Queries

For any queries, you may contact the authors:

  • Hasan Malik
  • Kyra Ma
  • Professor Rutwa Engineer

License

Learn Coding and Animations in Lua Code Copyright © by Kyra Ma; Hasan Malik; and Rutwa Engineer. All Rights Reserved.