tetris
better colors
bendn 2022-08-18
parent 215ffac · commit 64b6e5e
-rw-r--r--Main.tscn4
-rw-r--r--Tetris.gd8
-rw-r--r--project.godot2
3 files changed, 11 insertions, 3 deletions
diff --git a/Main.tscn b/Main.tscn
index 748dc0e..6569835 100644
--- a/Main.tscn
+++ b/Main.tscn
@@ -18,7 +18,9 @@ margin_top = 10.0
margin_right = 170.0
margin_bottom = 310.0
script = ExtResource( 1 )
-colors = PoolColorArray( 0.811765, 0.176471, 0.176471, 1, 0.427451, 0.721569, 0.278431, 1, 0.156863, 0.270588, 0.709804, 1, 0.615686, 0.164706, 0.611765, 1, 0.717647, 0.713726, 0.282353, 1, 0.47451, 0.47451, 0.47451, 1, 0.835294, 0.588235, 0.113725, 1 )
+colors = PoolColorArray( 0.862745, 0.196078, 0.184314, 1, 0.521569, 0.6, 0, 1, 0.14902, 0.545098, 0.823529, 1, 0.423529, 0.443137, 0.768627, 1, 0.709804, 0.537255, 0, 1, 0.576471, 0.631373, 0.631373, 1, 0.164706, 0.631373, 0.596078, 1 )
+grid_color = Color( 0.933333, 0.909804, 0.835294, 1 )
+bg_color = Color( 0.992157, 0.964706, 0.890196, 1 )
[node name="SwipeDetector" type="Node" parent="."]
script = ExtResource( 2 )
diff --git a/Tetris.gd b/Tetris.gd
index 73a0dd7..92f6661 100644
--- a/Tetris.gd
+++ b/Tetris.gd
@@ -5,6 +5,8 @@ const ROWS = 20
const COLUMNS = 10
export(PoolColorArray) var colors
+export(Color) var grid_color
+export(Color) var bg_color
var current_shape: TetrisPiece
var matrix := Logic.create_matrix(ROWS, COLUMNS)
@@ -25,7 +27,7 @@ func init_squares():
var bg_square := ReferenceRect.new()
bg_square.editor_only = false
bg_square.border_width = 1.5
- bg_square.border_color = Color.ghostwhite
+ bg_square.border_color = grid_color
bg_square.name = "%d" % _i
expand_control(bg_square)
bg.add_child(bg_square)
@@ -54,6 +56,10 @@ func expand_control(c: Control) -> void:
func _ready() -> void:
+ var c = ColorRect.new()
+ expand_control(c)
+ c.color = bg_color
+ add_child(c)
set_process(false)
assert(len(colors) == Logic.shapes.size()) # 7
ratio = float(COLUMNS) / float(ROWS)
diff --git a/project.godot b/project.godot
index 4591f2c..8215ee2 100644
--- a/project.godot
+++ b/project.godot
@@ -82,4 +82,4 @@ quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
2d/snapping/use_gpu_pixel_snap=true
vram_compression/import_etc=true
-environment/default_clear_color=Color( 0.937255, 0.937255, 0.937255, 1 )
+environment/default_clear_color=Color( 0.992157, 0.964706, 0.890196, 1 )