Added Gameplay Animations and Functionality

- Added clap animation for bear trap
- Added cards in menu bar
- Replaced old bear_trap icon with new one
This commit is contained in:
2020-04-20 00:19:06 +02:00
parent 02b56fb6f5
commit 32ccb24012
74 changed files with 1251 additions and 28 deletions

View File

@@ -1,11 +1,12 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 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://testSprites/falle.png" type="Texture" id=5]
[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]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
@@ -23,27 +24,45 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="DragSourceBanana" parent="." instance=ExtResource( 1 )]
margin_left = 13.5128
margin_top = 238.668
margin_right = 45.5128
margin_bottom = 270.668
[node name="GenericCard1" parent="." instance=ExtResource( 1 )]
margin_left = 11.9239
margin_top = 220.793
margin_right = 43.9239
margin_bottom = 252.793
texture = ExtResource( 4 )
Item = ExtResource( 3 )
PreviewIcon = ExtResource( 4 )
[node name="DragSourceFalle" parent="." instance=ExtResource( 1 )]
margin_left = 45.5128
margin_top = 238.668
margin_right = 77.5128
margin_bottom = 270.668
[node name="GenericCard2" parent="." instance=ExtResource( 1 )]
margin_left = 69.0145
margin_top = 221.191
margin_right = 101.014
margin_bottom = 253.191
texture = ExtResource( 5 )
Item = ExtResource( 6 )
PreviewIcon = ExtResource( 5 )
PreviewIcon = ExtResource( 7 )
[node name="GenericCard3" parent="." instance=ExtResource( 1 )]
margin_left = 124.812
margin_top = 220.859
margin_right = 156.812
margin_bottom = 252.859
[node name="GenericCard4" parent="." instance=ExtResource( 1 )]
margin_left = 180.718
margin_top = 220.859
margin_right = 212.718
margin_bottom = 252.859
[node name="GenericCard5" parent="." instance=ExtResource( 1 )]
margin_left = 237.404
margin_top = 221.267
margin_right = 269.404
margin_bottom = 253.267
[node name="DragSink" parent="." instance=ExtResource( 2 )]
anchor_right = 1.002
anchor_bottom = 0.87
margin_left = 1.0
margin_right = 0.0399475
margin_bottom = 0.0999756
margin_left = 2.0
margin_right = 0.0400085
margin_bottom = -30.9

View File

@@ -9,10 +9,15 @@ script/source = "extends Container
func can_drop_data(_pos, data):
return typeof(data) == typeof(PackedScene)
func get_nearest_grid_pos(position):
return Vector2(floor(position.x / 32.0) * 32, floor(position.y / 32.0) * 32)
#what is to be done when data is dropped
func drop_data(_pos, data:PackedScene):
var child = data.instance()
child.position= _pos
child.position = get_nearest_grid_pos(_pos)
get_node(get_parent().ObjectParent).add_child(child)
"

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://icon.png" type="Texture" id=1]
[ext_resource path="res://Objects/Card/card.png" type="Texture" id=2]
[sub_resource type="GDScript" id=1]
script/source = "extends TextureRect
@@ -53,3 +54,8 @@ __meta__ = {
"_edit_use_anchors_": false
}
PreviewIcon = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 16.0791, 16.0117 )
z_index = -1
texture = ExtResource( 2 )