From 7b6d0197cde6d16447375003b96f78cffc3b345a Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Fri, 3 Mar 2023 23:05:31 -0500 Subject: [PATCH] pausing only possible in map.gd --- autoloads/game.gd | 7 -- graphics/secret/i_cant_take_it_anymore.png | Bin 0 -> 867 bytes .../secret/i_cant_take_it_anymore.png.import | 35 ++++++++ graphics/tiles/rust.png | Bin 2334 -> 2357 bytes maps/level_select.gd | 4 +- maps/map.gd | 9 +++ maps/rust.tscn | 76 ++++++++++++++---- project.godot | 9 +-- 8 files changed, 111 insertions(+), 29 deletions(-) create mode 100644 graphics/secret/i_cant_take_it_anymore.png create mode 100644 graphics/secret/i_cant_take_it_anymore.png.import diff --git a/autoloads/game.gd b/autoloads/game.gd index 73fe1e1..05803d8 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -132,9 +132,6 @@ func has_collection_bonus(): func _physics_process(delta): if Debug.entry == false: - # restart level - if Input.is_action_just_pressed("restart") && can_pause: - call_deferred("restart_level") #CRT FILTER if Input.is_action_just_pressed("crt"): viewport_container.material.set_shader_param("enabled",!viewport_container.material.get_shader_param("enabled")) @@ -145,7 +142,3 @@ func _physics_process(delta): OS.set_window_fullscreen(true) else: OS.set_window_fullscreen(false) - #Pause - if Input.is_action_just_pressed("pause") && can_pause && !get_tree().paused: - var viewport = get_parent().get_node("Main/Control/ViewportContainer/Viewport") - viewport.add_child(pause_screen.instance()) diff --git a/graphics/secret/i_cant_take_it_anymore.png b/graphics/secret/i_cant_take_it_anymore.png new file mode 100644 index 0000000000000000000000000000000000000000..07ac24757d14790f840097e8b61ac07e040fcbef GIT binary patch literal 867 zcmV-p1DyPcP)005u_0{{R3dEt5<00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj522e~?MgRZ*^)o_>bSKFG000SaNLh0L01m?d01m?e z$8V@)0008aNkluUVH7e z*Is+=wSU+kyKx%rAZ^SPT>UdF^Pvf`(9unc_1K5$;Ma*Q#UZet8sg-UFv{gdL)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hJkB@rMXW#A2?00000NkvXXu0mjfs|$EJ diff --git a/maps/level_select.gd b/maps/level_select.gd index 5f756f5..c801253 100644 --- a/maps/level_select.gd +++ b/maps/level_select.gd @@ -47,11 +47,11 @@ func _physics_process(delta): #Draw Shard Title shard_title.text = level.shard_titles[current_shard] #Select level - if Input.is_action_just_pressed("jump"): + if Input.is_action_just_pressed("ui_accept"): Game.current_level = current_level Game.change_map(level.scene) #Toggle lives mode - if Input.is_action_just_pressed("shoot"): + if Input.is_action_just_pressed("ui_cancel"): Game.use_lives = !Game.use_lives Save.set_options() if Game.use_lives: diff --git a/maps/map.gd b/maps/map.gd index 162ea18..ca998d1 100644 --- a/maps/map.gd +++ b/maps/map.gd @@ -17,6 +17,14 @@ func _ready(): Audio.play_music(music) func _physics_process(delta): + if Debug.entry == false && Game.can_pause: + #Pause + if Input.is_action_just_pressed("pause") && !get_tree().paused: + get_parent().add_child(Game.pause_screen.instance()) + # restart level + if Input.is_action_just_pressed("restart"): + call_deferred("restart_level") + if Game.golds == 50 && Game.shards == 5: #Time bonus collectible_bonus = true @@ -30,3 +38,4 @@ func _physics_process(delta): time_bonus = true else: time_bonus = false + diff --git a/maps/rust.tscn b/maps/rust.tscn index 73143ec..da3357f 100644 --- a/maps/rust.tscn +++ b/maps/rust.tscn @@ -1,13 +1,18 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://maps/map.gd" type="Script" id=1] [ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=2] [ext_resource path="res://graphics/backgrounds/rust.png" type="Texture" id=3] [ext_resource path="res://tilesets/t_rust.tres" type="TileSet" id=4] [ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=5] -[ext_resource path="res://objects/enemy/robosnake.tscn" type="PackedScene" id=6] +[ext_resource path="res://scripts/delete_on_game_running.gd" type="Script" id=6] [ext_resource path="res://objects/enemy/steam.tscn" type="PackedScene" id=7] -[ext_resource path="res://objects/environment/switches/button.tscn" type="PackedScene" id=8] +[ext_resource path="res://objects/environment/rock/rock.tscn" type="PackedScene" id=8] +[ext_resource path="res://objects/environment/turniwood/turning_platform.tscn" type="PackedScene" id=9] +[ext_resource path="res://graphics/secret/i_cant_take_it_anymore.png" type="Texture" id=10] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 4, 112 ) [node name="Map" type="Node2D" groups=["map"]] pause_mode = 1 @@ -25,29 +30,70 @@ __meta__ = { "_edit_lock_": true } -[node name="TileMap" type="TileMap" parent="."] +[node name="Ground" type="TileMap" parent="."] tile_set = ExtResource( 4 ) cell_size = Vector2( 8, 8 ) format = 1 -tile_data = PoolIntArray( 1245195, 0, 65537, 1245196, 0, 65537, 1245197, 0, 65537, 1245198, 0, 65537, 1441792, 0, 1, 1441793, 0, 2, 1441794, 0, 2, 1441795, 0, 2, 1441796, 0, 2, 1441797, 0, 2, 1441798, 0, 2, 1441799, 0, 2, 1441800, 0, 2, 1441801, 0, 2, 1441802, 0, 2, 1441803, 0, 2, 1441804, 0, 2, 1441805, 0, 2, 1441806, 0, 2, 1441807, 0, 2, 1441808, 0, 2, 1441809, 0, 2, 1441810, 0, 2, 1441811, 0, 2, 1441812, 0, 2, 1441813, 0, 2, 1441814, 0, 2, 1441815, 0, 2, 1441816, 0, 2, 1441817, 0, 2, 1441818, 0, 2, 1441819, 0, 2, 1441820, 0, 2, 1441821, 0, 2, 1441822, 0, 2, 1441823, 0, 2, 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( 589830, 0, 0, 655366, 0, 0, 720902, 0, 0, 786438, 0, 0, 851974, 0, 0, 917510, 0, 0, 917511, 0, 0, 917512, 0, 0, 917513, 0, 0, 917514, 0, 0, 917515, 0, 0, 917516, 0, 0, 917517, 0, 0, 917518, 0, 0, 917519, 0, 0, 1179661, 0, 65536, 1179662, 0, 65537, 1179663, 0, 65537, 1179664, 0, 65537, 1179665, 0, 131074, 1179666, 0, 65537, 1179667, 0, 65537, 1179668, 0, 65537, 1179669, 0, 65537, 1179670, 0, 131074, 1179671, 0, 65537, 1179672, 0, 65537, 1441792, 0, 1, 1441793, 0, 2, 1441794, 0, 2, 1441795, 0, 2, 1441796, 0, 2, 1441797, 0, 2, 1441798, 0, 2, 1441799, 0, 2, 1441800, 0, 2, 1441801, 0, 2, 1441802, 0, 2, 1441803, 0, 2, 1441804, 0, 2, 1441805, 0, 2, 1441806, 0, 2, 1441807, 0, 2, 1441808, 0, 2, 1441809, 0, 2, 1441810, 0, 2, 1441811, 0, 2, 1441812, 0, 2, 1441813, 0, 2, 1441814, 0, 2, 1441815, 0, 2, 1441816, 0, 2, 1441817, 0, 2, 1441818, 0, 2, 1441819, 0, 2, 1441820, 0, 2, 1441821, 0, 2, 1441822, 0, 2, 1441823, 0, 2, 1441824, 0, 2, 1441825, 0, 2, 1441826, 0, 2, 1441827, 0, 2, 1441828, 0, 2, 1441829, 0, 2, 1441830, 0, 2, 1441831, 0, 2, 1441832, 0, 2, 1441833, 0, 2, 1441834, 0, 2, 1441835, 0, 2, 1441836, 0, 2, 1441837, 0, 2, 1441838, 0, 2, 1441839, 0, 2, 1441840, 0, 2, 1441841, 0, 2, 1441842, 0, 2, 1441843, 0, 2, 1441844, 0, 2, 1441845, 0, 2, 1441846, 0, 2, 1441847, 0, 2, 1441848, 0, 2, 1441849, 0, 2, 1441850, 0, 2, 1441851, 0, 2, 1441852, 0, 2, 1441853, 0, 2, 1441854, 0, 2, 1441855, 0, 2, 1441856, 0, 2, 1441857, 0, 2, 1441858, 0, 2, 1441859, 0, 2, 1441860, 0, 2, 1441861, 0, 2, 1441862, 0, 2, 1441863, 0, 2, 1441864, 0, 2, 1441865, 0, 2, 1441866, 0, 2, 1441867, 0, 2, 1441868, 0, 2, 1441869, 0, 2, 1441870, 0, 2, 1441871, 0, 2, 1441872, 0, 2, 1441873, 0, 2, 1441874, 0, 2, 1441875, 0, 2, 1441876, 0, 2, 1441877, 0, 2, 1441878, 0, 2, 1441879, 0, 2, 1441880, 0, 2, 1441881, 0, 2, 1441882, 0, 2, 1441883, 0, 2, 1441884, 0, 2, 1441885, 0, 2, 1441886, 0, 2, 1441887, 0, 3, 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, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0, 1507384, 0, 0, 1507385, 0, 0, 1507386, 0, 0, 1507387, 0, 0, 1507388, 0, 0, 1507389, 0, 0, 1507390, 0, 0, 1507391, 0, 0, 1507392, 0, 0, 1507393, 0, 0, 1507394, 0, 0, 1507395, 0, 0, 1507396, 0, 0, 1507397, 0, 0, 1507398, 0, 0, 1507399, 0, 0, 1507400, 0, 0, 1507401, 0, 0, 1507402, 0, 0, 1507403, 0, 0, 1507404, 0, 0, 1507405, 0, 0, 1507406, 0, 0, 1507407, 0, 0, 1507408, 0, 0, 1507409, 0, 0, 1507410, 0, 0, 1507411, 0, 0, 1507412, 0, 0, 1507413, 0, 0, 1507414, 0, 0, 1507415, 0, 0, 1507416, 0, 0, 1507417, 0, 0, 1507418, 0, 0, 1507419, 0, 0, 1507420, 0, 0, 1507421, 0, 0, 1507422, 0, 0, 1507423, 0, 0 ) [node name="Player" parent="." instance=ExtResource( 5 )] position = Vector2( 48, 152 ) +[node name="Ladder" type="TileMap" parent="."] +tile_set = ExtResource( 4 ) +cell_size = Vector2( 8, 8 ) +format = 1 + +[node name="Environment" type="Node2D" parent="."] + +[node name="Rock" parent="Environment" instance=ExtResource( 8 )] +position = Vector2( 104, 104 ) + +[node name="TurningPlatform" parent="Environment" instance=ExtResource( 9 )] +position = Vector2( 80, 152 ) + [node name="Enemies" type="Node2D" parent="."] -[node name="RoboSnake" parent="Enemies" instance=ExtResource( 6 )] -position = Vector2( 232, 168 ) -left_up_boundry = 4.0 -right_down_boundry = 4.0 +[node name="Steam" parent="Enemies" instance=ExtResource( 7 )] +position = Vector2( 104, 152 ) +rotation = -1.57079 +off_time = 1.0 +on_time = 1.0 -[node name="Steam" parent="Enemies" groups=["button1"] instance=ExtResource( 7 )] -position = Vector2( 96, 152 ) +[node name="Steam2" parent="Enemies" instance=ExtResource( 7 )] +position = Vector2( 144, 152 ) +rotation = 3.14159 + +[node name="Steam3" parent="Enemies" instance=ExtResource( 7 )] +position = Vector2( 184, 152 ) +rotation = 3.14159 + +[node name="Collectibles" type="Node2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="."] -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] -polygon = PoolVector2Array( 145, 175, 183, 175, 184, 176, 184, 176, 144, 176, 144, 176 ) +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] +position = Vector2( -4, 96 ) +shape = SubResource( 1 ) -[node name="Button" parent="." instance=ExtResource( 8 )] -position = Vector2( 72, 168 ) +[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"] +position = Vector2( 772, 96 ) +shape = SubResource( 1 ) + +[node name="ColorRect" type="ColorRect" parent="."] +margin_left = 256.0 +margin_right = 512.0 +margin_bottom = 192.0 +color = Color( 0, 1, 0.227451, 0.0627451 ) +script = ExtResource( 6 ) + +[node name="ColorRect2" type="ColorRect" parent="."] +margin_left = 512.0 +margin_right = 768.0 +margin_bottom = 192.0 +color = Color( 1, 0.937255, 0, 0.0627451 ) +script = ExtResource( 6 ) + +[node name="ICantTakeItAnymore" type="Sprite" parent="."] +position = Vector2( -96, 96 ) +texture = ExtResource( 10 ) diff --git a/project.godot b/project.godot index ff67daf..0598ae2 100644 --- a/project.godot +++ b/project.godot @@ -87,7 +87,7 @@ ui_accept={ , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"physical_scancode":0,"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":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":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":88,"physical_scancode":0,"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":0,"physical_scancode":88,"unicode":0,"echo":false,"script":null) ] } ui_select={ @@ -95,7 +95,6 @@ ui_select={ "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,"physical_scancode":0,"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":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":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":0,"physical_scancode":88,"unicode":0,"echo":false,"script":null) ] } @@ -124,8 +123,8 @@ ui_down={ } jump={ "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":88,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":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":0,"physical_scancode":88,"unicode":0,"echo":false,"script":null) ] } debug_restart={ @@ -189,7 +188,7 @@ restart={ } sword={ "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":67,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"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":0,"physical_scancode":67,"unicode":0,"echo":false,"script":null) ] }