Skip to content

Commit

Permalink
about objects
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel authored Nov 24, 2024
1 parent 2a443b2 commit 60d9f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ if (gamepadWasPressed(0)) // Gamepad button 0

### How do I create and update game objects?

You can create custom objects for your game by extending the EngineObject class.
They will automatically be updated and rendered by the engine.
LittleJS can be used as an object oriented system by extending the base class [EngineObject](https://github.com/KilledByAPixel/LittleJS/blob/main/src/engineObject.js) with your own. This lightweight class provides many useful features including physics, collision, parent/child system, and sorted rendering. These objects are added to the global list of objects where they will automatically be updated and rendered until destroyed.

Here is a template you can use to make objects that behave however you want. See the examples for a complete demonstration.

```javascript
class MyObject extends EngineObject
Expand Down

0 comments on commit 60d9f0e

Please sign in to comment.