-
Notifications
You must be signed in to change notification settings - Fork 2
Objects
Pancake object is part of data that you give to pancake so it can simulate things about this object. For example, you can create an object named player and give it animation/static image, apply physics to it, define if it should collide, etc.
-
x ← horizontal coordinate of the object. Combined with "y", it defines the position of the object. This defines where the left edge of an object should be.
-
y ← vertical coordinate of the object. Combined with "x", it defines the position of the object. This defines where the top edge of an object should be.
-
width ← the width of the object. It’s used for collision and such.
-
height ← the height of the object. It’s used for collision and such.
-
colliding ← Tells if the object should collide with other objects with colliding set to true. If it’s not set to anything, it will act as if it’s false.
-
name ← This tells pancake what name the object should have. It’s very important when you want to animate the object using pancake’s built-in animation system
-
image ← This defines what image should be displayed for this object. Remember, it is a string containing the name you’ve given the image while adding it using pancake.addImage. If the object has no image set, it will be invisible, but will still collide and act as it was there!
-
layer ← Defines what layer the object should be in. # Other (less important):
-
animation ← this contains the animation table of the object. You generally don’t use it anywhere because you can use pancake.changeAnimation(object, animation_name) and that’s easier. This table contains frames, speed, the current time of frame and its name in it.
-
forces← This contains all forces that are being applied on the object (if physics were applied to it) such as gravity.
It’s advised to use pancake.getStat() to get a parameter that is related to physics such as friction, velocity, acceleration, mass or direction!library/pancake/wiki/pancake.getStat
Using pancake.addObject().
Wiki created by MightyPancake
Main articles:
Tutorials:
Topics:
Functions: