We will be updating our GameOver routine as follows. Let’s begin with blurring the ‘GameRoot’. Open ‘main.tscn’. Select ‘UILayer’. Set ‘Layer’ -> ‘Layer’ = 1. Select ‘UIRoot’. Add a ColorRect node. Rename it to ‘BlurOverlay’. With ‘BlurOverlay’ selected, set the…
Open the ‘game_over.tscn’ scene. Select the ‘GameOver’ node. Attach a script. Save the script as ‘game_over.gd’. Introduction
Create a new scene of type ‘Control’. Rename the ‘Control’ node to ‘GameOver’. Save the scene as ‘game_over.tscn’. Set Layout to ‘Full Rect’. Add a Control -> CenterContainer node to ‘GameOver’. Select the ‘CenterContainer’. Set Layout to ‘Full Rect’. Add…
Here we have a few ideas/examples of expanding and tweaking our Tetris game.
Before we do a test run, we have to set the ‘Main Scene’ in ‘Project Settings’. Now that we have set the ‘Main Scene’, then whenever we click the ‘Run Project’, the ‘main.tscn’ will be the master. Introduction
Open the ‘next_preview.gd’ script. We start by adding constants right after the ‘extends Node2D’ line. And then we add the ‘func update_preview()’ function. Now we need a function to show the next shape – ‘func _draw()’. This concludes the ‘next_preview.gd’…
Open the ‘main.gd’ script. We start by adding constants right after the ‘extends Node2D’ line. And then we add the ‘func _ready()’ and ‘_on_viewport_size_changed()’ functions. Now we add a function ‘func _on_lines_cleared()’ to update over scores. We add a function…
Open the ‘board.gd’ script. We start by adding constants right after the ‘extends Node2D’ line. Add a reset game function ‘func reset_game()’. Now we initialize the board. Add ‘func _ready()’ as follows. Now we add the new functions, starting with…
Create a new scene with type ‘Control’. Rename the ‘Control’ to ‘HUDRight’. Add a ‘VBoxContainer’ to ‘HUDRight’. Now add the following controls to the ‘VBoxContainer’ Layout Select the ‘HUDRight’ Node and set the layout to ‘Top Left’: Save the scene…
Create a new scene of type ‘Control’. Rename the ‘Control’ node to ‘HUDLeft’. Add a ‘VBoxContainer’ to ‘HUDLeft’. Now add the following controls to the ‘VBoxContainer’ Layout Select the ‘HUDLeft’ node and set the layout to ‘Center Left’: Save the…