Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 1.18 KB

File metadata and controls

72 lines (47 loc) · 1.18 KB

"Project L.A. Sue"

AKA "Project Ben Biri"

Game for Ludum Dare 47 - "Stuck in a loop"

Setup

  1. Install Love2d https://love2d.org/#download
  2. (Windows) add "C:\Program Files\LOVE" to your path - guide

VSCode

In VSCode, press F4 then choose "Launch game".

Lua reference

Lua packages

Copy files into /src/lib then reference them with `require "lib/"

Lua classes

Reference

Create a class with

MyClass = { }
function MyClass:create()
  instance = {}
  setmetatable(instance, self)
  self.__index = self
  return instance
end

extend a class with

SubClass = MyClass:create()

add a method to your class with

function Class:foo()
  print("Hello world");
end

-- Methods on subclasses will be used instead of the method on the parent class.
function SubClass:bar()
  self.foo()
end

call methods with :

local instance = SubClass:create()
instance:bar() -- This will print "Hello world"

set and define properties with .

instance.prop = "hi"
print(instance.prop)