Cards
This commit is contained in:
parent
01457fcb1f
commit
621bcf75cb
10 changed files with 164 additions and 0 deletions
12
cards/card-resource.gd
Normal file
12
cards/card-resource.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extends Resource
|
||||
|
||||
class_name CardResource
|
||||
|
||||
@export_group("Gameplay")
|
||||
@export_range(0,1,1,"or_greater","prefer_slider") var cost: int
|
||||
@export var spawned_unit: PackedScene
|
||||
|
||||
@export_group("Visual")
|
||||
@export var preview: Texture2D
|
||||
@export var experimental: bool = false
|
||||
@export var background: Texture2D = preload("uid://c6akwwb58fidc")
|
||||
1
cards/card-resource.gd.uid
Normal file
1
cards/card-resource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bmc0rqt8jb8vh
|
||||
11
cards/card.gd
Normal file
11
cards/card.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends TextureRect
|
||||
|
||||
class_name Card
|
||||
|
||||
@export var card_resource: CardResource
|
||||
|
||||
func _ready() -> void:
|
||||
$UnitPreview.texture = card_resource.preview
|
||||
texture = card_resource.background
|
||||
$CostBubble/Cost.text = str(card_resource.cost)
|
||||
$ExperimentalBadge.visible = card_resource.experimental
|
||||
1
cards/card.gd.uid
Normal file
1
cards/card.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://o4ebkeu2kt8v
|
||||
68
cards/card.tscn
Normal file
68
cards/card.tscn
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
[gd_scene format=3 uid="uid://dl3ve6prnn2m6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6akwwb58fidc" path="res://cards/templates/card-background.png" id="1_ivai2"]
|
||||
[ext_resource type="Script" uid="uid://o4ebkeu2kt8v" path="res://cards/card.gd" id="2_jsqqk"]
|
||||
[ext_resource type="Texture2D" uid="uid://du3h8ou2sxh6s" path="res://units/fosma/fosma.png" id="2_nwofj"]
|
||||
[ext_resource type="Texture2D" uid="uid://c3p3hl0epd5rg" path="res://cards/templates/cost-bubble.png" id="3_4k7q8"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5vvxpoic7glj" path="res://cards/templates/experimental.png" id="4_f61jr"]
|
||||
|
||||
[node name="Card" type="TextureRect" unique_id=267582807]
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.098000005
|
||||
anchor_bottom = 0.261
|
||||
offset_right = -72.896
|
||||
offset_bottom = -129.128
|
||||
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("1_ivai2")
|
||||
script = ExtResource("2_jsqqk")
|
||||
|
||||
[node name="UnitPreview" type="TextureRect" parent="." unique_id=696212558]
|
||||
layout_mode = 0
|
||||
offset_left = 12.0
|
||||
offset_top = 17.0
|
||||
offset_right = 103.0
|
||||
offset_bottom = 80.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("2_nwofj")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="CostBubble" type="TextureRect" parent="." unique_id=1170497941]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -32.0
|
||||
offset_top = -34.0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 6.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("3_4k7q8")
|
||||
|
||||
[node name="Cost" type="Label" parent="CostBubble" unique_id=1845152885]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ExperimentalBadge" type="TextureRect" parent="." unique_id=1894619027]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -26.0
|
||||
offset_top = -7.0
|
||||
offset_right = 14.0
|
||||
offset_bottom = 33.0
|
||||
grow_horizontal = 0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("4_f61jr")
|
||||
10
cards/resources/doh.tres
Normal file
10
cards/resources/doh.tres
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[gd_resource type="Resource" script_class="CardResource" format=3 uid="uid://djqlx7bmcs5gj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6akwwb58fidc" path="res://cards/templates/card-background.png" id="1_mxvf2"]
|
||||
[ext_resource type="Script" uid="uid://bmc0rqt8jb8vh" path="res://cards/card-resource.gd" id="2_61y7x"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwggofu5iv0xt" path="res://units/doh/doh.png" id="2_m3011"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_61y7x")
|
||||
preview = ExtResource("2_m3011")
|
||||
metadata/_custom_type_script = "uid://bmc0rqt8jb8vh"
|
||||
11
cards/resources/fosma.tres
Normal file
11
cards/resources/fosma.tres
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="CardResource" format=3 uid="uid://e7kiu3wcf0ff"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6akwwb58fidc" path="res://cards/templates/card-background.png" id="1_j3bxo"]
|
||||
[ext_resource type="Script" uid="uid://bmc0rqt8jb8vh" path="res://cards/card-resource.gd" id="2_r84ts"]
|
||||
[ext_resource type="Texture2D" uid="uid://du3h8ou2sxh6s" path="res://units/fosma/fosma.png" id="2_uc1ms"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_r84ts")
|
||||
cost = 1
|
||||
preview = ExtResource("2_uc1ms")
|
||||
metadata/_custom_type_script = "uid://bmc0rqt8jb8vh"
|
||||
12
cards/resources/zlosma.tres
Normal file
12
cards/resources/zlosma.tres
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_resource type="Resource" script_class="CardResource" format=3 uid="uid://b6kiwb0marpng"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cke1t56bw70kq" path="res://cards/templates/dev-card-background.png" id="1_ongak"]
|
||||
[ext_resource type="Script" uid="uid://bmc0rqt8jb8vh" path="res://cards/card-resource.gd" id="2_ongak"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctc3mk7gm68ha" path="res://units/zlosma/zlosma.png" id="2_xu3vf"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_ongak")
|
||||
preview = ExtResource("2_xu3vf")
|
||||
experimental = true
|
||||
background = ExtResource("1_ongak")
|
||||
metadata/_custom_type_script = "uid://bmc0rqt8jb8vh"
|
||||
|
|
@ -11,6 +11,7 @@ config_version=5
|
|||
[application]
|
||||
|
||||
config/name="nsomva"
|
||||
run/main_scene="uid://bxt4kgs6px3t8"
|
||||
config/features=PackedStringArray("4.6", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ config/icon="res://icon.svg"
|
|||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
rendering_device/driver.windows="d3d12"
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
|
|
|
|||
36
scenes/game.tscn
Normal file
36
scenes/game.tscn
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[gd_scene format=3 uid="uid://bxt4kgs6px3t8"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b2pm032d5tqwb" path="res://sprites/field.png" id="1_iywne"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl3ve6prnn2m6" path="res://cards/card.tscn" id="2_p57ef"]
|
||||
[ext_resource type="Resource" uid="uid://e7kiu3wcf0ff" path="res://cards/resources/fosma.tres" id="3_u5sy4"]
|
||||
[ext_resource type="Resource" uid="uid://djqlx7bmcs5gj" path="res://cards/resources/doh.tres" id="4_gee14"]
|
||||
[ext_resource type="Resource" uid="uid://b6kiwb0marpng" path="res://cards/resources/zlosma.tres" id="5_0tnpc"]
|
||||
|
||||
[node name="Game" type="Node2D" unique_id=619820575]
|
||||
|
||||
[node name="Field" type="Sprite2D" parent="." unique_id=1104378711]
|
||||
texture = ExtResource("1_iywne")
|
||||
centered = false
|
||||
|
||||
[node name="PlayerInterface" type="CanvasLayer" parent="." unique_id=269857956]
|
||||
|
||||
[node name="Card" parent="." unique_id=267582807 instance=ExtResource("2_p57ef")]
|
||||
offset_left = 401.0
|
||||
offset_top = 466.0
|
||||
offset_right = 514.0
|
||||
offset_bottom = 635.0
|
||||
card_resource = ExtResource("3_u5sy4")
|
||||
|
||||
[node name="Card2" parent="." unique_id=1229293312 instance=ExtResource("2_p57ef")]
|
||||
offset_left = 544.0
|
||||
offset_top = 467.0
|
||||
offset_right = 657.0
|
||||
offset_bottom = 636.0
|
||||
card_resource = ExtResource("4_gee14")
|
||||
|
||||
[node name="Card3" parent="." unique_id=1907397406 instance=ExtResource("2_p57ef")]
|
||||
offset_left = 698.0
|
||||
offset_top = 471.0
|
||||
offset_right = 811.0
|
||||
offset_bottom = 640.0
|
||||
card_resource = ExtResource("5_0tnpc")
|
||||
Loading…
Add table
Add a link
Reference in a new issue