diff --git a/Main.gd b/Main.gd index 98a7b8d..bed8f6a 100644 --- a/Main.gd +++ b/Main.gd @@ -9,6 +9,8 @@ const TetroS = preload("res://Tetrominos/TetroS.tscn") const TetroT = preload("res://Tetrominos/TetroT.tscn") const TetroZ = preload("res://Tetrominos/TetroZ.tscn") +const password = "TETRIS 3000" + const NEXT_POSITION = Vector3(13, 16, 0) const START_POSITION = Vector3(5, 20, 0) const HOLD_POSITION = Vector3(-5, 16, 0) @@ -33,6 +35,27 @@ var playing = true signal piece_dropped(score) signal piece_locked(lines, t_spin) +func _ready(): + load_user_data() + new_game() + +func load_user_data(): + var save_game = File.new() + if not save_game.file_exists("user://data.save"): + $Stats.high_score = 0 + else: + save_game.open_encrypted_with_pass("user://data.save", File.READ, password) + $Stats.high_score = int(save_game.get_line()) + $Stats/HBC/VBC1/HighScore.text = str($Stats.high_score) + save_game.close() + +func new_game(): + $Stats.visible = true + next_piece = random_piece() + new_piece() + $Stats.new_game() + resume() + func random_piece(): if not random_bag: random_bag = [ @@ -44,16 +67,6 @@ func random_piece(): random_bag.remove(choice) add_child(piece) return piece - -func _ready(): - new_game() - -func new_game(): - $Stats.visible = true - next_piece = random_piece() - new_piece() - $Stats.new_game() - resume() func new_piece(): current_piece = next_piece @@ -73,7 +86,7 @@ func _process(delta): if Input.is_action_just_pressed("pause"): if playing: pause() - else: + elif $controls_ui.enable_resume: resume() if playing: for action in movements: @@ -168,33 +181,33 @@ func resume(): $Stats/Clock.start() $MidiPlayer.mute_channels($MidiPlayer.LINE_CLEAR_MIDI_CHANNELS) $MidiPlayer.resume() - $GridMap.visible = true - next_piece.visible = true - current_piece.visible = true - if held_piece: - held_piece.visible = true + $controls_ui.visible = false -func pause(text = "PAUSE"): +func pause(show_controls_ui=true): playing = false $DropTimer.stop() $LockDelay.stop() $Stats/Clock.stop() - if text == "PAUSE": - $Stats.time = OS.get_system_time_secs() - $Stats.time - $GridMap.visible = false - next_piece.visible = false - current_piece.visible = false - if held_piece: - held_piece.visible = false + if show_controls_ui: + $controls_ui.visible = true $MidiPlayer.stop() - $FlashText.print(text) func game_over(): - pause("GAME OVER") + pause(false) func _notification(what): - if what == MainLoop.NOTIFICATION_WM_FOCUS_OUT: - pause() + match what: + MainLoop.NOTIFICATION_WM_FOCUS_OUT: + pause() + MainLoop.NOTIFICATION_WM_QUIT_REQUEST: + save_user_data() + + +func save_user_data(): + var save_game = File.new() + save_game.open_encrypted_with_pass("user://data.save", File.WRITE, password) + save_game.store_line(str($Stats.high_score)) + save_game.close() func _on_Stats_level_up(): $DropTimer.wait_time = pow(0.8 - (($Stats.level - 1) * 0.007), $Stats.level - 1) diff --git a/Main.tscn b/Main.tscn index d84b2d7..4d85c20 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://starmap_g8k.jpg" type="Texture" id=1] [ext_resource path="res://Main.gd" type="Script" id=2] @@ -6,9 +6,10 @@ [ext_resource path="res://GridMap.gd" type="Script" id=4] [ext_resource path="res://midi/MidiPlayer.tscn" type="PackedScene" id=5] [ext_resource path="res://MidiPlayer.gd" type="Script" id=6] -[ext_resource path="res://Stats.tscn" type="PackedScene" id=7] -[ext_resource path="res://FlashText.gd" type="Script" id=8] -[ext_resource path="res://fonts/525-ROUN.TTF" type="DynamicFontData" id=9] +[ext_resource path="res://FlashText.gd" type="Script" id=7] +[ext_resource path="res://fonts/525-ROUN.TTF" type="DynamicFontData" id=8] +[ext_resource path="res://Stats.tscn" type="PackedScene" id=9] +[ext_resource path="res://controls.tscn" type="PackedScene" id=10] [sub_resource type="PanoramaSky" id=1] @@ -172,7 +173,7 @@ subdivide_depth = 0 size = 50 use_mipmaps = true use_filter = false -font_data = ExtResource( 9 ) +font_data = ExtResource( 8 ) _sections_unfolded = [ "Font", "Settings" ] [sub_resource type="Animation" id=7] @@ -374,6 +375,8 @@ autostart = false script = ExtResource( 6 ) file = "res://midi/Tetris - Song A.mid" +volume_db = -12 +loop = true loop_start = 1.81 soundfont = "res://midi/TimGM6mb.sf2" @@ -384,25 +387,23 @@ wait_time = 1.41 one_shot = true autostart = false -[node name="Stats" parent="." index="11" instance=ExtResource( 7 )] +[node name="FlashText" type="Control" parent="." index="11"] -visible = false - -[node name="FlashText" type="Control" parent="." index="12"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 500.0 -margin_bottom = 500.0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -250.0 +margin_top = -250.0 +margin_right = 250.0 +margin_bottom = 250.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 -script = ExtResource( 8 ) +script = ExtResource( 7 ) [node name="Label" type="Label" parent="FlashText" index="0"] @@ -440,6 +441,14 @@ anims/Flash = SubResource( 7 ) blend_times = [ ] _sections_unfolded = [ "Playback Options" ] +[node name="Stats" parent="." index="12" instance=ExtResource( 9 )] + +visible = false + +[node name="controls_ui" parent="." index="13" instance=ExtResource( 10 )] + +visible = false + [connection signal="piece_dropped" from="." to="Stats" method="_on_Main_piece_dropped"] [connection signal="piece_locked" from="." to="Stats" method="_on_Main_piece_locked"] @@ -456,10 +465,10 @@ _sections_unfolded = [ "Playback Options" ] [connection signal="timeout" from="MidiPlayer/LineCLearTimer" to="MidiPlayer" method="_on_LineCLearTimer_timeout"] +[connection signal="animation_finished" from="FlashText/AnimationPlayer" to="FlashText" method="_on_AnimationPlayer_animation_finished"] + [connection signal="flash_text" from="Stats" to="FlashText" method="_on_Stats_flash_text"] [connection signal="level_up" from="Stats" to="." method="_on_Stats_level_up"] -[connection signal="animation_finished" from="FlashText/AnimationPlayer" to="FlashText" method="_on_AnimationPlayer_animation_finished"] - diff --git a/Stats.gd b/Stats.gd index ffd6b7f..0fa000b 100644 --- a/Stats.gd +++ b/Stats.gd @@ -1,7 +1,5 @@ extends MarginContainer -const password = "TETRIS 3000" - const SCORES = [ [0, 4, 1], [1, 8, 2], @@ -21,16 +19,6 @@ var combos signal flash_text(text) signal level_up - -func _ready(): - var save_game = File.new() - if not save_game.file_exists("user://high_score.save"): - high_score = 0 - else: - save_game.open_encrypted_with_pass("user://high_score.save", File.READ, password) - high_score = int(save_game.get_line()) - $HBC/VBC1/HighScore.text = str(high_score) - save_game.close() func new_game(): level = 0 @@ -55,15 +43,6 @@ func _on_Clock_timeout(): var hours = int(time_elapsed/3600) $HBC/VBC1/Time.text = str(hours) + ":%02d"%minutes + ":%02d"%seconds - -func _notification(what): - if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: - var save_game = File.new() - save_game.open_encrypted_with_pass("user://high_score.save", File.WRITE, password) - save_game.store_line(str(high_score)) - save_game.close() - get_tree().quit() - func _on_Main_piece_dropped(ds): score += ds $HBC/VBC1/Score.text = str(score) diff --git a/Tetrominos/Mino/Mino.tscn b/Tetrominos/Mino/Mino.tscn index 0754a35..3faf6d0 100644 --- a/Tetrominos/Mino/Mino.tscn +++ b/Tetrominos/Mino/Mino.tscn @@ -162,7 +162,7 @@ subdivide_width = 0 subdivide_height = 0 subdivide_depth = 0 -[node name="Mino" type="Spatial"] +[node name="Mino" type="Spatial" index="0"] transform = Transform( 0.997027, 0, 0, 0, 0.997027, 0, 0, 0, 0.997027, 0, 0, 0 ) _sections_unfolded = [ "Pause", "Transform", "Visibility" ] diff --git a/Tetrominos/Mino/MinoMaterial.tres b/Tetrominos/Mino/MinoMaterial.tres index 2184b7f..5d25470 100644 --- a/Tetrominos/Mino/MinoMaterial.tres +++ b/Tetrominos/Mino/MinoMaterial.tres @@ -1,6 +1,4 @@ -[gd_resource type="SpatialMaterial" load_steps=2 format=2] - -[ext_resource path="res://Tetrominos/Mino/glass.jpg" type="Texture" id=1] +[gd_resource type="SpatialMaterial" format=2] [resource] @@ -28,7 +26,6 @@ params_use_alpha_scissor = false albedo_color = Color( 0.601563, 0.775878, 1, 0.162157 ) metallic = 1.0 metallic_specular = 1.0 -metallic_texture = ExtResource( 1 ) metallic_texture_channel = 4 roughness = 0.46 roughness_texture_channel = 0 diff --git a/Tetrominos/Mino/glass.jpg b/Tetrominos/Mino/glass.jpg deleted file mode 100644 index 102394e..0000000 Binary files a/Tetrominos/Mino/glass.jpg and /dev/null differ diff --git a/Tetrominos/Mino/glass.jpg.import b/Tetrominos/Mino/glass.jpg.import deleted file mode 100644 index 45d71f0..0000000 --- a/Tetrominos/Mino/glass.jpg.import +++ /dev/null @@ -1,30 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path.s3tc="res://.import/glass.jpg-80b6305d22902972419fc8ecbe408eb8.s3tc.stex" -path.etc2="res://.import/glass.jpg-80b6305d22902972419fc8ecbe408eb8.etc2.stex" - -[deps] - -source_file="res://Tetrominos/Mino/glass.jpg" -dest_files=[ "res://.import/glass.jpg-80b6305d22902972419fc8ecbe408eb8.s3tc.stex", "res://.import/glass.jpg-80b6305d22902972419fc8ecbe408eb8.etc2.stex" ] - -[params] - -compress/mode=2 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/normal_map=0 -flags/repeat=true -flags/filter=true -flags/mipmaps=true -flags/anisotropic=false -flags/srgb=1 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/controls.gd b/controls.gd new file mode 100644 index 0000000..4e2b17b --- /dev/null +++ b/controls.gd @@ -0,0 +1,116 @@ +extends Control + +# Note for the reader: +# +# This demo conveniently uses the same names for actions and for the container nodes +# that hold each remapping button. This allow to get back to the button based simply +# on the name of the corresponding action, but it might not be so simple in your project. +# +# A better approach for large-scale input remapping might be to do the connections between +# buttons and wait_for_input through the code, passing as arguments both the name of the +# action and the node, e.g.: +# button.connect("pressed", self, "wait_for_input", [ button, action ]) + +# Constants +const INPUT_ACTIONS = [ + "move_left", + "move_right", + "rotate_clockwise", + "rotate_counterclockwise", + "soft_drop", + "hard_drop", + "hold", + "pause" +] +const CONFIG_FILE = "user://input.cfg" + +# Member variables +var action # To register the action the UI is currently handling +var button # Button node corresponding to the above action +var enable_resume = true + + +# Load/save input mapping to a config file +# Changes done while testing the demo will be persistent, saved to CONFIG_FILE + +func load_config(): + var config = ConfigFile.new() + var err = config.load(CONFIG_FILE) + if err: # Assuming that file is missing, generate default config + for action_name in INPUT_ACTIONS: + var action_list = InputMap.get_action_list(action_name) + # There could be multiple actions in the list, but we save the first one by default + var scancode = OS.get_scancode_string(action_list[0].scancode) + config.set_value("input", action_name, scancode) + config.save(CONFIG_FILE) + else: # ConfigFile was properly loaded, initialize InputMap + for action_name in config.get_section_keys("input"): + # Get the key scancode corresponding to the saved human-readable string + var scancode = OS.find_scancode_from_string(config.get_value("input", action_name)) + # Create a new event object based on the saved scancode + var event = InputEventKey.new() + event.scancode = scancode + # Replace old action (key) events by the new one + for old_event in InputMap.get_action_list(action_name): + if old_event is InputEventKey: + InputMap.action_erase_event(action_name, old_event) + InputMap.action_add_event(action_name, event) + + +func save_to_config(section, key, value): + """Helper function to redefine a parameter in the settings file""" + var config = ConfigFile.new() + var err = config.load(CONFIG_FILE) + if err: + print("Error code when loading config file: ", err) + else: + config.set_value(section, key, value) + config.save(CONFIG_FILE) + + +# Input management + +func wait_for_input(action_bind): + action = action_bind + # See note at the beginning of the script + button = get_node("bindings").get_node(action).get_node("Button") + #get_node("contextual_help").text = "Press a key to assign to the '" + action + "' action." + enable_resume = false + set_process_input(true) + + +func _input(event): + # Handle the first pressed key + if event is InputEventKey: + # Register the event as handled and stop polling + get_tree().set_input_as_handled() + set_process_input(false) + # Reinitialise the contextual help label + #get_node("contextual_help").text = "Click a key binding to reassign it, or press the Cancel action." + + # Display the string corresponding to the pressed key + var scancode = OS.get_scancode_string(event.scancode) + button.text = scancode + # Start by removing previously key binding(s) + for old_event in InputMap.get_action_list(action): + InputMap.action_erase_event(action, old_event) + # Add the new key binding + InputMap.action_add_event(action, event) + save_to_config("input", action, scancode) + enable_resume = true + + +func _ready(): + # Load config if existing, if not it will be generated with default values + load_config() + # Initialise each button with the default key binding from InputMap + for action in INPUT_ACTIONS: + # We assume that the key binding that we want is the first one (0), if there are several + var input_event = InputMap.get_action_list(action)[0] + # See note at the beginning of the script + var button = get_node("bindings").get_node(action).get_node("Button") + button.text = OS.get_scancode_string(input_event.scancode) + button.connect("pressed", self, "wait_for_input", [action]) + + # Do not start processing input until a button is pressed + set_process_input(false) diff --git a/controls.tscn b/controls.tscn new file mode 100644 index 0000000..cb564ca --- /dev/null +++ b/controls.tscn @@ -0,0 +1,634 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://controls.gd" type="Script" id=1] +[ext_resource path="res://fonts/525-ROUN.TTF" type="DynamicFontData" id=2] +[ext_resource path="res://fonts/Gamer.ttf" type="DynamicFontData" id=3] + +[sub_resource type="DynamicFont" id=1] + +size = 30 +use_mipmaps = false +use_filter = false +font_data = ExtResource( 2 ) +_sections_unfolded = [ "Font", "Settings" ] + +[sub_resource type="DynamicFont" id=2] + +size = 20 +use_mipmaps = true +use_filter = false +extra_spacing_top = -4 +extra_spacing_bottom = -4 +font_data = ExtResource( 3 ) +_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ] + +[sub_resource type="DynamicFont" id=3] + +size = 20 +use_mipmaps = false +use_filter = false +extra_spacing_top = -4 +font_data = ExtResource( 3 ) +_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ] + +[node name="controls_ui" type="Control" index="0"] + +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -30.0 +margin_top = 10.0 +margin_right = 10.0 +margin_bottom = 50.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +script = ExtResource( 1 ) +__meta__ = { +"__editor_plugin_screen__": "2D" +} + +[node name="ColorRect" type="ColorRect" parent="." index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = -2990.0 +margin_top = -1560.0 +margin_right = 2720.0 +margin_bottom = 1060.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +color = Color( 0.0816994, 0.0912621, 0.115234, 1 ) + +[node name="pause" type="Label" parent="." index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = -40.0 +margin_top = -150.0 +margin_right = 110.0 +margin_bottom = -111.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 1 ) +custom_colors/font_color = Color( 0.443137, 0.709804, 0.819608, 1 ) +text = "PAUSE" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 +_sections_unfolded = [ "custom_colors", "custom_fonts" ] + +[node name="bindings" type="Control" parent="." index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = -190.0 +margin_top = -130.0 +margin_right = -150.0 +margin_bottom = -90.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="move_left" type="Control" parent="bindings" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 50.0 +margin_top = 50.0 +margin_right = 90.0 +margin_bottom = 90.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/move_left" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 69.0 +margin_bottom = 29.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "move +left" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 +_sections_unfolded = [ "Rect", "custom_fonts" ] + +[node name="Button" type="Button" parent="bindings/move_left" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 80.0 +margin_right = 150.0 +margin_bottom = 37.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 +_sections_unfolded = [ "Rect" ] + +[node name="move_right" type="Control" parent="bindings" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 226.0 +margin_top = 51.0 +margin_right = 266.0 +margin_bottom = 91.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/move_right" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 5.0 +margin_top = -1.0 +margin_right = 80.0 +margin_bottom = 31.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "move +right" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/move_right" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 84.0 +margin_top = -1.0 +margin_right = 154.0 +margin_bottom = 36.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + +[node name="rotate_clockwise" type="Control" parent="bindings" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 50.0 +margin_top = 100.0 +margin_right = 90.0 +margin_bottom = 140.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/rotate_clockwise" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 118.0 +margin_bottom = 32.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "rotate +clockwise" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/rotate_clockwise" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 80.0 +margin_right = 150.0 +margin_bottom = 37.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + +[node name="rotate_counterclockwise" type="Control" parent="bindings" index="3"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 226.0 +margin_top = 101.0 +margin_right = 266.0 +margin_bottom = 141.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/rotate_counterclockwise" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 5.0 +margin_top = -2.0 +margin_right = 177.0 +margin_bottom = 37.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "rotate +counter +clockwise" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/rotate_counterclockwise" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 84.0 +margin_top = -1.0 +margin_right = 154.0 +margin_bottom = 36.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 +_sections_unfolded = [ "Rect" ] + +[node name="soft_drop" type="Control" parent="bindings" index="4"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 50.0 +margin_top = 150.0 +margin_right = 90.0 +margin_bottom = 190.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/soft_drop" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 66.0 +margin_bottom = 32.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "soft +drop" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/soft_drop" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 80.0 +margin_right = 150.0 +margin_bottom = 37.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + +[node name="hard_drop" type="Control" parent="bindings" index="5"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 226.0 +margin_top = 151.0 +margin_right = 266.0 +margin_bottom = 191.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/hard_drop" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 5.0 +margin_top = -1.0 +margin_right = 75.0 +margin_bottom = 31.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "hard +drop" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/hard_drop" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 84.0 +margin_top = -1.0 +margin_right = 154.0 +margin_bottom = 36.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + +[node name="hold" type="Control" parent="bindings" index="6"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 50.0 +margin_top = 200.0 +margin_right = 90.0 +margin_bottom = 240.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/hold" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 55.0 +margin_bottom = 25.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "hold" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="Button" type="Button" parent="bindings/hold" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 80.0 +margin_right = 150.0 +margin_bottom = 37.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + +[node name="pause" type="Control" parent="bindings" index="7"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 226.0 +margin_top = 201.0 +margin_right = 266.0 +margin_bottom = 241.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 + +[node name="Label" type="Label" parent="bindings/pause" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 5.0 +margin_top = 3.0 +margin_right = 106.0 +margin_bottom = 35.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "pause +resume" +valign = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 +_sections_unfolded = [ "custom_fonts" ] + +[node name="Button" type="Button" parent="bindings/pause" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 84.0 +margin_top = -1.0 +margin_right = 154.0 +margin_bottom = 36.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +custom_fonts/font = SubResource( 3 ) +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +flat = false +align = 1 + + diff --git a/fonts/impact.ttf b/fonts/impact.ttf deleted file mode 100644 index 2675688..0000000 Binary files a/fonts/impact.ttf and /dev/null differ diff --git a/impact.ttf b/impact.ttf deleted file mode 100644 index 2675688..0000000 Binary files a/impact.ttf and /dev/null differ diff --git a/project.godot b/project.godot index a1fd6f3..ac76d69 100644 --- a/project.godot +++ b/project.godot @@ -25,33 +25,19 @@ theme/use_hidpi=true [input] -hold=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":4,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":5,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null) +hold=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) ] -pause=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777244,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777225,"unicode":0,"echo":false,"script":null) +pause=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) ] -hard_drop=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777238,"unicode":0,"echo":false,"script":null) +hard_drop=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777238,"unicode":0,"echo":false,"script":null) ] move_left=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) ] -soft_drop=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) +soft_drop=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) ] move_right=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) ] -rotate_clockwise=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":88,"unicode":0,"echo":false,"script":null) +rotate_clockwise=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) ] -rotate_counterclockwise=[ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null) +rotate_counterclockwise=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) ]