Skip to content

Commit

Permalink
fixed framerate
Browse files Browse the repository at this point in the history
  • Loading branch information
oneseedfruit committed May 3, 2021
1 parent bfb247c commit 0486d26
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion game.gd
Expand Up @@ -29,7 +29,7 @@ func _unhandled_input(event: InputEvent) -> void:
_is_ready = false


func _process(delta: float) -> void:
func _physics_process(delta: float) -> void:
$MainCamera.global_position = $HammeredNail.global_position + Vector2(0, 50)

if $MainCamera.global_position.y - _last_pos.y > rand_range(50, 80):
Expand Down
1 change: 1 addition & 0 deletions hammered_nail/hammered_nail.tscn
Expand Up @@ -25,6 +25,7 @@ shape = SubResource( 1 )
disabled = true

[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
position = Vector2( 0.471954, 42.0024 )
stream = ExtResource( 4 )

[connection signal="hammered" from="Hammering" to="." method="_on_Hammering_hammered"]
Expand Down
2 changes: 1 addition & 1 deletion hammering/hammering.gd
Expand Up @@ -24,7 +24,7 @@ func _unhandled_input(event: InputEvent) -> void:
_is_hammering = true


func _process(delta: float) -> void:
func _physics_process(delta: float) -> void:
if not _is_stopped and _is_hammering:
$AnimationPlayer.play("hammering")
if $AnimationPlayer.playback_speed < 500:
Expand Down
2 changes: 1 addition & 1 deletion hammering/hammering.tscn
Expand Up @@ -38,7 +38,7 @@ wait_time = 0.1
autostart = true

[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
position = Vector2( -316.357, 206.9 )
position = Vector2( -318.877, 203.75 )
stream = ExtResource( 4 )
max_distance = 3000.0

Expand Down
8 changes: 4 additions & 4 deletions plate/plate.tscn
Expand Up @@ -2,16 +2,16 @@

[ext_resource path="res://plate/plate.PNG" type="Texture" id=1]

[sub_resource type="PhysicsMaterial" id=2]
[sub_resource type="PhysicsMaterial" id=1]
rough = true
absorbent = true

[sub_resource type="CircleShape2D" id=1]
[sub_resource type="CircleShape2D" id=2]
radius = 41.9254

[node name="Plate" type="RigidBody2D"]
mass = 0.01
physics_material_override = SubResource( 2 )
physics_material_override = SubResource( 1 )
gravity_scale = 0.0
contacts_reported = 2
contact_monitor = true
Expand All @@ -26,7 +26,7 @@ __meta__ = {
}

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
shape = SubResource( 2 )
__meta__ = {
"_edit_lock_": true
}
2 changes: 2 additions & 0 deletions project.godot
Expand Up @@ -20,6 +20,8 @@ config/icon="res://hammer/hammer.PNG"

window/size/width=600
window/size/height=1024
window/size/test_width=480
window/size/test_height=819
window/handheld/orientation="portrait"
window/stretch/mode="2d"
window/stretch/aspect="keep"
Expand Down

0 comments on commit 0486d26

Please sign in to comment.