Skip to content

Instantly share code, notes, and snippets.

@pfirsich
Created November 5, 2015 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfirsich/4e9e7fb9bf626e3085d4 to your computer and use it in GitHub Desktop.
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.
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