PixelPAD 2D - objects

new_object(name: str) -> GameObject

Example
Description
Creates a new instance of the named game object in the current room.
Parameters
name
The name of a GameObject asset to instantiate, as a string.

Return
A new instance of the named GameObject asset.

destroy(obj: GameObject) -> GameObject

Example
Description
Destroys a gameObject instance.
Parameters
obj
The GameObject instance to destroy

Return
No Return Value.

Objects

Objects (Sometimes referred to as GameObjects) are the main part of any PixelPAD2D game. Each object represents one active "thing" in your game. Like rooms, each object is defined by an object script, which says what the object looks like, how it should react to other objects, and other things like that. A room can have as many active objects as you want, but when you change rooms, they're all destroyed. To create a new object, use the new_object function.

Scripts

Start - The Object Start tab contains code that gets run right away when an GameObject instance is created. An example is setting a ‘Sprite’ (A computer image) to an object.

Loop - The Object Loop tab contains code that gets run many times per second while the object is active. An example is controlling the player’s movement.
Company
Resources
Contact Us