collisions, enemies, knockback, rolling

This commit is contained in:
mightypanders 2021-04-04 19:20:44 +02:00
parent 650a5a4a83
commit 01490a7f01
14 changed files with 1306 additions and 17 deletions

View File

@ -1,9 +1,12 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=57 format=2]
[ext_resource path="res://assets/World/Bush.tscn" type="PackedScene" id=1]
[ext_resource path="res://script/player/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/World/GrassBackground.png" type="Texture" id=3]
[ext_resource path="res://assets/World/DirtTileset.png" type="Texture" id=4]
[ext_resource path="res://assets/World/CliffTileset.png" type="Texture" id=5]
[ext_resource path="res://assets/World/Grass.tscn" type="PackedScene" id=6]
[ext_resource path="res://assets/Enemies/Bat.tscn" type="PackedScene" id=7]
[sub_resource type="TileSet" id=1]
0/name = "DirtTileset.png 0"
@ -30,6 +33,455 @@
0/shapes = [ ]
0/z_index = 0
[sub_resource type="ConvexPolygonShape2D" id=3]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=4]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=5]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=6]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=7]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=8]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=9]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=10]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=11]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=12]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=13]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=14]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=15]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=16]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=17]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=18]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=19]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=20]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=21]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=22]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=23]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=24]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=25]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=26]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=27]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=28]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=29]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=30]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=31]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=32]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=33]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=34]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=35]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=36]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=37]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=38]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=39]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=40]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=41]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=42]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=43]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=44]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=45]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=46]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=47]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=48]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=49]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="TileSet" id=2]
0/name = "CliffTileset.png 0"
0/texture = ExtResource( 5 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 352, 160 )
0/tile_mode = 1
0/autotile/bitmask_mode = 1
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 432, Vector2( 0, 1 ), 438, Vector2( 0, 2 ), 54, Vector2( 0, 3 ), 48, Vector2( 1, 0 ), 504, Vector2( 1, 1 ), 511, Vector2( 1, 2 ), 63, Vector2( 1, 3 ), 56, Vector2( 2, 0 ), 216, Vector2( 2, 1 ), 219, Vector2( 2, 2 ), 27, Vector2( 2, 3 ), 24, Vector2( 3, 0 ), 144, Vector2( 3, 1 ), 146, Vector2( 3, 2 ), 18, Vector2( 3, 3 ), 16, Vector2( 4, 0 ), 176, Vector2( 4, 1 ), 182, Vector2( 4, 2 ), 434, Vector2( 4, 3 ), 50, Vector2( 4, 4 ), 178, Vector2( 5, 0 ), 248, Vector2( 5, 1 ), 255, Vector2( 5, 2 ), 507, Vector2( 5, 3 ), 59, Vector2( 5, 4 ), 251, Vector2( 6, 0 ), 440, Vector2( 6, 1 ), 447, Vector2( 6, 2 ), 510, Vector2( 6, 3 ), 62, Vector2( 6, 4 ), 446, Vector2( 7, 0 ), 152, Vector2( 7, 1 ), 155, Vector2( 7, 2 ), 218, Vector2( 7, 3 ), 26, Vector2( 7, 4 ), 154, Vector2( 8, 0 ), 184, Vector2( 8, 1 ), 191, Vector2( 8, 2 ), 506, Vector2( 8, 3 ), 58, Vector2( 8, 4 ), 186, Vector2( 9, 0 ), 443, Vector2( 9, 1 ), 254, Vector2( 9, 2 ), 442, Vector2( 9, 3 ), 190, Vector2( 10, 2 ), 250, Vector2( 10, 3 ), 187 ]
0/autotile/icon_coordinate = Vector2( 0, 0 )
0/autotile/tile_size = Vector2( 32, 32 )
0/autotile/spacing = 0
0/autotile/occluder_map = [ ]
0/autotile/navpoly_map = [ ]
0/autotile/priority_map = [ ]
0/autotile/z_index_map = [ ]
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape = SubResource( 3 )
0/shape_one_way = false
0/shape_one_way_margin = 1.0
0/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 3 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 4 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 5 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 6 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 7 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 8 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 9 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 10 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 11 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 12 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 13 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 14 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 15 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 16 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 17 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 18 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 19 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 20 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 6, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 21 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 6, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 22 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 6, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 23 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 7, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 24 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 7, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 25 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 7, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 26 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 8, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 27 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 9, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 28 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 8, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 29 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 9, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 30 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 8, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 31 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 10, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 32 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 9, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 33 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 34 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 35 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 36 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 37 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 38 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 39 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 6, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 40 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 7, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 41 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 8, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 42 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 9, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 43 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 10, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 44 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 4 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 45 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 4 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 46 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 6, 4 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 47 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 7, 4 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 48 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 8, 4 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 49 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
0/z_index = 0
[node name="World" type="Node2D"]
__meta__ = {
"_edit_lock_": true
@ -43,24 +495,122 @@ texture = ExtResource( 3 )
region_enabled = true
region_rect = Rect2( 0, 0, 320, 180 )
[node name="TileMap" type="TileMap" parent="."]
[node name="DirtTileMap" type="TileMap" parent="."]
tile_set = SubResource( 1 )
cell_size = Vector2( 16, 16 )
format = 1
tile_data = PoolIntArray( -65525, 0, 0, -65524, 0, 1, -65523, 0, 1, -65522, 0, 1, -65521, 0, 1, -65520, 0, 1, -65519, 0, 1, -65518, 0, 1, -65517, 0, 1, -65516, 0, 2, 11, 0, 131072, 12, 0, 131073, 13, 0, 131073, 14, 0, 131073, 15, 0, 131073, 16, 0, 131073, 17, 0, 131073, 18, 0, 131073, 19, 0, 65542, 20, 0, 65538, 65555, 0, 65536, 65556, 0, 65538, 131091, 0, 65536, 131092, 0, 65538, 196627, 0, 131072, 196628, 0, 131074, 393215, 0, 0, 327680, 0, 1, 327681, 0, 1, 327682, 0, 2, 458751, 0, 65536, 393216, 0, 65537, 393217, 0, 65537, 393218, 0, 131077, 393219, 0, 1, 393220, 0, 1, 393221, 0, 1, 393222, 0, 1, 393223, 0, 1, 393224, 0, 2, 524287, 0, 131072, 458752, 0, 131073, 458753, 0, 131073, 458754, 0, 131073, 458755, 0, 131073, 458756, 0, 131073, 458757, 0, 65542, 458758, 0, 65537, 458759, 0, 65537, 458760, 0, 65538, 524293, 0, 131072, 524294, 0, 65542, 524295, 0, 65537, 524296, 0, 131077, 524297, 0, 1, 524298, 0, 1, 524299, 0, 1, 524300, 0, 1, 524301, 0, 2, 589830, 0, 131072, 589831, 0, 65542, 589832, 0, 65537, 589833, 0, 65537, 589834, 0, 65537, 589835, 0, 65537, 589836, 0, 65537, 589837, 0, 131077, 589838, 0, 2, 655367, 0, 131072, 655368, 0, 131073, 655369, 0, 131073, 655370, 0, 131073, 655371, 0, 131073, 655372, 0, 65542, 655373, 0, 65537, 655374, 0, 131077, 655375, 0, 2, 720908, 0, 131072, 720909, 0, 131073, 720910, 0, 131073, 720911, 0, 131074 )
tile_data = PoolIntArray( -65525, 0, 0, -65524, 0, 1, -65523, 0, 1, -65522, 0, 1, -65521, 0, 1, -65520, 0, 1, -65519, 0, 1, -65518, 0, 1, -65517, 0, 1, -65516, 0, 2, 11, 0, 65536, 12, 0, 65537, 13, 0, 65537, 14, 0, 65537, 15, 0, 65537, 16, 0, 65537, 17, 0, 65537, 18, 0, 65537, 19, 0, 65537, 20, 0, 65538, 65547, 0, 131072, 65548, 0, 131073, 65549, 0, 131073, 65550, 0, 131073, 65551, 0, 131073, 65552, 0, 131073, 65553, 0, 131073, 65554, 0, 131073, 65555, 0, 65542, 65556, 0, 65538, 131091, 0, 65536, 131092, 0, 65538, 196627, 0, 131072, 196628, 0, 131074, 393215, 0, 0, 327680, 0, 1, 327681, 0, 2, 458751, 0, 65536, 393216, 0, 65537, 393217, 0, 131077, 393218, 0, 1, 393219, 0, 1, 393220, 0, 1, 393221, 0, 1, 393222, 0, 1, 393223, 0, 1, 393224, 0, 2, 393230, 0, 0, 393231, 0, 1, 393232, 0, 1, 393233, 0, 1, 393234, 0, 1, 393235, 0, 2, 524287, 0, 131072, 458752, 0, 131073, 458753, 0, 131073, 458754, 0, 131073, 458755, 0, 131073, 458756, 0, 131073, 458757, 0, 65542, 458758, 0, 65537, 458759, 0, 65537, 458760, 0, 65538, 458766, 0, 65536, 458767, 0, 65537, 458768, 0, 65537, 458769, 0, 65537, 458770, 0, 65537, 458771, 0, 65538, 524293, 0, 131072, 524294, 0, 65542, 524295, 0, 65537, 524296, 0, 131077, 524297, 0, 1, 524298, 0, 1, 524299, 0, 1, 524300, 0, 2, 524302, 0, 65536, 524303, 0, 65537, 524304, 0, 65537, 524305, 0, 65537, 524306, 0, 65537, 524307, 0, 65538, 589830, 0, 131072, 589831, 0, 131073, 589832, 0, 65542, 589833, 0, 65537, 589834, 0, 65537, 589835, 0, 65537, 589836, 0, 65538, 589838, 0, 65536, 589839, 0, 65537, 589840, 0, 65537, 589841, 0, 65537, 589842, 0, 65537, 589843, 0, 65538, 655368, 0, 131072, 655369, 0, 131073, 655370, 0, 131073, 655371, 0, 65542, 655372, 0, 65538, 655374, 0, 65536, 655375, 0, 65541, 655376, 0, 131073, 655377, 0, 131073, 655378, 0, 131073, 655379, 0, 131074, 720907, 0, 131072, 720908, 0, 131074, 720910, 0, 131072, 720911, 0, 131074 )
[node name="CliffsTileMap" type="TileMap" parent="."]
tile_set = SubResource( 2 )
cell_size = Vector2( 32, 32 )
collision_mask = 0
format = 1
tile_data = PoolIntArray( -65536, 0, 0, -65535, 0, 1, -65534, 0, 1, -65533, 0, 1, -65532, 0, 1, -65531, 0, 1, -65530, 0, 1, -65529, 0, 1, -65528, 0, 1, -65527, 0, 2, 0, 0, 65536, 1, 0, 65541, 2, 0, 131073, 3, 0, 131073, 4, 0, 131073, 5, 0, 131073, 6, 0, 131073, 7, 0, 131073, 8, 0, 131073, 9, 0, 131074, 65536, 0, 131072, 65537, 0, 65543, 131073, 0, 131075, 196615, 0, 0, 196616, 0, 1, 196617, 0, 5, 196618, 0, 196610, 262151, 0, 65536, 262152, 0, 65537, 262153, 0, 65538, 327680, 0, 0, 327681, 0, 1, 327682, 0, 1, 327683, 0, 2, 327687, 0, 131072, 327688, 0, 131073, 327689, 0, 196613, 327690, 0, 196610, 393216, 0, 131072, 393217, 0, 131073, 393218, 0, 131073, 393219, 0, 131074 )
[node name="YSort" type="YSort" parent="."]
z_index = 1
[node name="Player" parent="YSort" instance=ExtResource( 2 )]
position = Vector2( 147.244, 71.7345 )
position = Vector2( 16, 104 )
z_index = 0
[node name="Bush" parent="YSort" instance=ExtResource( 1 )]
position = Vector2( 69.0602, 89.8899 )
[node name="Bushes" type="YSort" parent="YSort"]
[node name="Bush2" parent="YSort" instance=ExtResource( 1 )]
[node name="Bush" parent="YSort/Bushes" instance=ExtResource( 1 )]
position = Vector2( 32, 32 )
[node name="Bush4" parent="YSort/Bushes" instance=ExtResource( 1 )]
position = Vector2( 104, 80 )
[node name="Bush2" parent="YSort/Bushes" instance=ExtResource( 1 )]
position = Vector2( 162.504, 115.846 )
[node name="Bush3" parent="YSort" instance=ExtResource( 1 )]
[node name="Bush3" parent="YSort/Bushes" instance=ExtResource( 1 )]
position = Vector2( 220.552, 61.1018 )
[node name="Grass" type="YSort" parent="YSort"]
[node name="Grass" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 48, 144 )
[node name="Grass2" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 32, 144 )
[node name="Grass3" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 16, 144 )
[node name="Grass4" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 16, 128 )
[node name="Grass5" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 32, 128 )
[node name="Grass10" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 80, 48 )
[node name="Grass11" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 96, 48 )
[node name="Grass12" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 112, 48 )
[node name="Grass13" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 112, 32 )
[node name="Grass14" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 96, 32 )
[node name="Grass15" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 80, 32 )
[node name="Grass16" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 64, 32 )
[node name="Grass17" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 288, 32 )
[node name="Grass18" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 272, 32 )
[node name="Grass19" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 272, 48 )
[node name="Grass20" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 288, 48 )
[node name="Grass21" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 288, 64 )
[node name="Grass22" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 304, 64 )
[node name="Grass23" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 304, 80 )
[node name="Grass24" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 288, 80 )
[node name="Grass25" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 272, 80 )
[node name="Grass26" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 272, 64 )
[node name="Grass27" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 272, 64 )
[node name="Grass6" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 64, 80 )
[node name="Grass7" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 64, 64 )
[node name="Grass8" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 64, 48 )
[node name="Grass9" parent="YSort/Grass" instance=ExtResource( 6 )]
position = Vector2( 64, 48 )
[node name="Bat" parent="YSort" instance=ExtResource( 7 )]
position = Vector2( 112, 120 )

7
assets/Boxes/Hitbox.tscn Normal file
View File

@ -0,0 +1,7 @@
[gd_scene format=2]
[node name="Hitbox" type="Area2D"]
collision_layer = 0
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View File

@ -0,0 +1,7 @@
[gd_scene format=2]
[node name="Hurtbox" type="Area2D"]
collision_layer = 0
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View File

@ -0,0 +1,12 @@
extends Node2D
onready var animatedSprite = $AnimatedSprite
func _ready():
animatedSprite.frame = 0
animatedSprite.play("Animate")
pass # Replace with function body.
func _on_AnimatedSprite_animation_finished():
queue_free()
pass # Replace with function body.

View File

@ -0,0 +1,43 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://assets/Effects/GrassEffect.png" type="Texture" id=1]
[ext_resource path="res://assets/Effects/GrassEffect.gd" type="Script" id=2]
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 64, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
region = Rect2( 96, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
region = Rect2( 128, 0, 32, 32 )
[sub_resource type="SpriteFrames" id=6]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
"loop": false,
"name": "Animate",
"speed": 15.0
} ]
[node name="GrassEffect" type="Node2D"]
script = ExtResource( 2 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 6 )
animation = "Animate"
frame = 4
centered = false
offset = Vector2( -8, -8 )
[connection signal="animation_finished" from="AnimatedSprite" to="." method="_on_AnimatedSprite_animation_finished"]

10
assets/Enemies/Bat.gd Normal file
View File

@ -0,0 +1,10 @@
extends KinematicBody2D
var knockback = Vector2.ZERO
func _physics_process(delta):
knockback = knockback.move_toward(Vector2.ZERO,200*delta)
knockback = move_and_slide(knockback)
func _on_Hurtbox_area_entered(area):
knockback = area.knockbackvector * 120

68
assets/Enemies/Bat.tscn Normal file
View File

@ -0,0 +1,68 @@
[gd_scene load_steps=13 format=2]
[ext_resource path="res://assets/Shadows/SmallShadow.png" type="Texture" id=1]
[ext_resource path="res://assets/Enemies/Bat.png" type="Texture" id=2]
[ext_resource path="res://assets/Boxes/Hurtbox.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/Enemies/Bat.gd" type="Script" id=4]
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 16, 24 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 2 )
region = Rect2( 16, 0, 16, 24 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 2 )
region = Rect2( 32, 0, 16, 24 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 2 )
region = Rect2( 48, 0, 16, 24 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 2 )
region = Rect2( 64, 0, 16, 24 )
[sub_resource type="SpriteFrames" id=6]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]
[sub_resource type="CircleShape2D" id=7]
radius = 3.91596
[sub_resource type="CapsuleShape2D" id=8]
radius = 7.14859
height = 4.89034
[node name="Bat" type="KinematicBody2D"]
collision_layer = 16
script = ExtResource( 4 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( -0.10413, -0.55414 )
frames = SubResource( 6 )
frame = 3
playing = true
offset = Vector2( 0, -12 )
[node name="Shadow" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 7 )
[node name="Hurtbox" parent="." instance=ExtResource( 3 )]
collision_layer = 8
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
position = Vector2( 0.10511, -14.9259 )
shape = SubResource( 8 )
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[editable path="Hurtbox"]

View File

@ -0,0 +1,3 @@
extends Area2D
var knockbackvector = Vector2.ZERO

10
assets/World/Grass.gd Normal file
View File

@ -0,0 +1,10 @@
extends Sprite
onready var GrassEffect = load("res://assets/Effects/GrassEffect.tscn")
func destroyGrass():
var grassEffect = GrassEffect.instance()
var world = get_tree().current_scene
world.add_child(grassEffect)
grassEffect.global_position = global_position
queue_free()
func _on_Hurtbox_area_entered(area):
destroyGrass()

27
assets/World/Grass.tscn Normal file
View File

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://assets/World/Grass.png" type="Texture" id=1]
[ext_resource path="res://assets/World/Grass.gd" type="Script" id=2]
[ext_resource path="res://assets/Boxes/Hurtbox.tscn" type="PackedScene" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 6.51773, 6.19977 )
[node name="Grass" type="Node2D"]
[node name="Grass" type="Sprite" parent="."]
position = Vector2( 0.0651245, 0.152679 )
texture = ExtResource( 1 )
centered = false
offset = Vector2( -8, -8 )
script = ExtResource( 2 )
[node name="Hurtbox" parent="." instance=ExtResource( 3 )]
collision_layer = 8
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
position = Vector2( 7.94595, 7.94598 )
shape = SubResource( 1 )
[connection signal="area_entered" from="Hurtbox" to="Grass" method="_on_Hurtbox_area_entered"]
[editable path="Hurtbox"]

25
export_presets.cfg Normal file
View File

@ -0,0 +1,25 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../Exports/HeartBeast/HeartBesat.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.0.options]
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""

View File

@ -50,6 +50,51 @@ texture={
"svg/scale": 1.0
}
[input]
attack={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":74,"unicode":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
roll={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
]
}
[layer_names]
2d_physics/layer_1="World"
2d_physics/layer_2="Player"
2d_physics/layer_3="PlayerHurtbox"
2d_physics/layer_4="EnemyHurtbox"
2d_physics/layer_5="Enemy"
[rendering]
environment/default_environment="res://default_env.tres"

View File

@ -1,27 +1,78 @@
extends KinematicBody2D
var velocity = Vector2.ZERO
var roll_vector = Vector2.ZERO
const MAX_SPEED = 80
const ROLL_SPEED = MAX_SPEED*1.5
const ACCELERATION = 500
const FRICTION = 500
enum states{
MOVE,
ROLL,
ATTACK
}
var state = states.MOVE
onready var animationPlayer = $AnimationPlayer
onready var animationTree = $AnimationTree
onready var animationState = animationTree.get('parameters/playback')
onready var swordHitbox = $HitBoxPivot/SwordHitbox
func _ready():
animationTree.active = true
swordHitbox.knockbackvector = roll_vector
func _physics_process(delta):
match state:
states.MOVE:
do_move(delta)
states.ATTACK:
do_attack(delta)
states.ROLL:
do_roll(delta)
func do_roll(delta):
animationState.travel('Roll')
velocity = roll_vector * ROLL_SPEED
move_sprite()
pass
func do_attack(_delta):
animationState.travel('Attack')
velocity = Vector2.ZERO
func set_facing_direction(input_vector):
animationTree.set("parameters/Walk/blend_position",input_vector)
animationTree.set("parameters/Idle/blend_position",input_vector)
animationTree.set("parameters/Attack/blend_position",input_vector)
animationTree.set("parameters/Roll/blend_position",input_vector)
func do_move(delta):
var input_vector=Vector2.ZERO
input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
input_vector.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
input_vector.y = Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
input_vector = input_vector.normalized()
if input_vector != Vector2.ZERO:
animationTree.set("parameters/Walk/blend_position",input_vector)
animationTree.set("parameters/Idle/blend_position",input_vector)
roll_vector = input_vector
swordHitbox.knockbackvector = roll_vector
set_facing_direction(input_vector)
animationState.travel("Walk")
velocity = velocity.move_toward(input_vector*MAX_SPEED,ACCELERATION*delta)
else:
animationState.travel("Idle")
velocity = velocity.move_toward(Vector2.ZERO, FRICTION*delta)
velocity = move_and_slide(velocity)
move_sprite()
if Input.is_action_just_pressed("attack"):
state = states.ATTACK
if Input.is_action_just_pressed('roll'):
state = states.ROLL
func move_sprite():
velocity = move_and_slide(velocity)
func attack_animation_finished():
state = states.MOVE
func roll_animation_finished():
velocity = velocity / 2
state = states.MOVE

View File

@ -1,12 +1,230 @@
[gd_scene load_steps=28 format=2]
[gd_scene load_steps=53 format=2]
[ext_resource path="res://assets/Player/Player.png" type="Texture" id=1]
[ext_resource path="res://script/player/Player.gd" type="Script" id=2]
[ext_resource path="res://assets/Boxes/Hitbox.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/Player/SwordHitbox.gd" type="Script" id=4]
[sub_resource type="CapsuleShape2D" id=1]
radius = 4.32415
height = 8.80055
[sub_resource type="Animation" id=26]
resource_name = "Attack_Down"
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 36, 37, 38, 39 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.4 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "attack_animation_finished"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("HitBoxPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 90.0 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("HitBoxPivot/SwordHitbox/CollisionShape2D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.1, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
[sub_resource type="Animation" id=27]
resource_name = "Attack_Left"
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 32, 33, 34, 35 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.4 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "attack_animation_finished"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("HitBoxPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 180.0 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("HitBoxPivot/SwordHitbox/CollisionShape2D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.1, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
[sub_resource type="Animation" id=28]
resource_name = "Attack_Right"
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 24, 25, 26, 27 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.4 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "attack_animation_finished"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("HitBoxPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("HitBoxPivot/SwordHitbox/CollisionShape2D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.1, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
[sub_resource type="Animation" id=29]
resource_name = "Attack_Up"
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 28, 29, 30, 31 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.4 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "attack_animation_finished"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("HitBoxPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 270.0 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("HitBoxPivot/SwordHitbox/CollisionShape2D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.1, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
[sub_resource type="Animation" id=8]
resource_name = "Idle_Left"
length = 0.1
@ -74,6 +292,126 @@ tracks/0/keys = {
"values": [ 18 ]
}
[sub_resource type="Animation" id=38]
resource_name = "Roll_Down"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 55, 56, 57, 58, 59 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "roll_animation_finished"
} ]
}
[sub_resource type="Animation" id=39]
resource_name = "Roll_Left"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 50, 51, 52, 53, 54 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "roll_animation_finished"
} ]
}
[sub_resource type="Animation" id=40]
resource_name = "Roll_Right"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 40, 41, 42, 43, 44 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "roll_animation_finished"
} ]
}
[sub_resource type="Animation" id=41]
resource_name = "Roll_Up"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 45, 46, 47, 48, 49 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "roll_animation_finished"
} ]
}
[sub_resource type="Animation" id=4]
resource_name = "Walk_Down"
length = 0.6
@ -142,6 +480,31 @@ tracks/0/keys = {
"values": [ 7, 8, 9, 10, 11, 6 ]
}
[sub_resource type="AnimationNodeAnimation" id=30]
animation = "Attack_Left"
[sub_resource type="AnimationNodeAnimation" id=31]
animation = "Attack_Down"
[sub_resource type="AnimationNodeAnimation" id=32]
animation = "Attack_Right"
[sub_resource type="AnimationNodeAnimation" id=33]
animation = "Attack_Up"
[sub_resource type="AnimationNodeBlendSpace2D" id=34]
blend_point_0/node = SubResource( 30 )
blend_point_0/pos = Vector2( -1, 0 )
blend_point_1/node = SubResource( 31 )
blend_point_1/pos = Vector2( 0, 1.1 )
blend_point_2/node = SubResource( 32 )
blend_point_2/pos = Vector2( 1, 0 )
blend_point_3/node = SubResource( 33 )
blend_point_3/pos = Vector2( 0, -1.1 )
min_space = Vector2( -1, -1.1 )
max_space = Vector2( 1, 1.1 )
blend_mode = 1
[sub_resource type="AnimationNodeAnimation" id=10]
animation = "Idle_down"
@ -171,6 +534,31 @@ min_space = Vector2( -1, -1.1 )
max_space = Vector2( 1, 1.1 )
blend_mode = 1
[sub_resource type="AnimationNodeAnimation" id=42]
animation = "Roll_Down"
[sub_resource type="AnimationNodeAnimation" id=43]
animation = "Roll_Right"
[sub_resource type="AnimationNodeAnimation" id=44]
animation = "Roll_Up"
[sub_resource type="AnimationNodeAnimation" id=45]
animation = "Roll_Left"
[sub_resource type="AnimationNodeBlendSpace2D" id=46]
blend_point_0/node = SubResource( 42 )
blend_point_0/pos = Vector2( 0, 1.1 )
blend_point_1/node = SubResource( 43 )
blend_point_1/pos = Vector2( 1, 0 )
blend_point_2/node = SubResource( 44 )
blend_point_2/pos = Vector2( 0, -1.1 )
blend_point_3/node = SubResource( 45 )
blend_point_3/pos = Vector2( -1, 0 )
min_space = Vector2( -1, -1.1 )
max_space = Vector2( 1, 1.1 )
blend_mode = 1
[sub_resource type="AnimationNodeAnimation" id=19]
animation = "Walk_Down"
@ -200,26 +588,44 @@ blend_mode = 1
[sub_resource type="AnimationNodeStateMachineTransition" id=25]
[sub_resource type="AnimationNodeStateMachineTransition" id=35]
[sub_resource type="AnimationNodeStateMachineTransition" id=36]
[sub_resource type="AnimationNodeStateMachineTransition" id=47]
[sub_resource type="AnimationNodeStateMachineTransition" id=48]
[sub_resource type="AnimationNodeStateMachine" id=16]
states/Attack/node = SubResource( 34 )
states/Attack/position = Vector2( 567, 254 )
states/Idle/node = SubResource( 15 )
states/Idle/position = Vector2( 629, 126 )
states/Roll/node = SubResource( 46 )
states/Roll/position = Vector2( 841, 254 )
states/Walk/node = SubResource( 23 )
states/Walk/position = Vector2( 807, 126 )
transitions = [ "Idle", "Walk", SubResource( 24 ), "Walk", "Idle", SubResource( 25 ) ]
states/Walk/position = Vector2( 880, 58 )
transitions = [ "Idle", "Walk", SubResource( 24 ), "Walk", "Idle", SubResource( 25 ), "Idle", "Attack", SubResource( 35 ), "Attack", "Idle", SubResource( 36 ), "Idle", "Roll", SubResource( 47 ), "Roll", "Idle", SubResource( 48 ) ]
start_node = "Idle"
[sub_resource type="AnimationNodeStateMachinePlayback" id=17]
[sub_resource type="AnimationNodeStateMachinePlayback" id=18]
[sub_resource type="CapsuleShape2D" id=37]
radius = 11.5633
height = 8.25464
[node name="Player" type="KinematicBody2D"]
z_index = 1
collision_layer = 2
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -8.04334 )
texture = ExtResource( 1 )
hframes = 60
frame = 54
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -1.41422, 0.440334 )
@ -230,10 +636,18 @@ __meta__ = {
}
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Attack_Down = SubResource( 26 )
anims/Attack_Left = SubResource( 27 )
anims/Attack_Right = SubResource( 28 )
anims/Attack_Up = SubResource( 29 )
anims/Idle_Left = SubResource( 8 )
anims/Idle_Right = SubResource( 2 )
anims/Idle_Up = SubResource( 3 )
anims/Idle_down = SubResource( 9 )
anims/Roll_Down = SubResource( 38 )
anims/Roll_Left = SubResource( 39 )
anims/Roll_Right = SubResource( 40 )
anims/Roll_Up = SubResource( 41 )
anims/Walk_Down = SubResource( 4 )
anims/Walk_Left = SubResource( 5 )
anims/Walk_Right = SubResource( 6 )
@ -242,8 +656,25 @@ anims/Walk_Up = SubResource( 7 )
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource( 16 )
anim_player = NodePath("../AnimationPlayer")
active = true
parameters/playback = SubResource( 17 )
parameters/Attack/blend_position = Vector2( 0.008641, 0.490582 )
parameters/Idle/blend_position = Vector2( 0, 0 )
parameters/Idle/4/playback = SubResource( 18 )
parameters/Roll/blend_position = Vector2( -0.0016892, -0.00504589 )
parameters/Walk/blend_position = Vector2( 0, 0 )
[node name="HitBoxPivot" type="Position2D" parent="."]
position = Vector2( 0, -4 )
rotation = 3.14159
[node name="SwordHitbox" parent="HitBoxPivot" instance=ExtResource( 3 )]
position = Vector2( 14.5055, 1.68754 )
collision_mask = 8
script = ExtResource( 4 )
[node name="CollisionShape2D" parent="HitBoxPivot/SwordHitbox" index="0"]
position = Vector2( 0, -2.207 )
shape = SubResource( 37 )
disabled = true
[editable path="HitBoxPivot/SwordHitbox"]