Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added images to game #23

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Coin.png
Binary file not shown.
Binary file removed Goal-Flag.png
Binary file not shown.
Binary file removed card-background.png
Binary file not shown.
Binary file added images/Coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions images/Coin.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cw81ujlqwn7ri"
path="res://.godot/imported/Coin.png-1a1806c522c80e97612b78d38e7e9dfe.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/Coin.png"
dest_files=["res://.godot/imported/Coin.png-1a1806c522c80e97612b78d38e7e9dfe.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 added images/Goal-Flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions images/Goal-Flag.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cd8jrmswmd2ys"
path="res://.godot/imported/Goal-Flag.png-79217b11749d574f024ffbbc69c41b93.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/Goal-Flag.png"
dest_files=["res://.godot/imported/Goal-Flag.png-79217b11749d574f024ffbbc69c41b93.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 added images/card-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions images/card-background.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bg64jb42har7a"
path="res://.godot/imported/card-background.png-b08920060b5fa746c981c9a792f2beba.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/card-background.png"
dest_files=["res://.godot/imported/card-background.png-b08920060b5fa746c981c9a792f2beba.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
105 changes: 62 additions & 43 deletions scenes/card.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://cfjww0crklqqo"]
[gd_scene load_steps=4 format=3 uid="uid://cfjww0crklqqo"]

[ext_resource type="Script" path="res://scripts/card.gd" id="1_mhh1x"]
[ext_resource type="Texture2D" uid="uid://bg64jb42har7a" path="res://images/card-background.png" id="2_0subb"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kkgnu"]

[node name="Card" type="Control"]
layout_mode = 3
Expand All @@ -12,8 +15,10 @@ custom_minimum_size = Vector2(300, 40)
layout_mode = 0
offset_right = 300.0
offset_bottom = 450.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_kkgnu")

[node name="ColorRect" type="ColorRect" parent="Panel"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
Expand All @@ -22,47 +27,24 @@ grow_horizontal = 2
grow_vertical = 2
color = Color(0.498039, 0.0627451, 0.0588235, 0.823529)

[node name="MarginContainer" type="MarginContainer" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer"]
layout_mode = 2

[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
[node name="MarginContainer3" type="MarginContainer" parent="Panel"]
layout_mode = 2
offset_left = 29.0
offset_top = 70.0
offset_right = 309.0
offset_bottom = 240.0
scale = Vector2(0.88, 0.88)
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="NameLabel" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer"]
layout_mode = 2
text = "Card Name"
horizontal_alignment = 1

[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="ImageBG" type="ColorRect" parent="Panel/MarginContainer/VBoxContainer/MarginContainer2"]
[node name="ImageBG" type="ColorRect" parent="Panel/MarginContainer3"]
custom_minimum_size = Vector2(0, 150)
layout_mode = 2
mouse_filter = 1

[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer/MarginContainer2/ImageBG"]
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer3/ImageBG"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
Expand All @@ -74,62 +56,99 @@ theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5

[node name="TextureRect" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/MarginContainer2/ImageBG/MarginContainer"]
[node name="TextureRect" type="Sprite2D" parent="Panel/MarginContainer3/ImageBG/MarginContainer"]
position = Vector2(128, 69)
scale = Vector2(5, 5)

[node name="MarginContainer3" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
[node name="TextureRect" type="TextureRect" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_0subb")

[node name="MarginContainer2" type="MarginContainer" parent="Panel"]
layout_mode = 2
offset_left = 10.0
offset_top = 23.0
offset_right = 290.0
offset_bottom = 66.0
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="NameLabel" type="Label" parent="Panel/MarginContainer2"]
layout_mode = 2
text = "Card Name"
horizontal_alignment = 1

[node name="MarginContainer4" type="MarginContainer" parent="Panel"]
layout_mode = 2
offset_left = 37.0
offset_top = 211.0
offset_right = 263.0
offset_bottom = 254.0
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/VBoxContainer/MarginContainer3"]
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer4"]
layout_mode = 2

[node name="DirectionLabel" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer3/HBoxContainer"]
[node name="DirectionLabel" type="Label" parent="Panel/MarginContainer4/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
text = "Direction
"

[node name="Direction" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer3/HBoxContainer"]
[node name="Direction" type="Label" parent="Panel/MarginContainer4/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "100 Left"
horizontal_alignment = 2

[node name="MarginContainer4" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
[node name="MarginContainer5" type="MarginContainer" parent="Panel"]
layout_mode = 2
offset_left = 38.0
offset_top = 243.0
offset_right = 262.0
offset_bottom = 286.0
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/MarginContainer/VBoxContainer/MarginContainer4"]
[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/MarginContainer5"]
layout_mode = 2

[node name="MagnitudeLabel" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer4/HBoxContainer2"]
[node name="MagnitudeLabel" type="Label" parent="Panel/MarginContainer5/HBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 0
text = "Magnitude
"

[node name="Magnitude" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer4/HBoxContainer2"]
[node name="Magnitude" type="Label" parent="Panel/MarginContainer5/HBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 3
text = "1500"
horizontal_alignment = 2

[node name="MarginContainer5" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
[node name="MarginContainer6" type="MarginContainer" parent="Panel"]
layout_mode = 2
offset_left = 49.0
offset_top = 307.0
offset_right = 251.0
offset_bottom = 409.0
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10

[node name="CardTextLabel" type="Label" parent="Panel/MarginContainer/VBoxContainer/MarginContainer5"]
[node name="CardTextLabel" type="Label" parent="Panel/MarginContainer6"]
layout_mode = 2
text = "Card text
"
Expand Down
21 changes: 19 additions & 2 deletions scenes/goal.tscn
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
[gd_scene load_steps=3 format=3 uid="uid://2qx55xycwiyj"]
[gd_scene load_steps=4 format=3 uid="uid://2qx55xycwiyj"]

[ext_resource type="Script" path="res://scripts/goal.gd" id="1_tb4ru"]
[ext_resource type="Texture2D" uid="uid://cd8jrmswmd2ys" path="res://images/Goal-Flag.png" id="2_pmlf2"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_kflhe"]
size = Vector2(322, 194)
size = Vector2(41, 116)

[node name="Goal" type="Area2D"]
collision_layer = 2
collision_mask = 2
script = ExtResource("1_tb4ru")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(21, 58)
shape = SubResource("RectangleShape2D_kflhe")

[node name="ColorRect" type="ColorRect" parent="CollisionShape2D"]
visible = false
offset_left = -164.0
offset_top = -97.0
offset_right = 162.0
offset_bottom = 97.0
color = Color(0.101961, 0.909804, 0.223529, 1)

[node name="TextureRect" type="TextureRect" parent="CollisionShape2D"]
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -21.0
offset_top = -59.0
offset_right = -11.0
offset_bottom = -30.0
grow_horizontal = 2
grow_vertical = 0
scale = Vector2(4.04992, 4.04992)
texture = ExtResource("2_pmlf2")

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
19 changes: 18 additions & 1 deletion scenes/pickup.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://wwq2q8wuiqk4"]
[gd_scene load_steps=4 format=3 uid="uid://wwq2q8wuiqk4"]

[ext_resource type="Script" path="res://scripts/pickup.gd" id="1_j50a6"]
[ext_resource type="Texture2D" uid="uid://cw81ujlqwn7ri" path="res://images/Coin.png" id="2_mqwnv"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qiyrp"]
size = Vector2(138, 140)
Expand All @@ -16,6 +17,7 @@ scale = Vector2(0.323864, 0.323864)
shape = SubResource("RectangleShape2D_qiyrp")

[node name="ColorRect" type="ColorRect" parent="CollisionShape2D"]
visible = false
offset_left = -68.0
offset_top = -69.0
offset_right = 68.0
Expand All @@ -24,4 +26,19 @@ size_flags_horizontal = 4
color = Color(0.964706, 0.886275, 0.498039, 1)
metadata/_edit_use_anchors_ = true

[node name="TextureRect" type="TextureRect" parent="CollisionShape2D"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -69.4191
offset_top = -70.3121
offset_right = -60.4191
offset_bottom = -61.3121
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(15.594, 15.594)
texture = ExtResource("2_mqwnv")

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
10 changes: 5 additions & 5 deletions scripts/card.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extends Control

@onready var NameLabel = $Panel/MarginContainer/VBoxContainer/MarginContainer/NameLabel
@onready var CardImage = $Panel/MarginContainer/VBoxContainer/MarginContainer2/ImageBG/MarginContainer/TextureRect
@onready var Direction = $Panel/MarginContainer/VBoxContainer/MarginContainer3/HBoxContainer/Direction
@onready var Magnitude = $Panel/MarginContainer/VBoxContainer/MarginContainer4/HBoxContainer2/Magnitude
@onready var CardText = $Panel/MarginContainer/VBoxContainer/MarginContainer5/CardTextLabel
@onready var NameLabel = $Panel/MarginContainer2/NameLabel
@onready var CardImage = $Panel/MarginContainer3/ImageBG/MarginContainer/TextureRect
@onready var Direction = $Panel/MarginContainer4/HBoxContainer/Direction
@onready var Magnitude = $Panel/MarginContainer5/HBoxContainer2/Magnitude
@onready var CardText = $Panel/MarginContainer6/CardTextLabel
@onready var Hovered = false
@onready var Selected = false

Expand Down
2 changes: 1 addition & 1 deletion scripts/character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ func _physics_process(delta):
if velocity.x <0:
Sprite.animation = "default_left"
else:
Sprite.animation = "default"
Sprite.animation = "default"