diff --git a/DungeonShooting_Godot/prefab/role/Player.tscn b/DungeonShooting_Godot/prefab/role/Player.tscn index bf3afb0..7625613 100644 --- a/DungeonShooting_Godot/prefab/role/Player.tscn +++ b/DungeonShooting_Godot/prefab/role/Player.tscn @@ -14,6 +14,3 @@ [node name="ShadowSprite" parent="." index="0"] material = SubResource( 1 ) - -[node name="AnimatedSprite" parent="." index="2"] -frame = 1 diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index fcefc81..cc6119c 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -18,12 +18,16 @@ GameManager="*res://src/game/manager/GameManager.cs" +[debug] + +settings/fps/force_fps=60 + [display] window/size/width=1920 window/size/height=1080 window/dpi/allow_hidpi=true -window/vsync/vsync_via_compositor=true +window/vsync/use_vsync=false window/stretch/mode="2d" window/stretch/aspect="keep_width" @@ -173,12 +177,6 @@ project/assembly_name="DungeonShooting" -[physics] - -common/physics_jitter_fix=0.0 -common/enable_pause_aware_picking=true -common/physics_interpolation=true - [rendering] 2d/snapping/use_gpu_pixel_snap=true diff --git a/DungeonShooting_Godot/scene/Room.tscn b/DungeonShooting_Godot/scene/Room.tscn index 6cb8bc5..0262f17 100644 --- a/DungeonShooting_Godot/scene/Room.tscn +++ b/DungeonShooting_Godot/scene/Room.tscn @@ -22,6 +22,7 @@ [node name="Camera2D" type="Camera2D" parent="."] position = Vector2( 253, 219 ) current = true +process_mode = 0 limit_smoothed = true editor_draw_drag_margin = true script = ExtResource( 5 ) diff --git a/DungeonShooting_Godot/src/game/camera/MainCamera.cs b/DungeonShooting_Godot/src/game/camera/MainCamera.cs index f8170f8..9336fa0 100644 --- a/DungeonShooting_Godot/src/game/camera/MainCamera.cs +++ b/DungeonShooting_Godot/src/game/camera/MainCamera.cs @@ -47,6 +47,7 @@ _camPos = _camPos.LinearInterpolate(camPos, Mathf.Min(5 * delta, 1)) + _shakeOffset; var camSubpixelPos = _camPos.Round() - _camPos; (viewportContainer.Material as ShaderMaterial)?.SetShaderParam("offset", camSubpixelPos); + //GlobalPosition = _camPos.Round(); GlobalPosition = _camPos.Round(); } diff --git a/DungeonShooting_Godot/src/game/role/Player.cs b/DungeonShooting_Godot/src/game/role/Player.cs index 8dd1e1f..2909229 100644 --- a/DungeonShooting_Godot/src/game/role/Player.cs +++ b/DungeonShooting_Godot/src/game/role/Player.cs @@ -96,8 +96,8 @@ Face = FaceDirection.Left; } - var f = Mathf.Clamp(Engine.GetPhysicsInterpolationFraction(), 0, 1); - Position = _v1.LinearInterpolate(_v2, f).Round(); + //var f = Mathf.Clamp(Engine.GetPhysicsInterpolationFraction(), 0, 1); + //Position = _v1.LinearInterpolate(_v2, f).Round(); // GD.Print($"Position: {_realPos}, f: {f}"); if (Input.IsActionJustPressed("exchange")) //切换武器 @@ -145,6 +145,7 @@ Move(delta); //播放动画 PlayAnim(); + //GlobalPosition = GlobalPosition.Round(); //AnimatedSprite.Playing = false; } @@ -226,10 +227,10 @@ if (Mathf.IsZeroApprox(dir.y)) Velocity.y = Mathf.MoveToward(Velocity.y, 0, Friction * delta); else Velocity.y = Mathf.MoveToward(Velocity.y, dir.y * MoveSpeed, Acceleration * delta); - _v1 = Position = _v2; + //_v1 = Position = _v2; Velocity = MoveAndSlide(Velocity); - _v2 = Position; - Position = _v1.Round(); + //_v2 = Position; + //Position = _v1.Round(); } // 播放动画