Rename RigidBody -> RigidDynamicBody

This commit is contained in:
Aaron Franke
2022-03-27 19:05:07 -05:00
parent f2918178d7
commit ab0816a44e
38 changed files with 54 additions and 54 deletions

View File

@@ -1,11 +1,11 @@
# Physics Platformer
This demo uses [`RigidBody2D`](https://docs.godotengine.org/en/latest/classes/class_rigidbody2d.html)
This demo uses [`RigidDynamicBody2D`](https://docs.godotengine.org/en/latest/classes/class_rigiddynamicbody2d.html)
for the player and enemies.
These character controllers are more powerful than
[`KinematicBody2D`](https://docs.godotengine.org/en/latest/classes/class_kinematicbody2d.html),
but can be more difficult to handle, as they require
manual modification of the RigidBody velocity.
manual modification of the RigidDynamicBody velocity.
Language: GDScript
@@ -17,7 +17,7 @@ Check out this demo on the asset library: https://godotengine.org/asset-library/
The player and enemies use dynamic character
controllers for movement, made with
[`RigidBody2D`](https://docs.godotengine.org/en/latest/classes/class_rigidbody2d.html),
[`RigidDynamicBody2D`](https://docs.godotengine.org/en/latest/classes/class_rigiddynamicbody2d.html),
which means that they can perfectly interact with physics
(there is a see-saw, and you can even ride enemies).
Because of this, all movement must be done in sync with

View File

@@ -11,7 +11,7 @@ extents = Vector2(8, 13.5)
[node name="Seesaw" type="Node2D"]
[node name="Plank" type="RigidBody2D" parent="."]
[node name="Plank" type="RigidDynamicBody2D" parent="."]
mass = 5.10204
[node name="Sprite2D" type="Sprite2D" parent="Plank"]

View File

@@ -106,7 +106,7 @@ radius = 7.0
offsets = PackedFloat32Array(0.5, 1)
colors = PackedColorArray(1, 1, 1, 0.501961, 0, 0, 0, 0)
[node name="Enemy" type="RigidBody2D"]
[node name="Enemy" type="RigidDynamicBody2D"]
mode = 2
physics_material_override = SubResource( 1 )
contacts_reported = 4

View File

@@ -1,5 +1,5 @@
class_name Enemy
extends RigidBody2D
extends RigidDynamicBody2D
const WALK_SPEED = 50

View File

@@ -6,7 +6,7 @@
[node name="MovingPlatform" type="Node2D"]
script = ExtResource( 1 )
[node name="Platform" type="RigidBody2D" parent="."]
[node name="Platform" type="RigidDynamicBody2D" parent="."]
mode = 3
[node name="Sprite2D" type="Sprite2D" parent="Platform"]

View File

@@ -14,4 +14,4 @@ func _physics_process(delta):
var xf = Transform2D()
xf[2]= motion * d
($Platform as RigidBody2D).transform = xf
($Platform as RigidDynamicBody2D).transform = xf

View File

@@ -50,7 +50,7 @@ tracks/2/keys = {
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[node name="Bullet" type="RigidBody2D"]
[node name="Bullet" type="RigidDynamicBody2D"]
continuous_cd = 2
script = ExtResource( 1 )

View File

@@ -190,7 +190,7 @@ tracks/0/keys = {
custom_solver_bias = 0.5
length = 18.0
[node name="Player" type="RigidBody2D"]
[node name="Player" type="RigidDynamicBody2D"]
mode = 2
mass = 1.5
physics_material_override = SubResource( 1 )

View File

@@ -1,5 +1,5 @@
class_name Bullet
extends RigidBody2D
extends RigidDynamicBody2D
var disabled = false

View File

@@ -1,5 +1,5 @@
class_name Player
extends RigidBody2D
extends RigidDynamicBody2D
# Character Demo, written by Juan Linietsky.
#

View File

@@ -9,7 +9,7 @@
config_version=4
_global_script_classes=[{
"base": "RigidBody2D",
"base": "RigidDynamicBody2D",
"class": &"Bullet",
"language": &"GDScript",
"path": "res://player/bullet.gd"
@@ -19,7 +19,7 @@ _global_script_classes=[{
"language": &"GDScript",
"path": "res://coin/coin.gd"
}, {
"base": "RigidBody2D",
"base": "RigidDynamicBody2D",
"class": &"Enemy",
"language": &"GDScript",
"path": "res://enemy/enemy.gd"
@@ -29,7 +29,7 @@ _global_script_classes=[{
"language": &"GDScript",
"path": "res://platform/moving_platform.gd"
}, {
"base": "RigidBody2D",
"base": "RigidDynamicBody2D",
"class": &"Player",
"language": &"GDScript",
"path": "res://player/player.gd"
@@ -45,10 +45,10 @@ _global_script_class_icons={
[application]
config/name="Physics-Based Platformer 2D"
config/description="This demo uses RigidBody2D for the player and enemies. These
config/description="This demo uses RigidDynamicBody2D for the player and enemies. These
character controllers are more powerful than CharacterBody2D,
but can be more difficult to handle, as they require
manual modification of the RigidBody3D velocity."
manual modification of the RigidDynamicBody3D velocity."
run/main_scene="res://Stage.tscn"
config/icon="res://icon.png"