diff --git a/src/Menus/DragNDrop/DragNDropUI.tscn b/src/Menus/DragNDrop/DragNDropUI.tscn index 52f2bde..1dfdcd1 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 @@ -61,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 82615e1..23e6a4e 100644 --- a/src/Menus/DragNDrop/DragSource.gd +++ b/src/Menus/DragNDrop/DragSource.gd @@ -1,36 +1,51 @@ extends TextureRect -#CardDeck +# CardDeck 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() 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 + +# 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 + 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) return itex + + +func upgrade_card(): + match card_level: + 0: + $AnimatedSprite.play("lvl1") + card_level += 1 + 1: + $AnimatedSprite.play("lvl2") + card_level += 1 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/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 0000000..7a652e7 Binary files /dev/null and b/src/Objects/Banana/animation.png differ 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 0000000..84912be Binary files /dev/null and b/src/Objects/Banana/icon.png differ 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 0000000..740f005 Binary files /dev/null and b/src/Objects/Banana/mouse_follow.png differ 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/Card/level0.png b/src/Objects/Card/level0.png new file mode 100644 index 0000000..58395a2 Binary files /dev/null and b/src/Objects/Card/level0.png differ diff --git a/src/Objects/Card/level0.png.import b/src/Objects/Card/level0.png.import new file mode 100644 index 0000000..1ad2f8e --- /dev/null +++ b/src/Objects/Card/level0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/level0.png-da2388fe9991aba155f4f030f573f288.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Objects/Card/level0.png" +dest_files=[ "res://.import/level0.png-da2388fe9991aba155f4f030f573f288.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/level1.png b/src/Objects/Card/level1.png new file mode 100644 index 0000000..109fe57 Binary files /dev/null and b/src/Objects/Card/level1.png differ 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 0000000..2d42d06 Binary files /dev/null and b/src/Objects/Card/level2.png differ 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 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 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