spell_holder
parent
e70e005230
commit
feef84ebbe
|
@ -22,7 +22,7 @@ script = ExtResource( 2 )
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
frame = 2
|
frame = 1
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ visible = false
|
||||||
position = Vector2( 11, 2 )
|
position = Vector2( 11, 2 )
|
||||||
frames = ExtResource( 5 )
|
frames = ExtResource( 5 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
|
frame = 1
|
||||||
playing = true
|
playing = true
|
||||||
|
|
||||||
[node name="AudioGetDamage" type="AudioStreamPlayer" parent="."]
|
[node name="AudioGetDamage" type="AudioStreamPlayer" parent="."]
|
||||||
|
|
|
@ -26,7 +26,7 @@ var spells = [
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Global.playing = true
|
Global.playing = true
|
||||||
Global.play_time = 55.0
|
Global.play_time = 59.0
|
||||||
Global.health = 5
|
Global.health = 5
|
||||||
Global.add_health(0)
|
Global.add_health(0)
|
||||||
|
|
||||||
|
@ -66,6 +66,6 @@ func _physics_process(delta):
|
||||||
|
|
||||||
func select_card():
|
func select_card():
|
||||||
if selected_card != null:
|
if selected_card != null:
|
||||||
$"../Center/SpellHolder".add_modifier(spells[selected_modifier])
|
$"UIWrapper/UI/Center/SpellHolder".add_modifier(spells[selected_modifier], selected_modifier)
|
||||||
Global.playing = true
|
Global.playing = true
|
||||||
$UIWrapper/UI/Cards.visible = false
|
$UIWrapper/UI/Cards.visible = false
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
var cell_preload = preload("res://src/models/spell_cell/SpellCell.tscn")
|
var cell_preload = preload("res://src/models/spell_cell/SpellCell.tscn")
|
||||||
|
var icon_preload = preload("res://src/spell_icons/SpellIcon.tscn")
|
||||||
var modifiers = []
|
var modifiers = []
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
@ -9,5 +10,11 @@ func _ready():
|
||||||
spell_cell.rect_position.x += i * (14 + 2)
|
spell_cell.rect_position.x += i * (14 + 2)
|
||||||
self.add_child(spell_cell)
|
self.add_child(spell_cell)
|
||||||
|
|
||||||
func add_modifier(spell_name):
|
func add_modifier(spell_name, selected_modifier):
|
||||||
modifiers.append(spell_name)
|
modifiers.append(spell_name)
|
||||||
|
var spell_icon = icon_preload.instance()
|
||||||
|
spell_icon.frame = selected_modifier
|
||||||
|
spell_icon.global_position.x += 7 + (modifiers.size() - 1) * (14 + 2)
|
||||||
|
spell_icon.global_position.y += 7
|
||||||
|
self.add_child(spell_icon)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue