mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-11 21:22:22 +02:00
Added Card Level Animation
This commit is contained in:
@@ -62,3 +62,5 @@ anchor_bottom = 0.87
|
||||
margin_left = 2.0
|
||||
margin_right = 0.0400085
|
||||
margin_bottom = -30.9
|
||||
|
||||
[editable path="GenericCard1"]
|
||||
|
||||
@@ -4,6 +4,8 @@ export var Item:PackedScene
|
||||
export var PreviewIcon:Texture
|
||||
export var DeleteOnGrab:bool = false
|
||||
|
||||
var card_level = 0
|
||||
|
||||
#if a drag is initiated here
|
||||
func get_drag_data(_pos):
|
||||
var ctrl = Control.new()
|
||||
@@ -19,13 +21,13 @@ func get_drag_data(_pos):
|
||||
return Item
|
||||
|
||||
|
||||
#stuff can be dropped here
|
||||
#eg you picked the wrong thing up, let go and it returns to nothingness
|
||||
# stuff can be dropped here
|
||||
# eg you picked the wrong thing up, let go and it returns to nothingness
|
||||
func can_drop_data(_pos, data):
|
||||
return typeof(data) == typeof(PackedScene)
|
||||
|
||||
|
||||
#do nothing if stuff is dropped here
|
||||
# do nothing if stuff is dropped here
|
||||
func drop_data(_pos, _data):
|
||||
pass
|
||||
|
||||
@@ -37,3 +39,13 @@ func get_resized_texture(t: Texture, width: int = 0, height: int = 0):
|
||||
var itex = ImageTexture.new()
|
||||
itex.create_from_image(image,0)
|
||||
return itex
|
||||
|
||||
|
||||
func upgrade_card():
|
||||
match card_level:
|
||||
0:
|
||||
$AnimatedSprite.play("lvl1")
|
||||
card_level += 1
|
||||
1:
|
||||
$AnimatedSprite.play("lvl2")
|
||||
card_level += 1
|
||||
|
||||
Reference in New Issue
Block a user