pausing only possible in map.gd

This commit is contained in:
pennyrigate 2023-03-03 23:05:31 -05:00
parent aa86cbc928
commit 7b6d0197cd
8 changed files with 111 additions and 29 deletions

View file

@ -132,9 +132,6 @@ func has_collection_bonus():
func _physics_process(delta): func _physics_process(delta):
if Debug.entry == false: if Debug.entry == false:
# restart level
if Input.is_action_just_pressed("restart") && can_pause:
call_deferred("restart_level")
#CRT FILTER #CRT FILTER
if Input.is_action_just_pressed("crt"): if Input.is_action_just_pressed("crt"):
viewport_container.material.set_shader_param("enabled",!viewport_container.material.get_shader_param("enabled")) 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) OS.set_window_fullscreen(true)
else: else:
OS.set_window_fullscreen(false) 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())

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/i_cant_take_it_anymore.png-a6fca862d5327d0a1d51b8c12a8aabc4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/secret/i_cant_take_it_anymore.png"
dest_files=[ "res://.import/i_cant_take_it_anymore.png-a6fca862d5327d0a1d51b8c12a8aabc4.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before After
Before After

View file

@ -47,11 +47,11 @@ func _physics_process(delta):
#Draw Shard Title #Draw Shard Title
shard_title.text = level.shard_titles[current_shard] shard_title.text = level.shard_titles[current_shard]
#Select level #Select level
if Input.is_action_just_pressed("jump"): if Input.is_action_just_pressed("ui_accept"):
Game.current_level = current_level Game.current_level = current_level
Game.change_map(level.scene) Game.change_map(level.scene)
#Toggle lives mode #Toggle lives mode
if Input.is_action_just_pressed("shoot"): if Input.is_action_just_pressed("ui_cancel"):
Game.use_lives = !Game.use_lives Game.use_lives = !Game.use_lives
Save.set_options() Save.set_options()
if Game.use_lives: if Game.use_lives:

View file

@ -17,6 +17,14 @@ func _ready():
Audio.play_music(music) Audio.play_music(music)
func _physics_process(delta): 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: if Game.golds == 50 && Game.shards == 5:
#Time bonus #Time bonus
collectible_bonus = true collectible_bonus = true
@ -30,3 +38,4 @@ func _physics_process(delta):
time_bonus = true time_bonus = true
else: else:
time_bonus = false time_bonus = false

View file

@ -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://maps/map.gd" type="Script" id=1]
[ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=2] [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://graphics/backgrounds/rust.png" type="Texture" id=3]
[ext_resource path="res://tilesets/t_rust.tres" type="TileSet" id=4] [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/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/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"]] [node name="Map" type="Node2D" groups=["map"]]
pause_mode = 1 pause_mode = 1
@ -25,29 +30,70 @@ __meta__ = {
"_edit_lock_": true "_edit_lock_": true
} }
[node name="TileMap" type="TileMap" parent="."] [node name="Ground" type="TileMap" parent="."]
tile_set = ExtResource( 4 ) tile_set = ExtResource( 4 )
cell_size = Vector2( 8, 8 ) cell_size = Vector2( 8, 8 )
format = 1 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 )] [node name="Player" parent="." instance=ExtResource( 5 )]
position = Vector2( 48, 152 ) 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="Enemies" type="Node2D" parent="."]
[node name="RoboSnake" parent="Enemies" instance=ExtResource( 6 )] [node name="Steam" parent="Enemies" instance=ExtResource( 7 )]
position = Vector2( 232, 168 ) position = Vector2( 104, 152 )
left_up_boundry = 4.0 rotation = -1.57079
right_down_boundry = 4.0 off_time = 1.0
on_time = 1.0
[node name="Steam" parent="Enemies" groups=["button1"] instance=ExtResource( 7 )] [node name="Steam2" parent="Enemies" instance=ExtResource( 7 )]
position = Vector2( 96, 152 ) 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="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
polygon = PoolVector2Array( 145, 175, 183, 175, 184, 176, 184, 176, 144, 176, 144, 176 ) position = Vector2( -4, 96 )
shape = SubResource( 1 )
[node name="Button" parent="." instance=ExtResource( 8 )] [node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2( 72, 168 ) 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 )

View file

@ -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":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(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(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={ 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) "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(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":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) , 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={ jump={
"deadzone": 0.5, "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) "events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
, 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={ debug_restart={
@ -189,7 +188,7 @@ restart={
} }
sword={ sword={
"deadzone": 0.5, "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)
] ]
} }