Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename hinge joints example to sidescroller car example. #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/_main/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion examples/_main/menu.gui_script
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "default"
name: "sidescroller_car"
scale_along_z: 0
embedded_instances {
id: "backwheel"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

Expand Down