diff --git a/maps/test_room.tscn b/maps/test_room.tscn index c91159c..119154e 100644 --- a/maps/test_room.tscn +++ b/maps/test_room.tscn @@ -2,29 +2,27 @@ [ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=1] [ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2] -[ext_resource path="res://tilesets/t_copper.tres" type="TileSet" id=3] +[ext_resource path="res://tilesets/t_canopy.tres" type="TileSet" id=3] [ext_resource path="res://objects/hud/hud.tscn" type="PackedScene" id=4] [ext_resource path="res://tilesets/t_death.tres" type="TileSet" id=5] [ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=6] -[ext_resource path="res://graphics/backgrounds/cave.png" type="Texture" id=8] +[ext_resource path="res://graphics/backgrounds/canopy.png" type="Texture" id=7] +[ext_resource path="res://objects/environment/ladder/ladder.tscn" type="PackedScene" id=8] [ext_resource path="res://objects/enemy/slime.tscn" type="PackedScene" id=10] [ext_resource path="res://maps/map.gd" type="Script" id=11] -[ext_resource path="res://audio/music/smokestack.mp3" type="AudioStream" id=12] [ext_resource path="res://objects/collectibles/arrow.tscn" type="PackedScene" id=13] [node name="Map" type="Node2D" groups=["map"]] script = ExtResource( 11 ) save_location = 420 -music = ExtResource( 12 ) [node name="Camera2D" parent="." instance=ExtResource( 6 )] current = false [node name="Sprite" type="Sprite" parent="Camera2D"] -modulate = Color( 0.862745, 0.054902, 0.054902, 1 ) position = Vector2( 128, 96 ) z_index = -2 -texture = ExtResource( 8 ) +texture = ExtResource( 7 ) __meta__ = { "_edit_lock_": true } @@ -36,22 +34,31 @@ tile_set = ExtResource( 3 ) cell_size = Vector2( 8, 8 ) collision_layer = 9 format = 1 -tile_data = PoolIntArray( 1245195, 0, 65536, 1245196, 0, 65537, 1245197, 0, 65537, 1245198, 0, 65538, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0 ) +tile_data = PoolIntArray( 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 65537, 1507329, 0, 65537, 1507330, 0, 65537, 1507331, 0, 65537, 1507332, 0, 65537, 1507333, 0, 65537, 1507334, 0, 65537, 1507335, 0, 65537, 1507336, 0, 65537, 1507337, 0, 65537, 1507338, 0, 65537, 1507339, 0, 65537, 1507340, 0, 65537, 1507341, 0, 65537, 1507342, 0, 65537, 1507343, 0, 65537, 1507344, 0, 65537, 1507345, 0, 65537, 1507346, 0, 65537, 1507347, 0, 65537, 1507348, 0, 65537, 1507349, 0, 65537, 1507350, 0, 65537, 1507351, 0, 65537, 1507352, 0, 65537, 1507353, 0, 65537, 1507354, 0, 65537, 1507355, 0, 65537, 1507356, 0, 65537, 1507357, 0, 65537, 1507358, 0, 65537, 1507359, 0, 65537 ) [node name="Slime" parent="." instance=ExtResource( 10 )] position = Vector2( 84, -7 ) [node name="Arrow" parent="." instance=ExtResource( 13 )] -position = Vector2( 77, 164 ) +position = Vector2( 184, 163 ) [node name="Player" parent="." instance=ExtResource( 1 )] position = Vector2( 64, 162 ) +[node name="Ladder2" parent="." instance=ExtResource( 8 )] +position = Vector2( 88, 136 ) +scale = Vector2( 1, 5 ) + +[node name="Ladder3" parent="." instance=ExtResource( 8 )] +position = Vector2( 40, 136 ) +scale = Vector2( 1, 5 ) + [node name="Ladder" type="TileMap" parent="."] tile_set = ExtResource( 2 ) cell_size = Vector2( 8, 8 ) collision_layer = 9 format = 1 +tile_data = PoolIntArray( 1114117, 0, 196610, 1114123, 0, 196610, 1179653, 0, 196608, 1179659, 0, 196608, 1245189, 0, 196608, 1245195, 0, 196608, 1310725, 0, 196608, 1310731, 0, 196608, 1376261, 0, 196609, 1376267, 0, 196609 ) [node name="Death" type="TileMap" parent="."] visible = false diff --git a/objects/environment/ladder/ladder.tscn b/objects/environment/ladder/ladder.tscn index ee3afff..80766f5 100644 --- a/objects/environment/ladder/ladder.tscn +++ b/objects/environment/ladder/ladder.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://objects/environment/ladder/ladder.gd" type="Script" id=1] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 8, 4 ) +extents = Vector2( 6, 4 ) [node name="Ladder" type="Node2D"] script = ExtResource( 1 ) diff --git a/objects/player/player.gd b/objects/player/player.gd index 707adf2..c17a16e 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -155,7 +155,13 @@ func _process_climb(): if Game.ac_climb.get_stream() != Game.a_climb_down: Game.play_sound(Game.a_climb_down,Game.ac_climb) if axis.y == 0: Game.ac_climb.set_stream(null) #Manual Jump,, only works when holding neutral or away from ladder - if axis.x != sprite.scale.x: check_jump() + if axis.x != sprite.scale.x && Input.is_action_just_pressed("jump"): + position.x -= sprite.scale.x * 3 + velocity.y = -jump_force + anims.set_speed_scale(1) + current_state = State.FALL + Game.ac_climb.set_stream(null) + return if climb_ray.get_collider() == null: if axis.y == -1: #Auto Jump @@ -165,6 +171,13 @@ func _process_climb(): Game.ac_climb.set_stream(null) current_state = State.FALL return + #Side dismount + if axis.x != sprite.scale.x && Input.is_action_just_pressed("shoot"): + position.x -= sprite.scale.x * 3 + current_state = State.FALL + anims.set_speed_scale(1) + Game.ac_climb.set_stream(null) + return func _process_sword(): @@ -201,7 +214,7 @@ func check_jump(): #Detach ladder if current_state == State.CLIMB: Game.ac_climb.set_stream(null) # stop climb sound - position.x -= sprite.scale.x * 5 + position.x -= sprite.scale.x * 3 else: dust_particles.restart() anims.set_speed_scale(1)