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