Skip to content

Commit

Permalink
User can hold bluescreen so it stops
Browse files Browse the repository at this point in the history
  • Loading branch information
BenHerbst committed May 26, 2022
1 parent 788b50b commit 258ed78
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions animation_player.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends AnimationPlayer


func _process(delta):
if Input.is_action_just_pressed("hold"):
# holds the percentage animation / plays it again when currently holded
if is_playing():
stop(false)
else:
play()
4 changes: 3 additions & 1 deletion main.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=11 format=2]

[ext_resource path="res://Roboto-Regular.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://qrcode.png" type="Texture" id=2]
[ext_resource path="res://main.gd" type="Script" id=3]
[ext_resource path="res://animation_player.gd" type="Script" id=4]

[sub_resource type="DynamicFont" id=2]
size = 70
Expand Down Expand Up @@ -155,5 +156,6 @@ stretch_mode = 6
autoplay = "start"
anims/RESET = SubResource( 6 )
anims/start = SubResource( 5 )
script = ExtResource( 4 )

[connection signal="gui_input" from="." to="." method="_on_Control_gui_input"]
8 changes: 8 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ config/icon="res://icon.png"

window/size/fullscreen=true

[input]

hold={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":72,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}

[physics]

common/enable_pause_aware_picking=true
Expand Down

0 comments on commit 258ed78

Please sign in to comment.