Added Graphic for Blocks

This commit is contained in:
Exobyt 2024-08-20 15:48:20 +02:00
parent 71cbf96618
commit b9eec60df7
21 changed files with 92 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
assets/Blocks/Block.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

View file

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dbspjkdc5q1mc" uid="uid://cbuxv7iwn0qm7"
path="res://.godot/imported/Slider.png-7121d2749dc259e03f67f754efc5d0ba.ctex" path="res://.godot/imported/Block.png-dcf5528a11c1628113d2eec1a93bd74f.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/Slider.png" source_file="res://assets/Blocks/Block.png"
dest_files=["res://.godot/imported/Slider.png-7121d2749dc259e03f67f754efc5d0ba.ctex"] dest_files=["res://.godot/imported/Block.png-dcf5528a11c1628113d2eec1a93bd74f.ctex"]
[params] [params]

BIN
assets/Blocks/Block.pxo Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

View file

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dvhykprtl45q0" uid="uid://jmobplsqdy6o"
path="res://.godot/imported/RightArrow.png-a32550768e227e9d644da82207d67585.ctex" path="res://.godot/imported/ExpandBlock.png-c20e6105dd462191195e28d023c6a989.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/RightArrow.png" source_file="res://assets/Blocks/ExpandBlock.png"
dest_files=["res://.godot/imported/RightArrow.png-a32550768e227e9d644da82207d67585.ctex"] dest_files=["res://.godot/imported/ExpandBlock.png-c20e6105dd462191195e28d023c6a989.ctex"]
[params] [params]

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

View file

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://blj4h34gr3s0q" uid="uid://dni2qahrw2p0k"
path="res://.godot/imported/SpeedScale.png-1c213110fe8f036530597123ee8887de.ctex" path="res://.godot/imported/SpecialBlock.png-2d9edbd26e098195201fe888d943ee5e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/SpeedScale.png" source_file="res://assets/Blocks/SpecialBlock.png"
dest_files=["res://.godot/imported/SpeedScale.png-1c213110fe8f036530597123ee8887de.ctex"] dest_files=["res://.godot/imported/SpecialBlock.png-2d9edbd26e098195201fe888d943ee5e.ctex"]
[params] [params]

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://13wfksnp806p"
path="res://.godot/imported/SpecialExpandedBlock.png-fbf379fd3cb609cf5368abeca92c5a89.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Blocks/SpecialExpandedBlock.png"
dest_files=["res://.godot/imported/SpecialExpandedBlock.png-fbf379fd3cb609cf5368abeca92c5a89.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

View file

@ -28,7 +28,7 @@ GLOBAL="*res://scenes/Globals/global.gd"
window/size/viewport_width=1080 window/size/viewport_width=1080
window/size/viewport_height=1280 window/size/viewport_height=1280
window/stretch/mode="viewport" window/stretch/mode="canvas_items"
window/stretch/aspect="expand" window/stretch/aspect="expand"
window/handheld/orientation=1 window/handheld/orientation=1

View file

@ -5,6 +5,11 @@ extends Area2D
@onready var raycastRight = $RaycastRight @onready var raycastRight = $RaycastRight
@onready var raycastTop = $RaycastTop @onready var raycastTop = $RaycastTop
@onready var spriteBlock = $Block
@onready var spriteSpecialBlock = $SpecialBlock
@onready var spriteExpandBlock = $ExpandBlock
@onready var spriteSpecialExpandedBlock = $SpecialExpandedBlock
@export var UID = 1 @export var UID = 1
var secretPosition = Vector2() var secretPosition = Vector2()
@ -56,3 +61,16 @@ func moveLeft():
move(-64, 0) move(-64, 0)
func moveRight(): func moveRight():
move(64, 0) move(64, 0)
func setlook():
match type:
GLOBAL.BLOCKTYPES.LIGHT:
if expand:
spriteExpandBlock.show()
else:
spriteBlock.show()
GLOBAL.BLOCKTYPES.HEAVY:
if expand:
spriteSpecialExpandedBlock.show()
else:
spriteSpecialBlock.show()

View file

@ -1,6 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://do8gr42oq2a0y"] [gd_scene load_steps=9 format=3 uid="uid://do8gr42oq2a0y"]
[ext_resource type="Script" path="res://scenes/Blocks/block.gd" id="1_t1hpt"] [ext_resource type="Script" path="res://scenes/Blocks/block.gd" id="1_t1hpt"]
[ext_resource type="Texture2D" uid="uid://cbuxv7iwn0qm7" path="res://assets/Blocks/Block.png" id="2_dyhpk"]
[ext_resource type="Texture2D" uid="uid://dni2qahrw2p0k" path="res://assets/Blocks/SpecialBlock.png" id="3_do2c5"]
[ext_resource type="Texture2D" uid="uid://jmobplsqdy6o" path="res://assets/Blocks/ExpandBlock.png" id="4_c0a60"]
[ext_resource type="Texture2D" uid="uid://13wfksnp806p" path="res://assets/Blocks/SpecialExpandedBlock.png" id="5_nea42"]
[sub_resource type="QuadMesh" id="QuadMesh_lsuac"] [sub_resource type="QuadMesh" id="QuadMesh_lsuac"]
@ -16,6 +20,7 @@ collision_mask = 14
script = ExtResource("1_t1hpt") script = ExtResource("1_t1hpt")
[node name="MeshInstance2D" type="MeshInstance2D" parent="."] [node name="MeshInstance2D" type="MeshInstance2D" parent="."]
visible = false
position = Vector2(31, 31) position = Vector2(31, 31)
scale = Vector2(62, 62) scale = Vector2(62, 62)
mesh = SubResource("QuadMesh_lsuac") mesh = SubResource("QuadMesh_lsuac")
@ -58,3 +63,23 @@ collision_layer = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(32, 32) position = Vector2(32, 32)
shape = SubResource("RectangleShape2D_ti23g") shape = SubResource("RectangleShape2D_ti23g")
[node name="Block" type="Sprite2D" parent="."]
visible = false
position = Vector2(32, 32)
texture = ExtResource("2_dyhpk")
[node name="SpecialBlock" type="Sprite2D" parent="."]
visible = false
position = Vector2(32, 32)
texture = ExtResource("3_do2c5")
[node name="ExpandBlock" type="Sprite2D" parent="."]
visible = false
position = Vector2(32, 32)
texture = ExtResource("4_c0a60")
[node name="SpecialExpandedBlock" type="Sprite2D" parent="."]
visible = false
position = Vector2(32, 32)
texture = ExtResource("5_nea42")

View file

@ -175,6 +175,7 @@ func PlacePattern():
if i.turningPoint: if i.turningPoint:
block.turningPoint = true block.turningPoint = true
blocks.add_child(block) blocks.add_child(block)
block.setlook()
func getNewPatterns(): func getNewPatterns():