mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Remove obsolete C# methods from Using RigidBody2D (#5957)
This commit is contained in:
committed by
Hugo Locurcio
parent
58c37b7a52
commit
65ceb0e94c
@@ -293,16 +293,16 @@ For example, here is the code for an "Asteroids" style spaceship:
|
||||
public override void _IntegrateForces(Physics2DDirectBodyState state)
|
||||
{
|
||||
if (Input.IsActionPressed("ui_up"))
|
||||
SetAppliedForce(_thrust.Rotated(Rotation));
|
||||
AppliedForce = _thrust.Rotated(Rotation);
|
||||
else
|
||||
SetAppliedForce(new Vector2());
|
||||
AppliedForce = new Vector2();
|
||||
|
||||
var rotationDir = 0;
|
||||
if (Input.IsActionPressed("ui_right"))
|
||||
rotationDir += 1;
|
||||
if (Input.IsActionPressed("ui_left"))
|
||||
rotationDir -= 1;
|
||||
SetAppliedTorque(rotationDir * _torque);
|
||||
AppliedTorque = rotationDir * _torque;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user