Added cards for objects + MISC

- Added flame animation
- Added cards for objects
- Added new background animation
- Added placeable walls

Co-Authored-By: deranonymos <deranonymos@users.noreply.github.com>
This commit is contained in:
2020-04-20 15:54:40 +02:00
parent 32e73895dc
commit fafd1956c6
390 changed files with 4727 additions and 2117 deletions

View File

@@ -1,14 +1,12 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=8 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://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://Objects/Banana/BananaCard.tscn" type="PackedScene" id=3]
[ext_resource path="res://Objects/Traps/Bear/BearCard.tscn" type="PackedScene" id=4]
[ext_resource path="res://Objects/Barriere/BarrierCard.tscn" type="PackedScene" id=5]
[ext_resource path="res://Objects/Barrel/BarrelCard.tscn" type="PackedScene" id=6]
[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
@@ -20,35 +18,13 @@ __meta__ = {
"_edit_use_anchors_": false
}
[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( 9 )
[node name="GenericCard1" parent="." instance=ExtResource( 3 )]
[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( 7 )
[node name="GenericCard2" parent="." instance=ExtResource( 4 )]
[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="GenericCard3" parent="." instance=ExtResource( 5 )]
[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="GenericCard4" parent="." instance=ExtResource( 6 )]
[node name="GenericCard5" parent="." instance=ExtResource( 1 )]
margin_left = 237.404
@@ -62,5 +38,3 @@ anchor_bottom = 0.87
margin_left = 2.0
margin_right = 0.0400085
margin_bottom = -30.9
[editable path="GenericCard1"]

View File

@@ -10,21 +10,17 @@ func can_drop_data(_pos, data):
return typeof(data) == typeof(PackedScene)
func get_nearest_grid_pos(position):
return Vector2(round(position.x / 32.0), round(position.y / 32.0))
func get_nearest_global_pos(position):
return Vector2(round(position.x / 32.0) * 32, round(position.y / 32.0) * 32)
func get_nearest_grid_pos(position, scale = 1):
return Vector2(round(position.x / 32.0) * scale, round(position.y / 32.0) * scale)
#what is to be done when data is dropped
func drop_data(_pos, data:PackedScene):
var new_pos = get_nearest_grid_pos(_pos)
grid._draw_object_grid()
if grid.object_grid[new_pos.x - 1][new_pos.y - 1].back() == Grid.Kind.FIELD:
var child = data.instance()
child.position = get_nearest_global_pos(_pos)
child.position = get_nearest_grid_pos(_pos, 32)
ysort.add_child(child)
grid._update_grid()

View File

@@ -14,15 +14,15 @@ animations = [ {
"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
}, {
"frames": [ ExtResource( 5 ) ],
"loop": false,
"name": "lvl2",
"speed": 60.0
} ]
[node name="DragSource" type="TextureRect"]