Skip to content

Commit

Permalink
rename GameObject property to gameObject for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Klausner committed Mar 25, 2024
1 parent cfb8041 commit 86abaf1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions assets/maps/objects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<grid orientation="orthogonal" width="1" height="1"/>
<tile id="0" type="EntityDef">
<properties>
<property name="GameObject" propertytype="GameObject" value="FROG"/>
<property name="entityTags" propertytype="EntityTag" value="PLAYER,CAMERA_FOCUS"/>
<property name="gameObject" propertytype="GameObject" value="FROG"/>
<property name="hasAnimation" type="bool" value="true"/>
<property name="hasState" type="bool" value="true"/>
<property name="jumpHeight" type="float" value="3.2"/>
Expand Down Expand Up @@ -42,10 +42,10 @@
</tile>
<tile id="1" type="EntityDef">
<properties>
<property name="GameObject" propertytype="GameObject" value="SAW"/>
<property name="bodyType" propertytype="BodyType" value="KinematicBody"/>
<property name="damage" type="int" value="1"/>
<property name="entityTags" propertytype="EntityTag" value=""/>
<property name="gameObject" propertytype="GameObject" value="SAW"/>
<property name="hasAnimation" type="bool" value="true"/>
<property name="hasTrack" type="bool" value="true"/>
<property name="speed" type="float" value="3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class LoadingScreen(
gdxError("No collision shapes defined for tile ${tile.id}")
}

val gameObjectStr = tile.propertyOrNull<String>("GameObject")
?: gdxError("Missing property 'GameObject' on tile ${tile.id}")
val gameObjectStr = tile.propertyOrNull<String>("gameObject")
?: gdxError("Missing property 'gameObject' on tile ${tile.id}")
OBJECT_FIXTURES[GameObject.valueOf(gameObjectStr)] = objectFixtureDefs
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TiledService(
// spawn physic body
val tile = mapObject.tile
val bodyType = BodyType.valueOf(tile.property<String>("bodyType", BodyType.DynamicBody.name))
val gameObjectStr = tile.property<String>("GameObject")
val gameObjectStr = tile.property<String>("gameObject")
val gameObject = GameObject.valueOf(gameObjectStr)
val fixtureDefs = OBJECT_FIXTURES[gameObject]
?: gdxError("No fixture definitions for $gameObjectStr")
Expand Down
12 changes: 6 additions & 6 deletions tiled-project.tiled-project
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
"drawFill": true,
"id": 3,
"members": [
{
"name": "GameObject",
"propertyType": "GameObject",
"type": "string",
"value": "FROG"
},
{
"name": "bodyType",
"propertyType": "BodyType",
Expand All @@ -50,6 +44,12 @@
"type": "string",
"value": ""
},
{
"name": "gameObject",
"propertyType": "GameObject",
"type": "string",
"value": "FROG"
},
{
"name": "hasAnimation",
"type": "bool",
Expand Down

0 comments on commit 86abaf1

Please sign in to comment.