From 1d164601ba291b5e6a2de724cb4662a6316e4d7a Mon Sep 17 00:00:00 2001 From: Paul Norberger Date: Mon, 20 Apr 2020 01:42:36 +0200 Subject: [PATCH 1/4] Added banana animation --- src/Menus/DragNDrop/DragNDropUI.tscn | 7 +- src/Objects/Banana/Banana.gd | 8 +++ src/Objects/Banana/Banana.tscn | 74 ++++++++++++++++++--- src/Objects/Banana/Bannana.gd | 5 -- src/Objects/Banana/animation.png | Bin 0 -> 3937 bytes src/Objects/Banana/animation.png.import | 34 ++++++++++ src/Objects/Banana/icon.png | Bin 0 -> 380 bytes src/Objects/Banana/icon.png.import | 34 ++++++++++ src/Objects/Banana/mouse_follow.png | Bin 0 -> 386 bytes src/Objects/Banana/mouse_follow.png.import | 34 ++++++++++ src/Objects/Traps/Spike.tscn | 3 +- src/Objects/Traps/Sting.tscn | 3 +- 12 files changed, 184 insertions(+), 18 deletions(-) create mode 100644 src/Objects/Banana/Banana.gd delete mode 100644 src/Objects/Banana/Bannana.gd create mode 100644 src/Objects/Banana/animation.png create mode 100644 src/Objects/Banana/animation.png.import create mode 100644 src/Objects/Banana/icon.png create mode 100644 src/Objects/Banana/icon.png.import create mode 100644 src/Objects/Banana/mouse_follow.png create mode 100644 src/Objects/Banana/mouse_follow.png.import diff --git a/src/Menus/DragNDrop/DragNDropUI.tscn b/src/Menus/DragNDrop/DragNDropUI.tscn index 52f2bde..a8e07b1 100644 --- a/src/Menus/DragNDrop/DragNDropUI.tscn +++ b/src/Menus/DragNDrop/DragNDropUI.tscn @@ -1,13 +1,14 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://Menus/DragNDrop/DragSource.tscn" type="PackedScene" id=1] [ext_resource path="res://Menus/DragNDrop/DragSink.tscn" type="PackedScene" id=2] [ext_resource path="res://Objects/Banana/Banana.tscn" type="PackedScene" id=3] -[ext_resource path="res://testSprites/bannane.png" type="Texture" id=4] +[ext_resource path="res://Objects/Banana/icon.png" type="Texture" id=4] [ext_resource path="res://Objects/Traps/Bear/bear.jpg" type="Texture" id=5] [ext_resource path="res://Objects/Traps/bear.tscn" type="PackedScene" id=6] [ext_resource path="res://Objects/Traps/Bear/Animation/0012.png" type="Texture" id=7] [ext_resource path="res://Menus/DragNDrop/DragNDropUI.gd" type="Script" id=8] +[ext_resource path="res://Objects/Banana/mouse_follow.png" type="Texture" id=9] [node name="DragNDropUI" type="Control"] anchor_right = 1.0 @@ -26,7 +27,7 @@ margin_right = 43.9239 margin_bottom = 252.793 texture = ExtResource( 4 ) Item = ExtResource( 3 ) -PreviewIcon = ExtResource( 4 ) +PreviewIcon = ExtResource( 9 ) [node name="GenericCard2" parent="." instance=ExtResource( 1 )] margin_left = 69.0145 diff --git a/src/Objects/Banana/Banana.gd b/src/Objects/Banana/Banana.gd new file mode 100644 index 0000000..3bfd32c --- /dev/null +++ b/src/Objects/Banana/Banana.gd @@ -0,0 +1,8 @@ +extends AnimatedSprite + +func _ready(): + play("place") + + +func _on_Hurtbox_area_entered(area): + queue_free() diff --git a/src/Objects/Banana/Banana.tscn b/src/Objects/Banana/Banana.tscn index 4e28045..ea62b8f 100644 --- a/src/Objects/Banana/Banana.tscn +++ b/src/Objects/Banana/Banana.tscn @@ -1,25 +1,83 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=20 format=2] [ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] -[ext_resource path="res://testSprites/bannane.png" type="Texture" id=3] +[ext_resource path="res://Objects/Banana/Banana.gd" type="Script" id=2] +[ext_resource path="res://Objects/Banana/animation.png" type="Texture" id=3] [ext_resource path="res://Overlap/Kind.tscn" type="PackedScene" id=4] +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 3 ) +region = Rect2( 0, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 3 ) +region = Rect2( 40, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 3 ) +region = Rect2( 80, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 3 ) +region = Rect2( 120, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=6] +atlas = ExtResource( 3 ) +region = Rect2( 160, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=7] +atlas = ExtResource( 3 ) +region = Rect2( 200, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=8] +atlas = ExtResource( 3 ) +region = Rect2( 240, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=9] +atlas = ExtResource( 3 ) +region = Rect2( 280, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=10] +atlas = ExtResource( 3 ) +region = Rect2( 320, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=11] +atlas = ExtResource( 3 ) +region = Rect2( 360, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=12] +atlas = ExtResource( 3 ) +region = Rect2( 400, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=13] +atlas = ExtResource( 3 ) +region = Rect2( 440, 0, 40, 40 ) + +[sub_resource type="AtlasTexture" id=14] +atlas = ExtResource( 3 ) +region = Rect2( 480, 0, 40, 40 ) + +[sub_resource type="SpriteFrames" id=15] +animations = [ { +"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ], +"loop": false, +"name": "place", +"speed": 60.0 +} ] + [sub_resource type="CapsuleShape2D" id=1] radius = 7.54726 height = 12.1493 -[node name="Banana" type="Node2D"] +[node name="Banana" type="AnimatedSprite"] +frames = SubResource( 15 ) +animation = "place" script = ExtResource( 2 ) [node name="Kind" parent="." instance=ExtResource( 4 )] general = 2 kind = 10 -[node name="Sprite" type="Sprite" parent="."] -position = Vector2( 1.54256, -4.73786 ) -texture = ExtResource( 3 ) - [node name="Hurtbox" parent="." instance=ExtResource( 1 )] position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 diff --git a/src/Objects/Banana/Bannana.gd b/src/Objects/Banana/Bannana.gd deleted file mode 100644 index 92da9f6..0000000 --- a/src/Objects/Banana/Bannana.gd +++ /dev/null @@ -1,5 +0,0 @@ -extends Node2D - - -func _on_Hurtbox_area_entered(area): - queue_free() diff --git a/src/Objects/Banana/animation.png b/src/Objects/Banana/animation.png new file mode 100644 index 0000000000000000000000000000000000000000..7a652e75591cf9298732955e629343ae4db049d2 GIT binary patch literal 3937 zcmV-n51#OeP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#tvMj4^g#R-N51~K;!EgXUglFL4`%`uAvmbX~ zN7&)+SpA@@04Ylmq}6&Gtvx(+=qQs9{rNmT@A=X9^~YHGj{Y{D z%8#20L&Cd!zP9su&y(@`^9IxJ`1*Z3+5XPczZ3mf`8%P+%CQIkZsDL|Q^1Y<|{2?B-KI8fI@k{>h^?vX9 zL^ri1($&5}{Rr{>#D$A=%6nVmY5Y|_+xr|m`!krA6yv>=UF03>Vr7*50-*8Cw^))PE*(5J$O*&cpS|RF-4W}tSZ8I=Tv;-cf${Ip z^yk3;_4(UG_Xf>#j$~$ebH!^3ezA=}E?&6`K=S?Ow7&Vx>GSsd`N%H|mCGW{odD;v zK2xlke{xG+oaL#BOZE9sKAV3hAVsWQ*-RD?cv_a4TYjt*%b7fO@R{tqh?WHcxu#m2 zT^1E-fYVE?%{`XiYfCMkVdMoMsx&d688QJ&wQ8f@Iux3zO4V9xt5$m*bv9|*YHQ6} z=+rbZwQ9}Gx(%CMy7t;zx8D2cbCe;-SWTl18-0v1CyP#<%r&`wGO)^$rK_&CZ1pwP z+|Xz1uDfm9eUCl8xHuA!yt#Sz;q&AJm5!cz+OgBmIP=1_D_3v5?b_{k-1!e`UsQib z?N8+XXVmf+wekWL*V#|h7&iMcMGiTsffa6I_J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^Zv}3II6hcn=jdr6n)BYqISjl4-s55hFfdp( zE$I?1gk$-`ARJr(0#gyEY&F6b!m<2e5RR@G1||m~uKa*eeB0HCTk!rF9PK13vChj$nWTLk4RYn01|lG~7YI56^dBx;!vs zum*uy)Hy)Q=k0Vf-v$=92N*I~7%=2kqjL`OPVdM!{z8)grT{Dq7)`6`bdENCr(^m4 zT3yJW7Y1hSR)adn@N<~V@V;BJI9(MgFnq8sFq@2lkUX7X`R+bA3Zw%AgC%S=)w4;< z-48#-LHPzYt&)L(!K!hNC1#WSPKQr%tz&6E4Ko^GlrxM97O5sR7M!iznx3o00000NkvXXu0mjf;UJKY literal 0 HcmV?d00001 diff --git a/src/Objects/Banana/animation.png.import b/src/Objects/Banana/animation.png.import new file mode 100644 index 0000000..438ce94 --- /dev/null +++ b/src/Objects/Banana/animation.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation.png-1da805c2da35e7e6c661d9596a57f750.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Banana/animation.png" +dest_files=[ "res://.import/animation.png-1da805c2da35e7e6c661d9596a57f750.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/Objects/Banana/icon.png b/src/Objects/Banana/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..84912be987e485356822040a694ab6d580635c8d GIT binary patch literal 380 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEoCO|{#Xy=7jQv%QTmv#xszM@4 zoQqNuOY(~t7&vAY`<(Rm3N7%__S6k3@b&ig)zf5SaI9iGmsKTt6sZ26r;B4qMC;q> zcli!0aJUuT{Jr03cjWA;D{C57h|gORdD+KS@I(8Hf(Y-4@-r%1kNax+FTJkBKO@KS zpIx32>&}mPO5Oonf1g@;wLLJfT=cPNYe3%YX7Sr+5^|S06}hC#_85B^ONNkLxRE6)z4*}Q$iB}FOZr5 literal 0 HcmV?d00001 diff --git a/src/Objects/Banana/icon.png.import b/src/Objects/Banana/icon.png.import new file mode 100644 index 0000000..7ef22b2 --- /dev/null +++ b/src/Objects/Banana/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-9dc4caad05920b6cd30b7c767b233c2a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Banana/icon.png" +dest_files=[ "res://.import/icon.png-9dc4caad05920b6cd30b7c767b233c2a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/Objects/Banana/mouse_follow.png b/src/Objects/Banana/mouse_follow.png new file mode 100644 index 0000000000000000000000000000000000000000..740f0054ac5a0b50a965e3a4a2a7a6c273239823 GIT binary patch literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEoCO|{#Xy=7jQv%QTmv#xszM@4 zoQqNuOY(~t7&vAY`<(Rm3N7%__S6k3@b&ig)zf5SaI9iGmsKTt6sVWQ)5S3)qV?_c z-GWU40mjW}@&uXoln|EDHV`EhaPza~`h{rcK)#nkxA+ZQjD&pW66F7(&@rMA&%dP;2{ dtK)|9d+mREmpIK=SqBV122WQ%mvv4FO#r8>o2&o; literal 0 HcmV?d00001 diff --git a/src/Objects/Banana/mouse_follow.png.import b/src/Objects/Banana/mouse_follow.png.import new file mode 100644 index 0000000..c784602 --- /dev/null +++ b/src/Objects/Banana/mouse_follow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/mouse_follow.png-999aae3065fa4a723899678a470caab4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Banana/mouse_follow.png" +dest_files=[ "res://.import/mouse_follow.png-999aae3065fa4a723899678a470caab4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/Objects/Traps/Spike.tscn b/src/Objects/Traps/Spike.tscn index 8991297..2ab999c 100644 --- a/src/Objects/Traps/Spike.tscn +++ b/src/Objects/Traps/Spike.tscn @@ -1,10 +1,11 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] +[ext_resource path="res://Objects/Banana/Banana.gd" type="Script" id=2] [ext_resource path="res://testSprites/Spike.png" type="Texture" id=3] [ext_resource path="res://Overlap/Kind.tscn" type="PackedScene" id=4] + [sub_resource type="CapsuleShape2D" id=1] height = 6.36237 diff --git a/src/Objects/Traps/Sting.tscn b/src/Objects/Traps/Sting.tscn index f640195..a55bc66 100644 --- a/src/Objects/Traps/Sting.tscn +++ b/src/Objects/Traps/Sting.tscn @@ -1,10 +1,11 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] +[ext_resource path="res://Objects/Banana/Banana.gd" type="Script" id=2] [ext_resource path="res://testSprites/Sting.png" type="Texture" id=3] [ext_resource path="res://Overlap/Kind.tscn" type="PackedScene" id=4] + [sub_resource type="CapsuleShape2D" id=1] radius = 6.77597 height = 6.36237 From 1be1aede4f4c41e750927743ac08dc9dd6781821 Mon Sep 17 00:00:00 2001 From: Paul Norberger Date: Mon, 20 Apr 2020 01:42:54 +0200 Subject: [PATCH 2/4] Changed up bear trap speed to 90FPS --- src/Objects/Traps/bear.tscn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Objects/Traps/bear.tscn b/src/Objects/Traps/bear.tscn index 1191996..a6867b3 100644 --- a/src/Objects/Traps/bear.tscn +++ b/src/Objects/Traps/bear.tscn @@ -36,7 +36,7 @@ [ext_resource path="res://Objects/Traps/Bear/Animation/0009.png" type="Texture" id=35] [ext_resource path="res://Objects/Traps/Bear/Animation/0012.png" type="Texture" id=36] -[sub_resource type="SpriteFrames" id=4] +[sub_resource type="SpriteFrames" id=1] animations = [ { "frames": [ ExtResource( 12 ), ExtResource( 7 ), ExtResource( 28 ), ExtResource( 11 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 29 ), ExtResource( 24 ), ExtResource( 15 ), ExtResource( 35 ), ExtResource( 13 ), ExtResource( 22 ) ], "loop": false, @@ -46,7 +46,7 @@ animations = [ { "frames": [ ExtResource( 30 ), ExtResource( 10 ), ExtResource( 23 ), ExtResource( 27 ), ExtResource( 31 ), ExtResource( 6 ), ExtResource( 25 ), ExtResource( 19 ), ExtResource( 26 ), ExtResource( 32 ), ExtResource( 16 ), ExtResource( 21 ), ExtResource( 8 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 20 ), ExtResource( 33 ), ExtResource( 34 ) ], "loop": false, "name": "clap", -"speed": 60.0 +"speed": 90.0 }, { "frames": [ ExtResource( 36 ) ], "loop": false, @@ -54,7 +54,7 @@ animations = [ { "speed": 60.0 } ] -[sub_resource type="CapsuleShape2D" id=5] +[sub_resource type="CapsuleShape2D" id=2] height = 9.0 [sub_resource type="CapsuleShape2D" id=3] @@ -68,14 +68,14 @@ kind = 10 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] position = Vector2( -7.62939e-06, 0 ) -frames = SubResource( 4 ) +frames = SubResource( 1 ) [node name="Hitbox" parent="." instance=ExtResource( 2 )] collision_layer = 16 [node name="CollisionShape2D" parent="Hitbox" index="0"] rotation = 1.5708 -shape = SubResource( 5 ) +shape = SubResource( 2 ) [node name="Hurtbox" parent="." instance=ExtResource( 5 )] collision_layer = 32 From 0b930fd1c6b5e494ed6cf8c3b0705cb7617c7925 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 20 Apr 2020 12:37:12 +0200 Subject: [PATCH 3/4] Added Level Indicators to Cards --- src/Menus/DragNDrop/DragSource.gd | 15 +++++++----- src/Menus/DragNDrop/DragSource.tscn | 30 ++++++++++++++++++++++-- src/Objects/Card/level0.png | Bin 0 -> 137 bytes src/Objects/Card/level0.png.import | 34 ++++++++++++++++++++++++++++ src/Objects/Card/level1.png | Bin 0 -> 142 bytes src/Objects/Card/level1.png.import | 34 ++++++++++++++++++++++++++++ src/Objects/Card/level2.png | Bin 0 -> 123 bytes src/Objects/Card/level2.png.import | 34 ++++++++++++++++++++++++++++ 8 files changed, 139 insertions(+), 8 deletions(-) create mode 100644 src/Objects/Card/level0.png create mode 100644 src/Objects/Card/level0.png.import create mode 100644 src/Objects/Card/level1.png create mode 100644 src/Objects/Card/level1.png.import create mode 100644 src/Objects/Card/level2.png create mode 100644 src/Objects/Card/level2.png.import diff --git a/src/Menus/DragNDrop/DragSource.gd b/src/Menus/DragNDrop/DragSource.gd index 82615e1..a01508f 100644 --- a/src/Menus/DragNDrop/DragSource.gd +++ b/src/Menus/DragNDrop/DragSource.gd @@ -1,5 +1,5 @@ extends TextureRect -#CardDeck +# CardDeck export var Item:PackedScene export var PreviewIcon:Texture export var DeleteOnGrab:bool = false @@ -8,28 +8,31 @@ export var DeleteOnGrab:bool = false func get_drag_data(_pos): var ctrl = Control.new() var TR = TextureRect.new() - TR.texture = get_resized_texture(PreviewIcon,self.rect_size[0],self.rect_size[1]) - TR.rect_size= self.rect_size - TR.set_position(_pos*-1,false) + TR.texture = get_resized_texture(PreviewIcon, self.rect_size[0], self.rect_size[1]) + TR.rect_size = self.rect_size + TR.set_position(_pos * -1, false) ctrl.add_child(TR) set_drag_preview(ctrl) - if DeleteOnGrab : + if DeleteOnGrab: self.queue_free() return Item + #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 func drop_data(_pos, _data): pass + func get_resized_texture(t: Texture, width: int = 0, height: int = 0): var image = t.get_data() - if width > 0 && height > 0: + if width > 0 and height > 0: image.resize(width, height) var itex = ImageTexture.new() itex.create_from_image(image,0) diff --git a/src/Menus/DragNDrop/DragSource.tscn b/src/Menus/DragNDrop/DragSource.tscn index 6070ea3..505e0ee 100644 --- a/src/Menus/DragNDrop/DragSource.tscn +++ b/src/Menus/DragNDrop/DragSource.tscn @@ -1,8 +1,29 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://icon.png" type="Texture" id=1] [ext_resource path="res://Objects/Card/card.png" type="Texture" id=2] [ext_resource path="res://Menus/DragNDrop/DragSource.gd" type="Script" id=3] +[ext_resource path="res://Objects/Card/level0.png" type="Texture" id=4] +[ext_resource path="res://Objects/Card/level2.png" type="Texture" id=5] +[ext_resource path="res://Objects/Card/level1.png" type="Texture" id=6] + +[sub_resource type="SpriteFrames" id=1] +animations = [ { +"frames": [ ExtResource( 4 ) ], +"loop": false, +"name": "lvl0", +"speed": 60.0 +}, { +"frames": [ ExtResource( 5 ) ], +"loop": false, +"name": "lvl2", +"speed": 60.0 +}, { +"frames": [ ExtResource( 6 ) ], +"loop": false, +"name": "lvl1", +"speed": 60.0 +} ] [node name="DragSource" type="TextureRect"] margin_left = 10.7364 @@ -17,6 +38,11 @@ __meta__ = { } [node name="Sprite" type="Sprite" parent="."] -position = Vector2( 16.0791, 16.0117 ) +position = Vector2( 15.729, 15.7929 ) z_index = -1 texture = ExtResource( 2 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +position = Vector2( 33.1035, 40.3068 ) +frames = SubResource( 1 ) +animation = "lvl0" diff --git a/src/Objects/Card/level0.png b/src/Objects/Card/level0.png new file mode 100644 index 0000000000000000000000000000000000000000..58395a20fd6f46f40eb19785c11bfb2c78bce600 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^96-#>$P6T>u-)MXQjEnx?oNz1PwLbIIh+L^k;M!Q z+`=Ht$S`Y;1W=GIz$e7@|Ns9$X6T{IbwG-#B*-uLKf}}Q23|lOpQnpsNX4AwganV| a1fYQy4C&wZTvY(dFnGH9xvX#0(@aFI#pSNHG=%xjQl5JgHL;vL>4nJ za0`PlBg3pY5+K0g6NM literal 0 HcmV?d00001 diff --git a/src/Objects/Card/level1.png.import b/src/Objects/Card/level1.png.import new file mode 100644 index 0000000..4088ced --- /dev/null +++ b/src/Objects/Card/level1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/level1.png-ab0efb90911fd7134ef5c5c3c34ffe82.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Card/level1.png" +dest_files=[ "res://.import/level1.png-ab0efb90911fd7134ef5c5c3c34ffe82.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/Objects/Card/level2.png b/src/Objects/Card/level2.png new file mode 100644 index 0000000000000000000000000000000000000000..2d42d0691b97031ee06a05cc188409ab52ab87f5 GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^96-#>$P6T>u-)MXQjEnx?oNz1PwLbIIh+L^k;M!Q z+`=Ht$S`Y;1W=GIz$e7@|NsB%R6=vkK0gT*;q!EH45^rtoRHv=oB%Y!f+79;o~sH# O83s>RKbLh*2~7Y1mmU`Y literal 0 HcmV?d00001 diff --git a/src/Objects/Card/level2.png.import b/src/Objects/Card/level2.png.import new file mode 100644 index 0000000..c080379 --- /dev/null +++ b/src/Objects/Card/level2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/level2.png-377010b68cc608f506f01e4ccb424729.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Card/level2.png" +dest_files=[ "res://.import/level2.png-377010b68cc608f506f01e4ccb424729.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 From 9b5ccae8a74cc0ab9e2036ef0504e8980b4b765e Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 20 Apr 2020 12:57:48 +0200 Subject: [PATCH 4/4] Added Card Level Animation --- src/Menus/DragNDrop/DragNDropUI.tscn | 2 ++ src/Menus/DragNDrop/DragSource.gd | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Menus/DragNDrop/DragNDropUI.tscn b/src/Menus/DragNDrop/DragNDropUI.tscn index a8e07b1..1dfdcd1 100644 --- a/src/Menus/DragNDrop/DragNDropUI.tscn +++ b/src/Menus/DragNDrop/DragNDropUI.tscn @@ -62,3 +62,5 @@ anchor_bottom = 0.87 margin_left = 2.0 margin_right = 0.0400085 margin_bottom = -30.9 + +[editable path="GenericCard1"] diff --git a/src/Menus/DragNDrop/DragSource.gd b/src/Menus/DragNDrop/DragSource.gd index a01508f..23e6a4e 100644 --- a/src/Menus/DragNDrop/DragSource.gd +++ b/src/Menus/DragNDrop/DragSource.gd @@ -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