From 0dd3f240309057860f01456acd368afa72829e64 Mon Sep 17 00:00:00 2001 From: Felipe M Date: Fri, 29 Jan 2021 17:09:52 +0100 Subject: [PATCH] Player movement and animation --- metroidvania/DustEffect.gd | 6 + metroidvania/DustEffect.tscn | 45 +++ metroidvania/Effect.tscn | 7 + metroidvania/Scenes/Player.gd | 45 ++- metroidvania/Scenes/Player.tscn | 22 ++ metroidvania/Scenes/World.gd | 11 + metroidvania/Scenes/World.tscn | 40 +-- metroidvania/TileMap.tscn | 561 ++++++++++++++++++++++++++++++++ metroidvania/project.godot | 1 + 9 files changed, 700 insertions(+), 38 deletions(-) create mode 100644 metroidvania/DustEffect.gd create mode 100644 metroidvania/DustEffect.tscn create mode 100644 metroidvania/Effect.tscn create mode 100644 metroidvania/Scenes/World.gd create mode 100644 metroidvania/TileMap.tscn diff --git a/metroidvania/DustEffect.gd b/metroidvania/DustEffect.gd new file mode 100644 index 0000000..13031e2 --- /dev/null +++ b/metroidvania/DustEffect.gd @@ -0,0 +1,6 @@ +extends Node2D + +var motion = Vector2(rand_range(-20, 20), rand_range(-10, -40)) + +func _process(delta): + position += motion * delta diff --git a/metroidvania/DustEffect.tscn b/metroidvania/DustEffect.tscn new file mode 100644 index 0000000..b6a68f4 --- /dev/null +++ b/metroidvania/DustEffect.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Assets/Effects/Dust.png" type="Texture" id=1] +[ext_resource path="res://Effect.tscn" type="PackedScene" id=2] +[ext_resource path="res://DustEffect.gd" type="Script" id=3] + +[sub_resource type="Animation" id=1] +resource_name = "Animate" +length = 0.3 +tracks/0/type = "bezier" +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 = { +"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0 ), +"times": PoolRealArray( 0, 0.1, 0.2 ) +} +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.3 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "queue_free" +} ] +} + +[node name="DustEffect" instance=ExtResource( 2 )] +script = ExtResource( 3 ) + +[node name="Sprite" parent="." index="0"] +texture = ExtResource( 1 ) +hframes = 3 +frame = 2 + +[node name="AnimationPlayer" parent="." index="1"] +autoplay = "Animate" +anims/Animate = SubResource( 1 ) diff --git a/metroidvania/Effect.tscn b/metroidvania/Effect.tscn new file mode 100644 index 0000000..85e897d --- /dev/null +++ b/metroidvania/Effect.tscn @@ -0,0 +1,7 @@ +[gd_scene format=2] + +[node name="Effect" type="Node2D"] + +[node name="Sprite" type="Sprite" parent="."] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/metroidvania/Scenes/Player.gd b/metroidvania/Scenes/Player.gd index a35adc2..0b0e638 100644 --- a/metroidvania/Scenes/Player.gd +++ b/metroidvania/Scenes/Player.gd @@ -1,5 +1,7 @@ extends KinematicBody2D +const DustEffect = preload("res://DustEffect.tscn") + export (int) var acceleration = 512 export (int) var max_speed = 64 export (float) var friction = 0.25 @@ -9,11 +11,14 @@ export (int) var max_slope = 46 var motion = Vector2.ZERO var snap_vector = Vector2.ZERO +var just_jumped= false onready var sprite = $Sprite onready var animation = $Animation +onready var coyoteJumpTimer = $CoyoteJumpTimer func _physics_process(delta): + just_jumped = false var input_vector = get_input_vector() apply_horizontal_force(input_vector, delta) apply_friction(input_vector) @@ -23,6 +28,13 @@ func _physics_process(delta): update_animations(input_vector) move() +func create_dust_effect(): + var dustPosition = global_position + dustPosition.x += rand_range(-4, 4) + var dustEffect = DustEffect.instance() + dustEffect.global_position = dustPosition + get_tree().current_scene.add_child(dustEffect) + func get_input_vector(): var input_vector = Vector2.ZERO input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left") @@ -42,17 +54,19 @@ func update_snap_vector(): snap_vector = Vector2.DOWN func jump_check(): - if is_on_floor(): + if is_on_floor() or coyoteJumpTimer.time_left > 0: if Input.is_action_just_pressed("ui_select"): motion.y = -jump_force snap_vector = Vector2.ZERO + just_jumped = true else: - if Input.is_action_just_released("ui_select"):# and motion.y < -jump_force/2: + if Input.is_action_just_released("ui_select") and motion.y < -jump_force/2: motion.y = motion.y/2 func apply_gravity(delta): - motion.y += gravity * delta - motion.y = min(motion.y, jump_force) + if not is_on_floor(): + motion.y += gravity * delta + motion.y = min(motion.y, jump_force) func update_animations(input_vector): if input_vector.x != 0: @@ -66,5 +80,28 @@ func update_animations(input_vector): animation.play("Jump") func move(): + var was_on_air = not is_on_floor() + var was_on_floor = is_on_floor() + var last_position = position + var last_motion = motion + motion = move_and_slide_with_snap(motion, snap_vector * 4, Vector2.UP, true, 4, deg2rad(max_slope), false) + # Just landed + if was_on_air and is_on_floor(): + # Keep previous momentum when landing on slopes + motion.x = last_motion.x + create_dust_effect() + + # Just left ground + if was_on_floor and not is_on_floor() and not just_jumped: + # Fixes "gap" when jumping off a cliff [TODO] + motion.y = 0 + position.y = last_position.y + coyoteJumpTimer.start() + + # Prevent Sliding (hack) [NOT WORKING] + # If we are on floor, the floor isn't moving and our motion is really tiny + if is_on_floor() and get_floor_velocity().length() == 0 and abs(motion.x) < 1: + position.x = last_position.x + diff --git a/metroidvania/Scenes/Player.tscn b/metroidvania/Scenes/Player.tscn index 61e17f9..17be2e6 100644 --- a/metroidvania/Scenes/Player.tscn +++ b/metroidvania/Scenes/Player.tscn @@ -56,6 +56,23 @@ tracks/0/keys = { "update": 1, "values": [ 4, 5, 6, 7, 8, 9, 7 ] } +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.3, 0.6 ), +"transitions": PoolRealArray( 1, 1 ), +"values": [ { +"args": [ ], +"method": "create_dust_effect" +}, { +"args": [ ], +"method": "create_dust_effect" +} ] +} [node name="Player" type="KinematicBody2D"] script = ExtResource( 2 ) @@ -64,6 +81,7 @@ script = ExtResource( 2 ) position = Vector2( 0, -12 ) texture = ExtResource( 1 ) hframes = 12 +frame = 4 [node name="Collision" type="CollisionShape2D" parent="."] position = Vector2( 0, -7 ) @@ -81,3 +99,7 @@ visible = false position = Vector2( 0, -8 ) update_rotation = false update_scale = false + +[node name="CoyoteJumpTimer" type="Timer" parent="."] +wait_time = 0.2 +one_shot = true diff --git a/metroidvania/Scenes/World.gd b/metroidvania/Scenes/World.gd new file mode 100644 index 0000000..219bc17 --- /dev/null +++ b/metroidvania/Scenes/World.gd @@ -0,0 +1,11 @@ +extends Node + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + VisualServer.set_default_clear_color(Color.black) diff --git a/metroidvania/Scenes/World.tscn b/metroidvania/Scenes/World.tscn index 6de297a..e4afab4 100644 --- a/metroidvania/Scenes/World.tscn +++ b/metroidvania/Scenes/World.tscn @@ -1,36 +1,11 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] -[ext_resource path="res://Scenes/Brick.tscn" type="PackedScene" id=1] +[ext_resource path="res://TileMap.tscn" type="PackedScene" id=1] [ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://Scenes/World.gd" type="Script" id=3] [node name="World" type="Node"] - -[node name="Brick" parent="." instance=ExtResource( 1 )] -position = Vector2( 0, 160 ) - -[node name="Brick2" parent="." instance=ExtResource( 1 )] -position = Vector2( 16, 160 ) - -[node name="Brick3" parent="." instance=ExtResource( 1 )] -position = Vector2( 32, 160 ) - -[node name="Brick4" parent="." instance=ExtResource( 1 )] -position = Vector2( 48, 160 ) - -[node name="Brick5" parent="." instance=ExtResource( 1 )] -position = Vector2( 64, 160 ) - -[node name="Brick6" parent="." instance=ExtResource( 1 )] -position = Vector2( 80, 160 ) - -[node name="Brick7" parent="." instance=ExtResource( 1 )] -position = Vector2( 96, 160 ) - -[node name="Brick8" parent="." instance=ExtResource( 1 )] -position = Vector2( 48, 144 ) - -[node name="Brick9" parent="." instance=ExtResource( 1 )] -position = Vector2( 64, 144 ) +script = ExtResource( 3 ) [node name="Player" parent="." instance=ExtResource( 2 )] position = Vector2( 32, 96 ) @@ -43,10 +18,7 @@ position = Vector2( 32, 88 ) current = true smoothing_enabled = true -[node name="Terrain" type="StaticBody2D" parent="."] - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Terrain"] -position = Vector2( -16, -32 ) -polygon = PoolVector2Array( 0, 112, 0, 144, 48, 144, 64, 128, 96, 128, 128, 96, 160, 96, 160, 112, 224, 112, 224, 80, 240, 112, 160, 176, -32, 176, -32, 112 ) +[node name="TileMap" parent="." instance=ExtResource( 1 )] +tile_data = PoolIntArray( 65536, 0, 4, 65537, 0, 196609, 65538, 0, 196609, 65539, 0, 196609, 65540, 0, 196609, 65541, 0, 6, 65542, 0, 5, 65543, 0, 196609, 65544, 0, 196609, 65545, 0, 196609, 65546, 0, 6, 65547, 0, 2, 196607, 0, 4, 131072, 0, 196615, 131077, 0, 131072, 131078, 0, 131074, 131082, 0, 65536, 131083, 0, 131077, 131084, 0, 1, 131085, 0, 5, 131086, 0, 196609, 131087, 0, 196609, 131088, 0, 196609, 131089, 0, 196609, 131090, 0, 196609, 131091, 0, 7, 262143, 0, 65539, 196618, 0, 131072, 196619, 0, 131073, 196620, 0, 131073, 196621, 0, 131074, 196627, 0, 196612, 196628, 0, 7, 327679, 0, 65539, 262164, 0, 65539, 393215, 0, 65539, 327700, 0, 65539, 458751, 0, 65539, 393236, 0, 65539, 524287, 0, 65539, 458762, 1, 3, 458763, 1, 4, 458764, 0, 1, 458765, 0, 2, 458771, 0, 196608, 458772, 0, 262151, 589823, 0, 65539, 524294, 1, 0, 524295, 0, 1, 524296, 0, 1, 524297, 0, 1, 524298, 0, 131078, 524299, 0, 65537, 524300, 0, 65537, 524301, 0, 65538, 524308, 0, 65539, 655359, 0, 131076, 589824, 0, 2, 589829, 1, 0, 589830, 1, 1, 589831, 0, 65537, 589832, 0, 65537, 589833, 0, 65537, 589834, 0, 65537, 589835, 0, 65537, 589836, 0, 65537, 589837, 0, 131077, 589838, 0, 1, 589839, 0, 1, 589840, 0, 1, 589841, 0, 2, 589844, 0, 65539, 720895, 0, 65536, 655360, 0, 131077, 655361, 0, 1, 655362, 0, 1, 655363, 0, 1, 655364, 0, 1, 655365, 1, 1, 655366, 0, 65537, 655367, 0, 65537, 655368, 0, 65541, 655369, 0, 131073, 655370, 0, 131073, 655371, 0, 131073, 655372, 0, 65542, 655373, 0, 65537, 655374, 0, 65537, 655375, 0, 65537, 655376, 0, 65537, 655377, 0, 262149, 655378, 0, 196609, 655379, 0, 196609, 655380, 0, 196615, 786431, 0, 131072, 720896, 0, 65542, 720897, 0, 65537, 720898, 0, 65537, 720899, 0, 65537, 720900, 0, 65537, 720901, 0, 65537, 720902, 0, 65537, 720903, 0, 65541, 720904, 0, 131074, 720908, 0, 131072, 720909, 0, 65542, 720910, 0, 65537, 720911, 0, 65537, 720912, 0, 65541, 720913, 0, 131074, 786432, 0, 65536, 786433, 0, 65537, 786434, 0, 65537, 786435, 0, 65537, 786436, 0, 65537, 786437, 0, 65537, 786438, 0, 65541, 786439, 0, 131074, 786445, 0, 131072, 786446, 0, 131073, 786447, 0, 131073, 786448, 0, 131074, 851968, 0, 131072, 851969, 0, 65542, 851970, 0, 65537, 851971, 0, 65537, 851972, 0, 65541, 851973, 0, 131073, 851974, 0, 131074, 917505, 0, 131072, 917506, 0, 131073, 917507, 0, 131073, 917508, 0, 131074 ) [editable path="Player"] diff --git a/metroidvania/TileMap.tscn b/metroidvania/TileMap.tscn new file mode 100644 index 0000000..50ad209 --- /dev/null +++ b/metroidvania/TileMap.tscn @@ -0,0 +1,561 @@ +[gd_scene load_steps=60 format=2] + +[ext_resource path="res://Assets/World/Tileset.png" type="Texture" id=1] +[ext_resource path="res://Assets/World/Slopes.png" type="Texture" id=2] + +[sub_resource type="ConvexPolygonShape2D" id=3] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=4] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=5] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=6] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=7] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=8] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=9] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=11] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=12] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=13] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=14] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=15] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=16] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=17] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=18] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=19] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=20] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=21] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=22] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=23] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=24] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=25] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=26] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=27] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=28] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=29] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=30] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=31] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=32] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=33] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=34] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=35] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=36] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=37] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=38] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=39] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=40] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=41] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=42] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=43] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=44] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=45] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=46] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=47] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=48] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=49] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=50] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=51] +points = PoolVector2Array( 0, 16, 16, 0, 16, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=52] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=53] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=54] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=55] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=56] +points = PoolVector2Array( 0, 16, 0, 8, 16, 0, 16, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=57] +points = PoolVector2Array( 0, 16, 16, 8, 16, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=58] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=59] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="TileSet" id=1] +0/name = "Tileset.png 0" +0/texture = ExtResource( 1 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 176, 80 ) +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( 3, 3 ) +0/autotile/tile_size = Vector2( 16, 16 ) +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( 3, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 6 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 7 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 8 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 6, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 9 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 7, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 11 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 12 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 9, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 13 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 14 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 15 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 16 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 3, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 17 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 1 ), +"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( 6, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 20 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 7, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 21 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 22 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 9, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 23 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 24 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 25 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 26 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 3, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 27 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 28 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 29 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 6, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 30 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 7, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 31 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 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( 10, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 34 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 35 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 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( 3, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 38 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 39 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 40 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 6, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 41 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 7, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 42 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 43 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 9, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 44 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 10, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 45 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 46 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 47 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 6, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 48 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 7, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 49 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 50 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 +1/name = "Slopes.png 1" +1/texture = ExtResource( 2 ) +1/tex_offset = Vector2( 0, 0 ) +1/modulate = Color( 1, 1, 1, 1 ) +1/region = Rect2( 0, 0, 112, 16 ) +1/tile_mode = 2 +1/autotile/icon_coordinate = Vector2( 0, 0 ) +1/autotile/tile_size = Vector2( 16, 16 ) +1/autotile/spacing = 0 +1/autotile/occluder_map = [ ] +1/autotile/navpoly_map = [ ] +1/autotile/priority_map = [ ] +1/autotile/z_index_map = [ ] +1/occluder_offset = Vector2( 0, 0 ) +1/navigation_offset = Vector2( 0, 0 ) +1/shape_offset = Vector2( 0, 0 ) +1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +1/shape = SubResource( 51 ) +1/shape_one_way = false +1/shape_one_way_margin = 1.0 +1/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 51 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 52 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 53 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 54 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 5, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 55 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 4, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 56 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 3, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 57 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 58 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 6, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 59 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +1/z_index = 0 + +[node name="TileMap" type="TileMap"] +tile_set = SubResource( 1 ) +cell_size = Vector2( 16, 16 ) +format = 1 diff --git a/metroidvania/project.godot b/metroidvania/project.godot index 97812be..690d26d 100644 --- a/metroidvania/project.godot +++ b/metroidvania/project.godot @@ -85,4 +85,5 @@ ui_down={ [rendering] +quality/2d/use_pixel_snap=true environment/default_environment="res://default_env.tres"