diff --git a/project.godot b/project.godot index d87b7ae..e4031f9 100644 --- a/project.godot +++ b/project.godot @@ -10,8 +10,9 @@ config_version=5 [application] -config/name="GmtkGameJam2024" +config/name="Texpand" config/description="Submission for the GMTK Game jam 2024. Tetris with special Blocks that expands" +config/version="0.1.1" config/tags=PackedStringArray("game_jam") run/main_scene="res://scenes/Main/main.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") @@ -29,6 +30,7 @@ window/size/viewport_width=1080 window/size/viewport_height=1280 window/stretch/mode="viewport" window/stretch/aspect="expand" +window/stretch/scale=0.5 window/handheld/orientation=1 [editor] @@ -111,8 +113,5 @@ textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" textures/vram_compression/import_etc2_astc=true -anti_aliasing/quality/msaa_2d=1 -anti_aliasing/quality/msaa_3d=1 -anti_aliasing/quality/screen_space_aa=1 anti_aliasing/quality/use_taa=true anti_aliasing/quality/use_debanding=true diff --git a/scenes/Grid/grid.gd b/scenes/Grid/grid.gd index ea26574..be21a52 100644 --- a/scenes/Grid/grid.gd +++ b/scenes/Grid/grid.gd @@ -7,7 +7,6 @@ extends Node2D @onready var turnTickTimer = $TurnTick @onready var loseArea = $LoseArea @onready var gameTimer = $GameTimer -@onready var coyoteTimer = $CoyoteTimer var nextBlocks = [] @@ -186,6 +185,7 @@ func getNewPatterns(): newPatterns[0].type = GLOBAL.BLOCKTYPES.HEAVY newPatterns.shuffle() newPatterns[0].expand = true + newPatterns.shuffle() patternsArray.append_array(newPatterns) @@ -204,16 +204,25 @@ func _on_turn_tick_timeout() -> void: turnBlocks() func _on_ticker_timeout() -> void: - stopped = true + if getBlockedDirection(GLOBAL.Direction.BOTTOM, GLOBAL.currentUID): - coyoteTimer.start(0.08) - + + stopped = true + test() + for i in getBlockGroupsList(): moveUidGroup(GLOBAL.Direction.BOTTOM, i) - - tickerTimer.start(blockSpeed) - stopped = false + + if not stopped: + tickerTimer.start(blockSpeed) + stopped = false + elif stopped: + if loseArea.get_overlapping_areas() != []: + GLOBAL.lose() + tickerTimer.start(GLOBAL.minSpeed) + stopped = false + func _on_game_timer_timeout() -> void: @@ -224,72 +233,47 @@ func _on_game_timer_timeout() -> void: gameTimer.start(1) -func _on_coyote_timer_timeout() -> void: - if loseArea.get_overlapping_areas() != []: - GLOBAL.lose() +func test(): for i in $RowTests.get_children(): for j in getBlockGroupsList(): if j != GLOBAL.currentUID: moveUidGroup(GLOBAL.Direction.BOTTOM, i) stopped = true + var previousPosition = currentPattern.position if currentPattern.expand: if currentPattern.get_scale() != Vector2(2,2): + + #currentPattern.position.y -= 64 for i in getBlockGroupsList()[GLOBAL.currentUID]: + print(i.name) if i.turningPoint: currentPattern.set_scale(Vector2(2,2)) - currentPattern.moveToPosition(i.global_position-spawnpoint.position - Vector2(64,64*4)) - #if await currentPattern.getCollidingBorder() != []: - for i in await currentPattern.getCollidingBorder(): - #if i.is_in_group("Floor"): - #for j in range(1,3): - #if not await currentPattern.getCollidingBorder() == []: - #break - #currentPattern.position.y -= 64 - if i.is_in_group("LeftBorder"): - for j in range(1,8): + currentPattern.moveToPosition(i.global_position-spawnpoint.position) + #currentPattern.position.x - 64 + #if i.is_in_group("Block"): + + for j in await currentPattern.getCollidingBorder(): + if j.is_in_group("Floor"): + currentPattern.position.y -= GLOBAL.GRID if await currentPattern.getCollidingBorder() == []: - break - currentPattern.position.x += 64 - elif i.is_in_group("RightBorder"): - for j in range(1,8): - if await currentPattern.getCollidingBorder() == []: - break - currentPattern.position.x -= 64 - #for i in range(1,8): - #print(await currentPattern.getCollidingBorder()) - #if await currentPattern.getCollidingBorder() == []: - #break - #currentPattern.position.x -= 64 - #currentPattern.position.x = 0 - #for i in range(1,8): - #if await currentPattern.getCollidingBorder() == []: - #break - #currentPattern.position.x += 64 - #if await currentPattern.getCollidingBorder() != []: - #currentPattern.position.y += 64 + break + if j.is_in_group("LeftBorder"): + for s in range(1,7): + currentPattern.position.x += GLOBAL.GRID + if await currentPattern.getCollidingBorder() == []: + break + elif j.is_in_group("RightBorder"): + for s in range(1,7): + currentPattern.position.x -= GLOBAL.GRID + if await currentPattern.getCollidingBorder() == []: + break - #if await currentPattern.getCollidingBorder() != []: - #currentPattern.position.x -= 64 - for i in getBlockGroupsList()[GLOBAL.currentUID].size(): - getBlockGroupsList()[GLOBAL.currentUID][i].global_position = currentPattern.getPositions()[i].global_position - Vector2(GLOBAL.GRID, GLOBAL.GRID) - getBlockGroupsList()[GLOBAL.currentUID][i].set_scale(Vector2(2,2)) + if await currentPattern.getCollidingBorder() == []: + for i in getBlockGroupsList()[GLOBAL.currentUID].size(): + getBlockGroupsList()[GLOBAL.currentUID][i].global_position = currentPattern.getPositions()[i].global_position - Vector2(GLOBAL.GRID, GLOBAL.GRID) + getBlockGroupsList()[GLOBAL.currentUID][i].set_scale(Vector2(2,2)) for i in await currentPattern.getCollidingBlocks(): i.queue_free() - #for i in blocks.get_children(): - #if i.get_scale() != Vector2(2,2): - #i.set_scale(Vector2(2,2)) - #i.move(-64,-64) - #var turningPointBlock - #for g in currentPattern.getPositions().size(): - #if not getBlockGroupsList()[GLOBAL.currentUID][g].turningPoint: - #getBlockGroupsList()[GLOBAL.currentUID][g].global_position = currentPattern.getPositions()[g].global_position- Vector2(32,32) - #else: - #turningPointBlock = getBlockGroupsList()[GLOBAL.currentUID][g] - #for g in currentPattern.getPositions(): - #if g.turningPoint: - #turningPointBlock.global_position = g.global_position- Vector2(32,32) - #if i.turningPoint: - #currentPattern.global_position = i.global_position- Vector2(32,32) for i in $RowTests.get_children(): if i.isCompleted(): @@ -297,12 +281,14 @@ func _on_coyote_timer_timeout() -> void: splitOphansUID(j.UID) if j.expand: GLOBAL.points += j.type * 2 - GLOBAL.time += j.type * 2 + GLOBAL.time += j.type * 4 elif not j.expand: GLOBAL.points += j.type - GLOBAL.time += j.type + GLOBAL.time += j.type * 2 j.queue_free() for j in getBlockGroupsList(): if j != GLOBAL.currentUID: moveUidGroup(GLOBAL.Direction.BOTTOM, j) + + PlacePattern() diff --git a/scenes/Grid/grid.tscn b/scenes/Grid/grid.tscn index 5d5bc9b..3dfa540 100644 --- a/scenes/Grid/grid.tscn +++ b/scenes/Grid/grid.tscn @@ -119,13 +119,13 @@ one_shot = true [node name="Border" parent="Borders" groups=["LeftBorder"] instance=ExtResource("4_3j08q")] -[node name="CollisionShape2D" parent="Borders/Border" index="0"] +[node name="CollisionShape2D" parent="Borders/Border" index="0" groups=["LeftBorder"]] position = Vector2(-64, 512) shape = SubResource("RectangleShape2D_flipi") [node name="Border2" parent="Borders" groups=["RightBorder"] instance=ExtResource("4_3j08q")] -[node name="CollisionShape2D" parent="Borders/Border2" index="0"] +[node name="CollisionShape2D" parent="Borders/Border2" index="0" groups=["RightBorder"]] position = Vector2(704, 512) shape = SubResource("RectangleShape2D_flipi") @@ -285,9 +285,6 @@ action_mode = 0 icon = ExtResource("14_i1yud") icon_alignment = 1 -[node name="CoyoteTimer" type="Timer" parent="."] -one_shot = true - [connection signal="timeout" from="Ticker" to="." method="_on_ticker_timeout"] [connection signal="timeout" from="TurnTick" to="." method="_on_turn_tick_timeout"] [connection signal="timeout" from="GameTimer" to="." method="_on_game_timer_timeout"] @@ -297,7 +294,6 @@ one_shot = true [connection signal="pressed" from="Camera2D/CanvasLayer/Control/HBoxContainer4/rotate_right_Button" to="Camera2D/CanvasLayer/Control" method="_on_rotate_right_button_pressed"] [connection signal="button_down" from="Camera2D/CanvasLayer/Control/HBoxContainer5/down_Button" to="Camera2D/CanvasLayer/Control" method="_on_down_button_button_down"] [connection signal="button_up" from="Camera2D/CanvasLayer/Control/HBoxContainer5/down_Button" to="Camera2D/CanvasLayer/Control" method="_on_down_button_button_up"] -[connection signal="timeout" from="CoyoteTimer" to="." method="_on_coyote_timer_timeout"] [editable path="Borders/Border"] [editable path="Borders/Border2"] diff --git a/scenes/Grid/row_test.gd b/scenes/Grid/row_test.gd index bd467f7..e6806ac 100644 --- a/scenes/Grid/row_test.gd +++ b/scenes/Grid/row_test.gd @@ -16,7 +16,6 @@ func isCompleted(): amount += 2 else: amount += 1 - if amount >= 10: return true else: