Created
November 5, 2015 23:02
-
-
Save pfirsich/4e9e7fb9bf626e3085d4 to your computer and use it in GitHub Desktop.
Simple example of an entity type description file for Screwdriver (shown in my blog). The beginning for a hypothetical full remake of Spacewalk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entityTypes["levelGeometry"] = { | |
label = "Level geometry", | |
components = { | |
{ | |
id = "core", | |
componentType = "Core", -- every entity type has to have a core component | |
}, | |
{ | |
id = "transforms", | |
componentType = "Transforms", | |
}, | |
{ | |
id = "polygon", | |
componentType = "BorderedFannedPolygon", | |
} | |
} | |
} | |
entityTypes["spawnZone"] = { | |
label = "Spawn zone", | |
components = { | |
{ | |
id = "core", | |
componentType = "Core", | |
}, | |
{ | |
id = "transforms", | |
componentType = "Transforms", | |
}, | |
{ | |
id = "polygon", | |
componentType = "SimplePolygon", | |
} | |
} | |
} | |
entityTypes["weaponPod"] = { | |
label = "Sprite + Transforms", | |
components = { | |
{ | |
id = "core", | |
componentType = "Core", | |
}, | |
{ | |
id = "transforms", | |
componentType = "Transforms", | |
}, | |
{ | |
id = "sprite", | |
componentType = "Sprite", | |
imagePath = "pod.png" | |
}, | |
{ | |
id = "weaponType", | |
componentType = "MetadataChoice", -- other metadata components are available too (string, number, boolean, entity) | |
choices = { -- id - label pairs | |
rifle = "Rifle", | |
shotgung = "Shotgun", | |
}, | |
value = "rifle", | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment