Compare commits
2 commits
66314ebe4c
...
99ee97c0c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 99ee97c0c1 | |||
| bf4739f238 |
4 changed files with 28 additions and 5 deletions
14
ground.gdshader
Normal file
14
ground.gdshader
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
shader_type spatial;
|
||||||
|
|
||||||
|
uniform vec2 dims;
|
||||||
|
uniform vec3 light_color : source_color;
|
||||||
|
uniform vec3 dark_color : source_color;
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec2 p = UV*dims/2.0;
|
||||||
|
if (round(mod(p.x,1)) == round(mod(p.y,1))) {
|
||||||
|
ALBEDO = light_color;
|
||||||
|
} else {
|
||||||
|
ALBEDO = dark_color;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
ground.gdshader.uid
Normal file
1
ground.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://c7e17bwc7nrgt
|
||||||
15
main.tscn
15
main.tscn
|
|
@ -1,9 +1,10 @@
|
||||||
[gd_scene load_steps=10 format=3 uid="uid://lrk2whqxl0w0"]
|
[gd_scene load_steps=11 format=3 uid="uid://lrk2whqxl0w0"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c707s0tgd88pg" path="res://main.gd" id="1_ig7tw"]
|
[ext_resource type="Script" uid="uid://c707s0tgd88pg" path="res://main.gd" id="1_ig7tw"]
|
||||||
[ext_resource type="Texture2D" uid="uid://crahyipmcudoy" path="res://ui/undo.png" id="3_lquwl"]
|
[ext_resource type="Texture2D" uid="uid://crahyipmcudoy" path="res://ui/undo.png" id="3_lquwl"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dyj5el5iro1cb" path="res://ui/redo.png" id="4_7mycd"]
|
[ext_resource type="Texture2D" uid="uid://dyj5el5iro1cb" path="res://ui/redo.png" id="4_7mycd"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cbb1q0usxd6ex" path="res://ui/restart.png" id="5_272bh"]
|
[ext_resource type="Texture2D" uid="uid://cbb1q0usxd6ex" path="res://ui/restart.png" id="5_272bh"]
|
||||||
|
[ext_resource type="Shader" uid="uid://c7e17bwc7nrgt" path="res://ground.gdshader" id="5_lquwl"]
|
||||||
|
|
||||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_1bvp3"]
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_1bvp3"]
|
||||||
sky_top_color = Color(0.467272, 0.753409, 0.87431, 1)
|
sky_top_color = Color(0.467272, 0.753409, 0.87431, 1)
|
||||||
|
|
@ -19,11 +20,15 @@ background_mode = 2
|
||||||
sky = SubResource("Sky_lquwl")
|
sky = SubResource("Sky_lquwl")
|
||||||
tonemap_mode = 2
|
tonemap_mode = 2
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1bvp3"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lquwl"]
|
||||||
albedo_color = Color(0.250136, 0.493198, 0.284902, 1)
|
render_priority = 0
|
||||||
|
shader = ExtResource("5_lquwl")
|
||||||
|
shader_parameter/dims = Vector2(64, 64)
|
||||||
|
shader_parameter/light_color = Color(0.321254, 0.470959, 0.199863, 1)
|
||||||
|
shader_parameter/dark_color = Color(0.308333, 0.451677, 0.191453, 1)
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_1bvp3"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_1bvp3"]
|
||||||
material = SubResource("StandardMaterial3D_1bvp3")
|
material = SubResource("ShaderMaterial_lquwl")
|
||||||
size = Vector2(64, 64)
|
size = Vector2(64, 64)
|
||||||
|
|
||||||
[node name="Main" type="Node3D"]
|
[node name="Main" type="Node3D"]
|
||||||
|
|
@ -100,7 +105,7 @@ horizontal_alignment = 1
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="Ground" type="MeshInstance3D" parent="."]
|
[node name="Ground" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.01, 0)
|
||||||
mesh = SubResource("PlaneMesh_1bvp3")
|
mesh = SubResource("PlaneMesh_1bvp3")
|
||||||
|
|
||||||
[connection signal="pressed" from="UndoButton" to="." method="undo"]
|
[connection signal="pressed" from="UndoButton" to="." method="undo"]
|
||||||
|
|
|
||||||
3
piece.gd
3
piece.gd
|
|
@ -94,6 +94,9 @@ func do_move(move: Vector2i) -> Callable:
|
||||||
func undo_move() -> Callable:
|
func undo_move() -> Callable:
|
||||||
var old_pos := lpos
|
var old_pos := lpos
|
||||||
return func():
|
return func():
|
||||||
|
for tween in tweens:
|
||||||
|
tween.kill()
|
||||||
|
position = target_pos()
|
||||||
lpos = old_pos
|
lpos = old_pos
|
||||||
tween_to_target()
|
tween_to_target()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue