Skip to content

pancake.addObject()

Mighty Pancake edited this page Apr 7, 2020 · 1 revision

pancake.addObject(object_data)

Description

Creates and saves an object with given attributes with other [objects](https://github.com/pancake-library/pancake-wiki/wiki/Objects).

Inputs:

object_data ← Table containing all attributes that the object should have

Outputs:

object ← Pancake object

Example

player = pancake.addObject({name = "Bob", x = 0, y = 0, width = 10, height = 10, colliding = true, image = "bob})

Creates an object with attribute name set to "Bob", x to 0, etc.