Skip to content

Commit

Permalink
Pong demo: Fix ball velocity decay
Browse files Browse the repository at this point in the history
In moddable pong the project had linear damp and angular damp in zero.
To do that only for the ball (not project wide) we can set linear and
angular damp mode to "replace" in the RigidBody2D.
  • Loading branch information
manuq committed Jun 19, 2024
1 parent b129a33 commit c50cf78
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pong_game/ball.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ continuous_cd = 1
max_contacts_reported = 1
contact_monitor = true
linear_velocity = Vector2(353.553, 353.553)
linear_damp_mode = 1
angular_damp_mode = 1
script = ExtResource("1_vdrab")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
Expand Down

0 comments on commit c50cf78

Please sign in to comment.