-
Notifications
You must be signed in to change notification settings - Fork 5
This Week in LesserPanda #9
Covering the days from 2016-06-15 to 2016-06-22.
This week I've been busy working on my own projects, so not much changes are brought to LesserPanda. Even though a basic support of Tiled object layer is completed, powered by the awesome Actor system.
Due to some users request, I've updated all the samples for latest version, so anybody interested how LesserPanda looks like, can take a snap on the official sample repo.
Since the tiled collision support is finished, I started to think why not add basic support of object layer, so developers can easily build levels from Tiled editor instead of hard coding.
You can now create object layers in the Tiled editor, and actors added into these layers will be spawned automatically.
First of all you need to create object layers, and the layer name
will be directly used during initialization. If a layer with the name you
defined in Tiled does not exist(created using createLayer
method), it
will be automatically created.
I suggest create all the layers manually before add the Tilemap instance to a scene.
After the layer is created, you can place anything into the layer. Note that objects are treated as specific types of Actors, and the image/tile of an object is simply ignored.
You need to set object Type to the Actor class you've coded to be able to make it work properly.
Let's say you've create an Actor class called Player
:
- Register the
Player
actor:Actor.register('Player', Player)
- Set
Type
of objects in Tiled object layer - To be able to get the reference of an Actor instance you need to set its name
Some new developers have see my posts and wanted to try LesserPanda, but sadly they cannot find much documents. So I updated all the samples to latest engine for everyone that wants to get started.
More samples yeah! And better support of Tiled object layer. The Tiled editor will be supported before LesserPanda editor is out. To help developers improve the game making experience, I decided to continuously improve this feature.