Lua Maze Game Tyler Tamburlin Project Automatically generate - - PowerPoint PPT Presentation

lua maze game
SMART_READER_LITE
LIVE PREVIEW

Lua Maze Game Tyler Tamburlin Project Automatically generate - - PowerPoint PPT Presentation

Lua Maze Game Tyler Tamburlin Project Automatically generate random maze Allow user to solve the maze Utilize LOVE2D engine Maze Generation: Backtracking Process Select random starting cell Recursive steps Select


slide-1
SLIDE 1

Lua Maze Game

Tyler Tamburlin

slide-2
SLIDE 2

Project

  • Automatically generate random maze
  • Allow user to solve the maze
  • Utilize LOVE2D engine
slide-3
SLIDE 3

Maze Generation: Backtracking

  • Process

 Select random starting cell  Recursive steps

 Select random direction  Check cell in that direction if it has been visited or is the start cell  If all cells in all directions are visited return to previous cell  Repeat until current cell is the start cell

 Select a random ending cell that occurs at end of a hall

slide-4
SLIDE 4

Implementation

  • Lua Tables
  • Cell Table

 Information for either a wall or passage cell  Whether user is in cell  Cell from which the current cell was arrived at  All function for variable modification

  • Maze Table

 Contains the entire maze  Consists of tables containing cell tables  Stores all possible directions

slide-5
SLIDE 5

Maze Functions: Command Line

  • Functions contained in Maze table
  • Create

 Takes the width and height desired  Generates a table called maze which represents a blank maze  Includes a toString function in new maze table to print of command line

  • Backtrack

 Takes the maze, width and height  Generates the maze using the backtracking algorithm

  • Usersolve

 Takes the maze, width and height  Continually prints maze and prompts user for moves  When user cell is end cell prompts user of win

slide-6
SLIDE 6

Maze Functions: Love2D

  • Uses the same functions for create and backtrack
  • Utilizes two new files

 Main to get user size inputs  Solvemaze to display maze and let user solve

  • Love functions

 Draw

 Draws the graphical interface for the maze  Makes use of rectangle objects to draw cells, start, end and user

 Keypressed

 Allows for keyboard inputs to move user

slide-7
SLIDE 7

Game: Command Line

slide-8
SLIDE 8

Game: LOVE2D