diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f314891 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +TapTapTapTap.apk +TapTapTapTap.apk.idsig \ No newline at end of file diff --git a/Button Pressed.png b/Button Pressed.png new file mode 100644 index 0000000..a2cb93f Binary files /dev/null and b/Button Pressed.png differ diff --git a/Button Pressed.png.import b/Button Pressed.png.import new file mode 100644 index 0000000..02818be --- /dev/null +++ b/Button Pressed.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Button Pressed.png-acc2bc337bb9dfcad2aec007d83448b3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Button Pressed.png" +dest_files=[ "res://.import/Button Pressed.png-acc2bc337bb9dfcad2aec007d83448b3.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Button.png b/Button.png new file mode 100644 index 0000000..25ef22c Binary files /dev/null and b/Button.png differ diff --git a/Button.png.import b/Button.png.import new file mode 100644 index 0000000..27612a1 --- /dev/null +++ b/Button.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Button.png-db95f38c36cb47c93767cda66da72387.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Button.png" +dest_files=[ "res://.import/Button.png-db95f38c36cb47c93767cda66da72387.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Inter-Black.otf b/Inter-Black.otf new file mode 100644 index 0000000..8e18e36 Binary files /dev/null and b/Inter-Black.otf differ diff --git a/Inter-Regular.otf b/Inter-Regular.otf new file mode 100644 index 0000000..84e6a61 Binary files /dev/null and b/Inter-Regular.otf differ diff --git a/Main.gd b/Main.gd index 0b3b1dc..21442b5 100644 --- a/Main.gd +++ b/Main.gd @@ -3,23 +3,24 @@ extends Control var times = [] var i = 0 var bpm: float -onready var button = $Button -onready var DisplayBPM = $Label +onready var BPMNumber = $"BPMNumber" -func _ready(): - button.connect("pressed", self, "_button_pressed") - -func _button_pressed(): +func count(): times.append(OS.get_ticks_usec()) - if (i!=0): - var delta = times[i]-times[i-1] - print(delta) - if (i > 8 && delta > 240000000 / bpm): - i = 0 - bpm = 0 - else: - bpm = 60000000 / delta - i += 1 - DisplayBPM.text = str(bpm) + "BPM" - else: - i += 1 + var avgDelta + #RESET STUFF THAT DIDN'T WORK + #var delta + #if (avgDelta && delta>(avgDelta*2)): + # i=0 + # times.clear() + # bpm=0 + #print(str(delta) + " " + str(avgDelta)) + if (i>3): + avgDelta = ((times[i]-times[i-1]) + (times[i-1]-times[i-2]) + (times[i-2]-times[i-3]) + (times[i-3]-times[i-4]))/4 + bpm = 60000000 / avgDelta + BPMNumber.text = str(bpm) + "BPM" + # delta = (times[i]-times[i-1]) + i += 1 + +func _on_Tap_button_down(): + count() diff --git a/Main.tscn b/Main.tscn index 42e2b30..1877c31 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,6 +1,13 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://Main.gd" type="Script" id=1] +[ext_resource path="res://Button.png" type="Texture" id=2] +[ext_resource path="res://Button Pressed.png" type="Texture" id=3] +[ext_resource path="res://Inter-Black.otf" type="DynamicFontData" id=4] + +[sub_resource type="DynamicFont" id=1] +size = 128 +font_data = ExtResource( 4 ) [node name="Control" type="Control"] anchor_left = 0.5 @@ -16,12 +23,17 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="."] +[node name="BPMNumber" type="Label" parent="."] anchor_left = 0.5 +anchor_top = 0.5 anchor_right = 0.5 -margin_left = -147.0 -margin_right = 147.0 -margin_bottom = 141.0 +anchor_bottom = 0.5 +margin_left = -261.0 +margin_top = -469.0 +margin_right = 262.0 +margin_bottom = -314.0 +custom_fonts/font = SubResource( 1 ) +custom_colors/font_color = Color( 1, 0.486275, 0, 1 ) text = "--" align = 1 valign = 1 @@ -29,16 +41,19 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Button" type="Button" parent="."] +[node name="TapButton" type="TextureButton" parent="."] anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -310.0 -margin_top = -133.0 -margin_right = 310.0 -margin_bottom = 132.0 -text = "Tap" +margin_left = -510.0 +margin_top = -206.0 +margin_right = 510.0 +margin_bottom = 814.0 +texture_normal = ExtResource( 2 ) +texture_pressed = ExtResource( 3 ) __meta__ = { "_edit_use_anchors_": false } + +[connection signal="button_down" from="TapButton" to="." method="_on_Tap_button_down"] diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..e69de29 diff --git a/Splash.png b/Splash.png new file mode 100644 index 0000000..ccd52b2 Binary files /dev/null and b/Splash.png differ diff --git a/Splash.png.import b/Splash.png.import new file mode 100644 index 0000000..85bfd28 --- /dev/null +++ b/Splash.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Splash.png-a2c00b34950005c5d52b66725d00fc48.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Splash.png" +dest_files=[ "res://.import/Splash.png-a2c00b34950005c5d52b66725d00fc48.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/adaptive-icon-bg.png b/adaptive-icon-bg.png new file mode 100644 index 0000000..a877c37 Binary files /dev/null and b/adaptive-icon-bg.png differ diff --git a/adaptive-icon-bg.png.import b/adaptive-icon-bg.png.import new file mode 100644 index 0000000..64512e2 --- /dev/null +++ b/adaptive-icon-bg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/adaptive-icon-bg.png-fce29ad796cd4d22acea1631bf4ccf25.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://adaptive-icon-bg.png" +dest_files=[ "res://.import/adaptive-icon-bg.png-fce29ad796cd4d22acea1631bf4ccf25.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/adaptive-icon-fg.png b/adaptive-icon-fg.png new file mode 100644 index 0000000..a737f23 Binary files /dev/null and b/adaptive-icon-fg.png differ diff --git a/adaptive-icon-fg.png.import b/adaptive-icon-fg.png.import new file mode 100644 index 0000000..4ef901a --- /dev/null +++ b/adaptive-icon-fg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/adaptive-icon-fg.png-62e92cc71449296474250401da45150b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://adaptive-icon-fg.png" +dest_files=[ "res://.import/adaptive-icon-fg.png-62e92cc71449296474250401da45150b.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/export_presets.cfg b/export_presets.cfg index 0b66acf..a3748da 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -33,16 +33,16 @@ version/name="1.0" package/unique_name="org.godotengine.$genname" package/name="" package/signed=true -launcher_icons/main_192x192="" -launcher_icons/adaptive_foreground_432x432="" -launcher_icons/adaptive_background_432x432="" +launcher_icons/main_192x192="res://icon.png" +launcher_icons/adaptive_foreground_432x432="res://adaptive-icon-fg.png" +launcher_icons/adaptive_background_432x432="res://adaptive-icon-bg.png" graphics/32_bits_framebuffer=true graphics/opengl_debug=false xr_features/xr_mode=0 xr_features/degrees_of_freedom=0 xr_features/hand_tracking=0 xr_features/focus_awareness=false -screen/immersive_mode=true +screen/immersive_mode=false screen/support_small=true screen/support_normal=true screen/support_large=true diff --git a/icon.png b/icon.png index c98fbb6..bb050f0 100644 Binary files a/icon.png and b/icon.png differ diff --git a/project.godot b/project.godot index 80f4109..114ed72 100644 --- a/project.godot +++ b/project.godot @@ -12,6 +12,9 @@ config_version=4 config/name="TapTapTapTap" run/main_scene="res://Main.tscn" +boot_splash/image="res://Splash.png" +boot_splash/fullsize=false +boot_splash/bg_color=Color( 0, 0, 0, 1 ) config/icon="res://icon.png" [display] @@ -30,4 +33,5 @@ common/enable_pause_aware_picking=true quality/driver/driver_name="GLES2" vram_compression/import_etc=true vram_compression/import_etc2=false +environment/default_clear_color=Color( 0, 0, 0, 1 ) environment/default_environment="res://default_env.tres"