diff --git a/examples/_main/loader.go b/examples/_main/loader.go index 4360320..181343b 100644 --- a/examples/_main/loader.go +++ b/examples/_main/loader.go @@ -733,7 +733,7 @@ embedded_components { embedded_components { id: "physics/hinge_joint" type: "collectionproxy" - data: "collection: \"/examples/physics/hinge_joint/hinge_joint.collection\"\n" + data: "collection: \"/examples/physics/sidescroller_car/sidescroller_car.collection\"\n" "exclude: false\n" "" position { diff --git a/examples/_main/menu.gui_script b/examples/_main/menu.gui_script index cb845b6..5d6b012 100644 --- a/examples/_main/menu.gui_script +++ b/examples/_main/menu.gui_script @@ -103,7 +103,7 @@ function init(self) self.index["basics"] = { "message_passing", "parent_child", "z_order" } self.index["factory"] = { "basic", "bullets" } self.index["movement"] = { "simple_move", "follow", "move_to", "move_forward", "movement_speed", "look_at" } - self.index["physics"] = { "dynamic", "kinematic", "raycast", "trigger", "hinge_joint", "pendulum", "knockback"} + self.index["physics"] = { "dynamic", "kinematic", "raycast", "trigger", "sidescroller_car", "pendulum", "knockback"} self.index["animation"] = { "spinner", "flipbook", "chained_tween", "basic_tween", "spine", "cursor" } self.index["gui"] = { "button", "stencil", "load_texture", "progress", "pointer_over", "color", "slice9" } self.index["input"] = { "move", "text", "down_duration", "mouse_and_touch" } diff --git a/examples/physics/hinge_joint/hinge_joint.collection b/examples/physics/sidescroller_car/sidescroller_car.collection similarity index 97% rename from examples/physics/hinge_joint/hinge_joint.collection rename to examples/physics/sidescroller_car/sidescroller_car.collection index 9ac96b0..e955b73 100644 --- a/examples/physics/hinge_joint/hinge_joint.collection +++ b/examples/physics/sidescroller_car/sidescroller_car.collection @@ -1,4 +1,4 @@ -name: "default" +name: "sidescroller_car" scale_along_z: 0 embedded_instances { id: "backwheel" @@ -202,12 +202,6 @@ embedded_instances { " z: 0.0\\n" " w: 0.0\\n" "}\\n" - "scale {\\n" - " x: 0.5\\n" - " y: 0.5\\n" - " z: 1.0\\n" - " w: 0.0\\n" - "}\\n" "color {\\n" " x: 0.0\\n" " y: 0.5647059\\n" @@ -246,6 +240,11 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " scale {\n" + " x: 0.5\n" + " y: 0.5\n" + " z: 1.0\n" + " }\n" "}\n" "" position { @@ -269,7 +268,7 @@ embedded_instances { id: "body" data: "components {\n" " id: \"script\"\n" - " component: \"/examples/physics/hinge_joint/hinge_joint.script\"\n" + " component: \"/examples/physics/sidescroller_car/sidescroller_car.script\"\n" " position {\n" " x: 0.0\n" " y: 0.0\n" @@ -281,6 +280,8 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "embedded_components {\n" " id: \"sprite\"\n" diff --git a/examples/physics/hinge_joint/hinge_joint.md b/examples/physics/sidescroller_car/sidescroller_car.md similarity index 70% rename from examples/physics/hinge_joint/hinge_joint.md rename to examples/physics/sidescroller_car/sidescroller_car.md index d3fe00b..92d2e50 100644 --- a/examples/physics/hinge_joint/hinge_joint.md +++ b/examples/physics/sidescroller_car/sidescroller_car.md @@ -1,10 +1,12 @@ --- -title: Hinge joint physics -brief: This example shows a simple setup with a dynamic body physics object and two dynamic wheel physics object joined together with a joint of type "hinge". The hinge joint can simulate an axle or a pin on which other object is rotating in respect to the base. The example shows how to create, destroy and change properties of the joints. -scripts: hinge_joint.script +title: Sidescroller car example using hinge joint physics +brief: This example shows a simple setup with a dynamic body physics object and two dynamic wheel physics object joined together with a joint of type "hinge". +scripts: sidescroller_car.script --- -![hinge_joint](hinge_joint.png) +![sidescroller_car](sidescroller_car.png) + +This example shows a simple setup with a dynamic car body physics object and two dynamic wheels physics object joined together with a joint of type "hinge". The hinge joint can simulate an axle or a pin on which other object is rotating in respect to the base. The example shows how to create, destroy and change properties of the joints. The setup consists of four game objects. The *game.project* physics *GravityY* property is set to -500 to match the scale of the setup. diff --git a/examples/physics/hinge_joint/hinge_joint.png b/examples/physics/sidescroller_car/sidescroller_car.png similarity index 100% rename from examples/physics/hinge_joint/hinge_joint.png rename to examples/physics/sidescroller_car/sidescroller_car.png diff --git a/examples/physics/hinge_joint/hinge_joint.script b/examples/physics/sidescroller_car/sidescroller_car.script similarity index 100% rename from examples/physics/hinge_joint/hinge_joint.script rename to examples/physics/sidescroller_car/sidescroller_car.script