diff --git a/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png b/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png new file mode 100644 index 0000000..c842fd4 Binary files /dev/null and b/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png differ diff --git a/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png.import b/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png.import new file mode 100644 index 0000000..d937bed --- /dev/null +++ b/assets/environment/blocks/basic_tileset_blobb-jakob-remix.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/basic_tileset_blobb-jakob-remix.png-13582a1ad77f1898911d8c065e575215.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/environment/blocks/basic_tileset_blobb-jakob-remix.png" +dest_files=[ "res://.import/basic_tileset_blobb-jakob-remix.png-13582a1ad77f1898911d8c065e575215.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=false +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=false +svg/scale=1.0 diff --git a/assets/environment/galletcity_tiles.png b/assets/environment/galletcity_tiles.png deleted file mode 100644 index 8d24ad7..0000000 Binary files a/assets/environment/galletcity_tiles.png and /dev/null differ diff --git a/assets/ui/Screenshot 2023-05-23 160521.png b/assets/ui/Screenshot 2023-05-23 160521.png new file mode 100644 index 0000000..da2510d Binary files /dev/null and b/assets/ui/Screenshot 2023-05-23 160521.png differ diff --git a/assets/environment/galletcity_tiles.png.import b/assets/ui/Screenshot 2023-05-23 160521.png.import similarity index 66% rename from assets/environment/galletcity_tiles.png.import rename to assets/ui/Screenshot 2023-05-23 160521.png.import index e6a0b33..b348662 100644 --- a/assets/environment/galletcity_tiles.png.import +++ b/assets/ui/Screenshot 2023-05-23 160521.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/galletcity_tiles.png-9e378740b558af86060a286a7fa827d0.stex" +path="res://.import/Screenshot 2023-05-23 160521.png-6de2cfec0cf07091a47ad2ca582bc327.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/environment/galletcity_tiles.png" -dest_files=[ "res://.import/galletcity_tiles.png-9e378740b558af86060a286a7fa827d0.stex" ] +source_file="res://assets/ui/Screenshot 2023-05-23 160521.png" +dest_files=[ "res://.import/Screenshot 2023-05-23 160521.png-6de2cfec0cf07091a47ad2ca582bc327.stex" ] [params] diff --git a/project.godot b/project.godot index 571fe74..b0205d9 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://src/Actors/Enemies/Beings/Enemy.gd" }, { +"base": "Resource", +"class": "GlobalStateResource", +"language": "GDScript", +"path": "res://src/Utilities/GlobalStateResource.gd" +}, { "base": "Node2D", "class": "LevelTemplate", "language": "GDScript", @@ -42,6 +47,7 @@ _global_script_classes=[ { _global_script_class_icons={ "Actor": "", "Enemy": "", +"GlobalStateResource": "", "LevelTemplate": "", "RayCastDebugLines": "", "RayCaster": "", @@ -57,6 +63,7 @@ config/icon="res://icon.png" [autoload] GlobalState="*res://src/Autoload/GlobalState.tscn" +SaveManager="*res://src/Autoload/SaveManager.gd" [debug] @@ -69,7 +76,7 @@ window/size/height=360 window/size/test_width=1920 window/size/test_height=1080 window/stretch/mode="2d" -window/stretch/aspect="keep" +window/stretch/aspect="expand" [editor_plugins] @@ -115,7 +122,6 @@ ogg_vorbis={ ui_accept={ "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":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":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) ] diff --git a/savefile.tres b/savefile.tres new file mode 100644 index 0000000..10cec0c --- /dev/null +++ b/savefile.tres @@ -0,0 +1,187 @@ +[gd_resource type="Resource" load_steps=50 format=2] + +[ext_resource path="res://src/Utilities/GlobalStateResource.gd" type="Script" id=1] + +[sub_resource type="InputEventKey" id=1] +scancode = 16777237 + +[sub_resource type="InputEventJoypadButton" id=2] +button_index = 1 + +[sub_resource type="InputEventMouseButton" id=3] +button_index = 1 + +[sub_resource type="InputEventJoypadButton" id=4] +button_index = 13 + +[sub_resource type="InputEventJoypadMotion" id=5] +axis = 1 +axis_value = 1.0 + +[sub_resource type="InputEventKey" id=6] +physical_scancode = 83 + +[sub_resource type="InputEventKey" id=7] +physical_scancode = 16777234 + +[sub_resource type="InputEventKey" id=8] +physical_scancode = 69 + +[sub_resource type="InputEventKey" id=9] +physical_scancode = 16777221 + +[sub_resource type="InputEventJoypadButton" id=10] +button_index = 2 + +[sub_resource type="InputEventKey" id=11] +scancode = 32 + +[sub_resource type="InputEventJoypadButton" id=12] + +[sub_resource type="InputEventKey" id=13] +physical_scancode = 16777232 + +[sub_resource type="InputEventJoypadMotion" id=14] +axis_value = -1.0 + +[sub_resource type="InputEventKey" id=15] +scancode = 65 + +[sub_resource type="InputEventJoypadButton" id=16] +device = -1 +button_index = 14 + +[sub_resource type="InputEventKey" id=17] +physical_scancode = 16777231 + +[sub_resource type="InputEventKey" id=18] +scancode = 68 + +[sub_resource type="InputEventJoypadMotion" id=19] +axis_value = 1.0 + +[sub_resource type="InputEventJoypadButton" id=20] +device = -1 +button_index = 15 + +[sub_resource type="InputEventKey" id=21] +physical_scancode = 16777233 + +[sub_resource type="InputEventKey" id=22] +scancode = 16777217 + +[sub_resource type="InputEventJoypadButton" id=23] +button_index = 11 + +[sub_resource type="InputEventKey" id=24] +scancode = 16777221 + +[sub_resource type="InputEventKey" id=25] +scancode = 32 + +[sub_resource type="InputEventJoypadButton" id=26] + +[sub_resource type="InputEventKey" id=27] +scancode = 16777217 + +[sub_resource type="InputEventJoypadButton" id=28] +button_index = 1 + +[sub_resource type="InputEventKey" id=29] +scancode = 16777234 + +[sub_resource type="InputEventJoypadButton" id=30] +button_index = 13 + +[sub_resource type="InputEventKey" id=31] +scancode = 16777230 + +[sub_resource type="InputEventKey" id=32] +scancode = 16777218 + +[sub_resource type="InputEventKey" id=33] +shift = true +scancode = 16777218 + +[sub_resource type="InputEventKey" id=34] +scancode = 16777229 + +[sub_resource type="InputEventKey" id=35] +scancode = 16777231 + +[sub_resource type="InputEventJoypadButton" id=36] +button_index = 14 + +[sub_resource type="InputEventKey" id=37] +scancode = 16777236 + +[sub_resource type="InputEventKey" id=38] +scancode = 16777235 + +[sub_resource type="InputEventKey" id=39] +scancode = 16777233 + +[sub_resource type="InputEventJoypadButton" id=40] +button_index = 15 + +[sub_resource type="InputEventKey" id=41] +scancode = 32 + +[sub_resource type="InputEventJoypadButton" id=42] +button_index = 3 + +[sub_resource type="InputEventKey" id=43] +scancode = 16777232 + +[sub_resource type="InputEventJoypadButton" id=44] +button_index = 12 + +[sub_resource type="InputEventKey" id=45] +physical_scancode = 87 + +[sub_resource type="InputEventKey" id=46] +physical_scancode = 16777232 + +[sub_resource type="InputEventJoypadMotion" id=47] +axis = 1 +axis_value = -1.0 + +[sub_resource type="InputEventJoypadButton" id=48] +button_index = 12 + +[resource] +script = ExtResource( 1 ) +progress_dict = { +"Level 1": { +"currency": 0, +"deaths": 0, +"frees": 0, +"kills": 0 +} +} +wallet = 0 +input_map = { +"boost_move": [ SubResource( 1 ), SubResource( 2 ) ], +"click": [ SubResource( 3 ) ], +"duck": [ SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ], +"interact": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ], +"jump": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ], +"move_left": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ], +"move_right": [ SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ) ], +"pause": [ SubResource( 22 ), SubResource( 23 ) ], +"ui_accept": [ SubResource( 24 ), SubResource( 25 ), SubResource( 26 ) ], +"ui_cancel": [ SubResource( 27 ), SubResource( 28 ) ], +"ui_down": [ SubResource( 29 ), SubResource( 30 ) ], +"ui_end": [ SubResource( 31 ) ], +"ui_focus_next": [ SubResource( 32 ) ], +"ui_focus_prev": [ SubResource( 33 ) ], +"ui_home": [ SubResource( 34 ) ], +"ui_left": [ SubResource( 35 ), SubResource( 36 ) ], +"ui_page_down": [ SubResource( 37 ) ], +"ui_page_up": [ SubResource( 38 ) ], +"ui_right": [ SubResource( 39 ), SubResource( 40 ) ], +"ui_select": [ SubResource( 41 ), SubResource( 42 ) ], +"ui_up": [ SubResource( 43 ), SubResource( 44 ) ], +"up": [ SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ) ] +} +show_tutorial = false diff --git a/src/Actors/Actor.gd b/src/Actors/Actor.gd index bd06c48..08a9d40 100644 --- a/src/Actors/Actor.gd +++ b/src/Actors/Actor.gd @@ -3,8 +3,8 @@ class_name Actor #TODO Split the blobby specific parts up from this -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") const PhysicsConst = preload("res://src/Utilities/Physic/PhysicsConst.gd") diff --git a/src/Actors/BlobbyCam.tscn b/src/Actors/BlobbyCam.tscn index 383b9c7..d7bfc1e 100644 --- a/src/Actors/BlobbyCam.tscn +++ b/src/Actors/BlobbyCam.tscn @@ -980,10 +980,10 @@ texture = ExtResource( 8 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"] visible = false frames = SubResource( 7 ) -frame = 1 +frame = 13 playing = true [node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"] frames = SubResource( 8 ) -frame = 6 +frame = 4 playing = true diff --git a/src/Actors/Enemies/Beings/BoundFrog.gd b/src/Actors/Enemies/Beings/BoundFrog.gd index 7d3440e..9c3d298 100644 --- a/src/Actors/Enemies/Beings/BoundFrog.gd +++ b/src/Actors/Enemies/Beings/BoundFrog.gd @@ -3,8 +3,8 @@ extends Node2D # Is given in blocks export var movement_radius = 6 onready var tilemap: TileMap = $"%TileMap" -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") var Rope = preload("res://src/Contraptions/Rope/Rope.tscn") var RopeAnchor = preload("res://src/Contraptions/Rope/RopeAnchor.tscn") diff --git a/src/Autoload/GlobalState.gd b/src/Autoload/GlobalState.gd deleted file mode 100644 index 874ad82..0000000 --- a/src/Autoload/GlobalState.gd +++ /dev/null @@ -1,30 +0,0 @@ -extends Node - -var progress_dict := {} setget set_progress, get_progress -var wallet := 0 setget set_wallet - -func set_progress(value) -> void: - progress_dict = value - -func get_progress() -> Dictionary: - return progress_dict - -func set_savepoint(levelName: String, position: Vector2) -> void: - if(!progress_dict.has(levelName)): - progress_dict[levelName] = {} - progress_dict[levelName]["savepoint"] = position - -func get_property_value(levelName: String, propertyName: String) -> int: - if progress_dict.has(levelName) && progress_dict[levelName].has(propertyName): - return progress_dict[levelName][propertyName] - else: - return 0 - -func get_savepoint(levelName: String) -> Vector2: - if progress_dict.has(levelName) && progress_dict[levelName].has("savepoint"): - return progress_dict[levelName]["savepoint"] - else: - return Vector2() - -func set_wallet(value) -> void: - wallet = value diff --git a/src/Autoload/GlobalState.tscn b/src/Autoload/GlobalState.tscn index f107903..287ac0d 100644 --- a/src/Autoload/GlobalState.tscn +++ b/src/Autoload/GlobalState.tscn @@ -1,6 +1,17 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=4 format=2] -[ext_resource path="res://src/Autoload/GlobalState.gd" type="Script" id=1] +[ext_resource path="res://src/Utilities/GlobalState.gd" type="Script" id=1] +[ext_resource path="res://src/Utilities/GlobalStateResource.gd" type="Script" id=2] + +[sub_resource type="Resource" id=1] +script = ExtResource( 2 ) +progress_dict = { +} +wallet = 0 +input_map = { +} +show_tutorial = false [node name="GlobalState" type="Node"] script = ExtResource( 1 ) +gsr = SubResource( 1 ) diff --git a/src/Autoload/InputMapLoader.tscn b/src/Autoload/InputMapLoader.tscn new file mode 100644 index 0000000..fbdaf18 --- /dev/null +++ b/src/Autoload/InputMapLoader.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/Utilities/InputMapLoader.gd" type="Script" id=1] + +[node name="InputMapLoader" type="Node"] +script = ExtResource( 1 ) diff --git a/src/Autoload/SaveManager.gd b/src/Autoload/SaveManager.gd new file mode 100644 index 0000000..b21abbb --- /dev/null +++ b/src/Autoload/SaveManager.gd @@ -0,0 +1,19 @@ +extends Node + +export var save_location: String = "res://savefile.tres" +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") + +func _ready() -> void: + load_initial_save() + +func load_initial_save() -> void: + var initial_state = load(save_location) + if !initial_state: + initial_state = GlobalStateResource.new() + GlobalState.gsr = initial_state + GlobalState.reinstate() + +func save_default() -> void: + for action in InputMap.get_actions(): + GlobalState.gsr.input_map[action] = InputMap.get_action_list(action) + ResourceSaver.save(save_location, GlobalState.gsr) diff --git a/src/Autoload/SaveManager.tscn b/src/Autoload/SaveManager.tscn new file mode 100644 index 0000000..eb78244 --- /dev/null +++ b/src/Autoload/SaveManager.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/Autoload/SaveManager.gd" type="Script" id=1] + +[node name="SaveManager" type="Node"] +script = ExtResource( 1 ) diff --git a/src/BenefitialObjects/SavePoint.gd b/src/BenefitialObjects/SavePoint.gd index 296f8df..08e1136 100644 --- a/src/BenefitialObjects/SavePoint.gd +++ b/src/BenefitialObjects/SavePoint.gd @@ -1,6 +1,6 @@ extends Node2D -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") func _ready() -> void: if(GlobalState.get_savepoint(levelState.levelName) == global_position + Vector2(0,18)): diff --git a/src/Contraptions/GateBlock.gd b/src/Contraptions/GateBlock.gd index 8d33c61..c7408db 100644 --- a/src/Contraptions/GateBlock.gd +++ b/src/Contraptions/GateBlock.gd @@ -1,7 +1,7 @@ extends StaticBody2D -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") export var locked := true diff --git a/src/Contraptions/Portal/Portal.gd b/src/Contraptions/Portal/Portal.gd index 957403a..4ffdbcd 100644 --- a/src/Contraptions/Portal/Portal.gd +++ b/src/Contraptions/Portal/Portal.gd @@ -2,8 +2,8 @@ tool extends Area2D onready var anim_player: AnimationPlayer = $AnimationPlayer -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") onready var levelName := get_tree().get_current_scene().get_name() export(String, FILE, "*.tscn") var next_scene diff --git a/src/Contraptions/Triggers/ElevatorButton.gd b/src/Contraptions/Triggers/ElevatorButton.gd index c8d55b1..6e18769 100644 --- a/src/Contraptions/Triggers/ElevatorButton.gd +++ b/src/Contraptions/Triggers/ElevatorButton.gd @@ -4,7 +4,7 @@ onready var buttonPlayer = $"%ButtonPlayer" onready var activatorArea = $"%ActivatorArea" onready var indicatorPlayer = $"%IndicatorPlayer" onready var elevator = get_node("./Portal") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") onready var unactivatable_timer := $Timer onready var get_back_timer := $GetBackTimer diff --git a/src/Contraptions/VendingMachine.gd b/src/Contraptions/VendingMachine.gd index 95790cf..b4394de 100644 --- a/src/Contraptions/VendingMachine.gd +++ b/src/Contraptions/VendingMachine.gd @@ -1,8 +1,8 @@ extends Node2D onready var activatorArea = $"%ActivatorArea" -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") onready var blobby := $"../%Blobby" onready var unactivatable_timer := $Timer export var cost := 3 diff --git a/src/Environment/Tileset.tres b/src/Environment/Tileset.tres new file mode 100644 index 0000000..a4b3d3a --- /dev/null +++ b/src/Environment/Tileset.tres @@ -0,0 +1,29 @@ +[gd_resource type="TileSet" load_steps=3 format=2] + +[ext_resource path="res://assets/environment/blocks/GreenhouseInner.png" type="Texture" id=1] + +[sub_resource type="ConvexPolygonShape2D" id=5] +points = PoolVector2Array( 0, 24, 24, 24, 24, 0, 0, 0 ) + +[resource] +0/name = "GreenhouseInner.png 0" +0/texture = ExtResource( 1 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 24, 24 ) +0/tile_mode = 0 +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( 5 ) +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( 5 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 diff --git a/src/Levels/1 Tut Level.tscn b/src/Levels/1 Tut Level.tscn index 76e15cb..cfb142d 100644 --- a/src/Levels/1 Tut Level.tscn +++ b/src/Levels/1 Tut Level.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=1] [ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=2] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=4] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=5] +[ext_resource path="res://assets/environment/blocks/basic_tileset_blobb-jakob-remix.png" type="Texture" id=6] [ext_resource path="res://src/Environment/ShaderGrass.tscn" type="PackedScene" id=7] [ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=8] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=9] @@ -12,6 +13,74 @@ [sub_resource type="AnimationNodeStateMachinePlayback" id=4] +[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="TileSet" id=11] +0/name = "basic_tileset_blobb-jakob-remix.png 0" +0/texture = ExtResource( 6 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 16, 0, 16, 16 ) +0/tile_mode = 1 +0/autotile/bitmask_mode = 0 +0/autotile/bitmask_flags = [ ] +0/autotile/icon_coordinate = Vector2( 0, 0 ) +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( 12 ) +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( 12 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 +1/name = "basic_tileset_blobb-jakob-remix.png 1" +1/texture = ExtResource( 6 ) +1/tex_offset = Vector2( 0, 0 ) +1/modulate = Color( 1, 1, 1, 1 ) +1/region = Rect2( 32, 0, 16, 16 ) +1/tile_mode = 1 +1/autotile/bitmask_mode = 0 +1/autotile/bitmask_flags = [ ] +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( 13 ) +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( 13 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +1/z_index = 0 + [node name="Level 1" type="Node2D"] script = ExtResource( 10 ) __meta__ = { @@ -43,8 +112,11 @@ visible = true [node name="Emitter3" parent="BlobbyCam/ParallaxBackground/ParallaxLayer4" index="1"] visible = true +[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] +frame = 2 + [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 4 +frame = 5 [node name="Blobby" parent="." instance=ExtResource( 9 )] unique_name_in_owner = true @@ -354,6 +426,13 @@ scale = Vector2( 1, 1.5 ) position = Vector2( 240, -7 ) scale = Vector2( 1, 1.5 ) +[node name="TileMap2" type="TileMap" parent="."] +tile_set = SubResource( 11 ) +cell_size = Vector2( 16, 16 ) +cell_quadrant_size = 8 +cell_custom_transform = Transform2D( 16, 0, 0, 16, 0, 0 ) +format = 1 + [connection signal="body_exited" from="Blobby/BlobbySkin" to="Blobby" method="_on_BlobbySkin_body_exited"] [editable path="SignalManager"] diff --git a/src/Levels/2 Tut Level.tscn b/src/Levels/2 Tut Level.tscn index 2045735..c1ab5cf 100644 --- a/src/Levels/2 Tut Level.tscn +++ b/src/Levels/2 Tut Level.tscn @@ -108,7 +108,7 @@ collision_layer = 8 collision_mask = 8 bake_navigation = true format = 1 -tile_data = PoolIntArray( -1310652, 7, 0, -1310651, -1610612729, 0, -1245116, -1073741822, 0, -1245115, -1610612734, 0, -1179580, -1073741822, 0, -1179579, -1610612734, 0, -1114044, -1073741822, 0, -1114043, -1610612734, 0, -1048508, -1073741822, 0, -1048507, -1610612734, 0, -1048418, -1073741822, 0, -1048417, -1073741814, 0, -1048416, 11, 0, -917510, -1073741813, 0, -917509, -1610612726, 0, -917508, -1610612734, 0, -982972, -1073741822, 0, -982971, -1610612734, 0, -982882, -1073741822, 0, -982881, -1073741814, 0, -982880, 11, 0, -851974, -1073741813, 0, -851973, -1610612726, 0, -851972, -1610612734, 0, -917436, -1073741822, 0, -917435, -1610612734, 0, -917346, -1073741822, 0, -917345, -1073741814, 0, -917344, 11, 0, -786438, -1073741813, 0, -786437, -1610612726, 0, -786436, -1610612734, 0, -851900, -1073741822, 0, -851899, -1610612734, 0, -851810, -1073741822, 0, -851809, -1073741814, 0, -851808, 11, 0, -720902, -1073741813, 0, -720901, -1610612726, 0, -720900, -1610612734, 0, -786364, -1073741822, 0, -786363, -1610612734, 0, -786274, -1073741822, 0, -786273, -1073741814, 0, -786272, 11, 0, -655366, -1073741813, 0, -655365, -1610612726, 0, -655364, -1610612734, 0, -720842, 7, 0, -720841, 2, 0, -720840, 2, 0, -720828, -1073741822, 0, -720827, -1610612734, 0, -720738, -1073741822, 0, -720737, -1073741814, 0, -720736, 11, 0, -589830, -1073741813, 0, -589829, -1610612726, 0, -589828, -1610612734, 0, -655306, -1073741822, 0, -655305, -1610612734, 0, -655292, -1073741817, 0, -655291, 1610612743, 0, -655202, -1073741822, 0, -655201, -1073741814, 0, -655200, 11, 0, -524294, -1073741813, 0, -524293, -1610612726, 0, -524292, -1610612734, 0, -589770, -1073741822, 0, -589769, -1610612734, 0, -589761, 7, 0, -589760, -1610612729, 0, -589666, -1073741822, 0, -589665, -1073741814, 0, -589664, 11, 0, -458758, 11, 0, -458757, -1610612726, 0, -458756, -1610612734, 0, -524234, -1073741822, 0, -524233, 1610612739, 0, -524232, 2, 0, -524231, 2, 0, -524225, -1073741822, 0, -524224, -1610612734, 0, -524159, 7, 0, -524158, 2, 0, -524157, 2, 0, -524156, 2, 0, -524155, -1610612729, 0, -524149, 7, 0, -524148, 2, 0, -524147, 2, 0, -524146, 2, 0, -524145, 2, 0, -524144, -1610612729, 0, -524130, -1073741822, 0, -524129, -1073741814, 0, -524128, 11, 0, -393222, 11, 0, -393221, -1610612726, 0, -393220, -1610612734, 0, -458698, -1073741822, 0, -458697, -1610612734, 0, -458689, -1073741822, 0, -458688, -1610612734, 0, -458625, 7, 0, -458624, 2, 0, -458623, 1610612739, 0, -458622, 1610612738, 0, -458621, 1610612738, 0, -458620, 1610612738, 0, -458619, 1610612743, 0, -458613, -1073741817, 0, -458612, 1610612738, 0, -458611, 1610612738, 0, -458610, 1610612738, 0, -458609, 1610612738, 0, -458608, -1610612733, 0, -458607, -1610612729, 0, -458594, -1073741822, 0, -458593, -1073741814, 0, -458592, 11, 0, -327686, 11, 0, -327685, -1610612726, 0, -327684, -1610612734, 0, -393162, -1073741822, 0, -393161, -1610612734, 0, -393155, 2, 0, -393154, 2, 0, -393153, 1610612739, 0, -393152, -1610612734, 0, -393120, 2, 0, -393119, 2, 0, -393118, 2, 0, -393093, 7, 0, -393092, 2, 0, -393091, 2, 0, -393090, 2, 0, -393089, 1610612739, 0, -393088, 1610612739, 0, -393087, 1610612743, 0, -393072, -1073741822, 0, -393071, -1610612734, 0, -393058, -1073741822, 0, -393057, -1073741814, 0, -393056, 11, 0, -262150, 11, 0, -262149, -1610612726, 0, -262148, -1610612734, 0, -327647, 7, 0, -327646, 2, 0, -327645, -1610612729, 0, -327626, -1073741822, 0, -327625, -1610612734, 0, -327617, -1073741822, 0, -327616, -1610612734, 0, -327557, -1073741822, 0, -327556, 1610612739, 0, -327555, 1610612739, 0, -327554, 1610612739, 0, -327553, 1610612739, 0, -327552, -1610612734, 0, -327536, -1073741822, 0, -327535, -1610612734, 0, -327522, -1073741822, 0, -327521, -1073741814, 0, -327520, 11, 0, -196614, 11, 0, -196613, -1610612726, 0, -196612, -1610612734, 0, -262111, -1073741822, 0, -262110, 1, 0, -262109, -1610612734, 0, -262090, -1073741822, 0, -262089, 1610612739, 0, -262088, 2, 0, -262087, 2, 0, -262081, -1073741822, 0, -262080, -1610612734, 0, -262041, 7, 0, -262040, -1610612729, 0, -262025, 7, 0, -262024, 2, 0, -262023, 2, 0, -262022, 2, 0, -262021, 1610612739, 0, -262020, 1610612739, 0, -262019, 1610612739, 0, -262018, 1610612739, 0, -262017, 1610612739, 0, -262016, -1610612734, 0, -262000, -1073741822, 0, -261999, -1610612734, 0, -261986, -1073741822, 0, -261985, -1073741814, 0, -261984, 11, 0, -131078, 11, 0, -131077, -1610612726, 0, -131076, -1610612734, 0, -196583, 2, 0, -196582, 2, 0, -196581, 2, 0, -196580, 2, 0, -196579, 2, 0, -196575, -1073741822, 0, -196574, 3, 0, -196573, -1610612734, 0, -196554, -1073741822, 0, -196553, -1610612734, 0, -196545, -1073741822, 0, -196544, -1610612734, 0, -196522, 7, 0, -196521, 2, 0, -196520, 2, 0, -196519, -1610612729, 0, -196513, 7, 0, -196512, 2, 0, -196511, 2, 0, -196510, 2, 0, -196509, -1610612729, 0, -196505, -1073741817, 0, -196504, 1610612743, 0, -196494, 7, 0, -196493, 2, 0, -196492, 2, 0, -196491, 2, 0, -196490, 2, 0, -196489, 1610612739, 0, -196488, 1610612739, 0, -196487, 1610612739, 0, -196486, 1610612739, 0, -196485, 1610612739, 0, -196484, 1610612739, 0, -196483, 1610612739, 0, -196482, 1610612739, 0, -196481, 1610612739, 0, -196480, -1610612734, 0, -196464, -1073741822, 0, -196463, -1610612734, 0, -196450, -1073741822, 0, -196449, -1073741814, 0, -196448, 11, 0, -65542, 11, 0, -65541, -1610612726, 0, -65540, -1610612734, 0, -131039, -1073741822, 0, -131038, 1, 0, -131037, -1610612734, 0, -131032, 7, 0, -131031, 2, 0, -131030, 2, 0, -131029, -1610612729, 0, -131018, -1073741817, 0, -131017, 1610612743, 0, -131011, 2, 0, -131010, 2, 0, -131009, 1610612739, 0, -131008, -1610612734, 0, -130989, 7, 0, -130988, 2, 0, -130987, 2, 0, -130986, 3, 0, -130985, 3, 0, -130984, 3, 0, -130983, 3, 0, -130982, 2, 0, -130981, 2, 0, -130980, 2, 0, -130979, 2, 0, -130978, 2, 0, -130977, 3, 0, -130976, 3, 0, -130975, 3, 0, -130974, 3, 0, -130973, -1610612734, 0, -130960, 7, 0, -130959, 2, 0, -130958, 1610612738, 0, -130957, 1610612738, 0, -130956, 1610612738, 0, -130955, 1610612738, 0, -130954, 1610612738, 0, -130953, 1610612738, 0, -130952, 1610612738, 0, -130951, 1610612738, 0, -130950, 1610612738, 0, -130949, 1610612738, 0, -130948, 1610612738, 0, -130947, 1610612738, 0, -130946, 1610612738, 0, -130945, 1610612738, 0, -130944, 1610612743, 0, -130928, -1073741817, 0, -130927, 1610612743, 0, -130914, -1073741822, 0, -130913, -1073741814, 0, -130912, 11, 0, -6, 11, 0, -5, -1610612726, 0, -4, -1610612734, 0, -65517, 7, 0, -65516, 2, 0, -65515, 2, 0, -65514, -1610612729, 0, -65503, -1073741822, 0, -65502, 3, 0, -65501, -1610612734, 0, -65496, -1073741822, 0, -65495, 3, 0, -65494, 3, 0, -65493, -1610612734, 0, -65473, -1073741822, 0, -65472, -1610612734, 0, -65457, 7, 0, -65456, 2, 0, -65455, 2, 0, -65454, 2, 0, -65453, 3, 0, -65452, 3, 0, -65451, 3, 0, -65450, 3, 0, -65449, 3, 0, -65448, 3, 0, -65447, 3, 0, -65446, 3, 0, -65445, 3, 0, -65444, 3, 0, -65443, 3, 0, -65442, 3, 0, -65441, 3, 0, -65440, 3, 0, -65439, 3, 0, -65438, 3, 0, -65437, -1610612734, 0, -65378, -1073741822, 0, -65377, -1073741814, 0, -65376, 11, 0, 65530, 11, 0, 65531, -1610612726, 0, 65532, 1610612739, 0, 65533, 2, 0, 65534, 2, 0, 65535, 2, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 5, 2, 0, 6, 2, 0, 7, 2, 0, 8, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 12, 2, 0, 13, 2, 0, 14, 2, 0, 15, 2, 0, 16, 2, 0, 17, 2, 0, 18, 2, 0, 19, 3, 0, 20, 3, 0, 21, 3, 0, 22, 1610612739, 0, 23, 2, 0, 24, 2, 0, 25, 2, 0, 26, 2, 0, 27, 2, 0, 28, 2, 0, 29, 2, 0, 30, 2, 0, 31, 2, 0, 32, 2, 0, 33, 3, 0, 34, 1, 0, 35, -1610612734, 0, 40, -1073741822, 0, 41, 3, 0, 42, 3, 0, 43, 3, 0, 44, 2, 0, 45, 2, 0, 46, 2, 0, 47, 2, 0, 48, 2, 0, 49, 2, 0, 50, 2, 0, 51, 2, 0, 52, 2, 0, 53, 2, 0, 54, 2, 0, 55, 2, 0, 56, 2, 0, 57, 2, 0, 58, 2, 0, 59, 2, 0, 60, 2, 0, 61, 2, 0, 62, 2, 0, 63, 3, 0, 64, 3, 0, 65, 2, 0, 66, 2, 0, 67, 2, 0, 68, 2, 0, 69, 2, 0, 70, 2, 0, 71, 2, 0, 72, 2, 0, 73, 2, 0, 74, 2, 0, 75, 2, 0, 76, 2, 0, 77, 2, 0, 78, 2, 0, 79, 3, 0, 80, 3, 0, 81, 3, 0, 82, 3, 0, 83, 3, 0, 84, 1610612739, 0, 85, 1610612739, 0, 86, 1610612739, 0, 87, 1610612739, 0, 88, 1610612739, 0, 89, 1610612739, 0, 90, 1610612739, 0, 91, 1610612739, 0, 92, 1610612739, 0, 93, 1610612739, 0, 94, 1610612739, 0, 95, 1610612739, 0, 96, 1610612739, 0, 97, 1610612739, 0, 98, 1610612739, 0, 99, 1610612739, 0, 100, 2, 0, 101, 2, 0, 102, 2, 0, 103, 2, 0, 104, 2, 0, 105, 2, 0, 106, 2, 0, 107, 2, 0, 108, 2, 0, 109, 2, 0, 110, 2, 0, 111, 2, 0, 112, 2, 0, 113, 2, 0, 114, 2, 0, 115, 2, 0, 116, 2, 0, 117, 2, 0, 118, 2, 0, 119, 2, 0, 120, 2, 0, 121, 2, 0, 122, 2, 0, 123, 2, 0, 124, 2, 0, 125, 2, 0, 126, 2, 0, 127, 2, 0, 128, 2, 0, 129, 2, 0, 130, 2, 0, 131, 2, 0, 132, 2, 0, 133, 2, 0, 134, 2, 0, 135, 2, 0, 136, 2, 0, 137, 2, 0, 138, 2, 0, 139, 2, 0, 140, 2, 0, 141, 2, 0, 142, 2, 0, 143, 2, 0, 144, 2, 0, 145, 2, 0, 146, 2, 0, 147, 2, 0, 148, 2, 0, 149, 2, 0, 150, 2, 0, 151, 2, 0, 152, 2, 0, 153, 2, 0, 154, 2, 0, 155, 2, 0, 156, 2, 0, 157, 2, 0, 158, -1073741821, 0, 159, -1073741814, 0, 160, 11, 0, 131066, 11, 0, 131067, -1610612721, 0, 131068, 10, 0, 131069, 10, 0, 131070, 10, 0, 131071, 10, 0, 65536, 10, 0, 65537, 10, 0, 65538, 10, 0, 65539, 10, 0, 65540, 10, 0, 65541, 10, 0, 65542, 10, 0, 65543, 10, 0, 65544, 10, 0, 65545, 10, 0, 65546, 10, 0, 65547, 10, 0, 65548, 10, 0, 65549, 10, 0, 65550, 10, 0, 65551, 10, 0, 65552, 10, 0, 65553, 10, 0, 65554, 10, 0, 65555, 10, 0, 65556, 12, 0, 65557, 10, 0, 65558, 12, 0, 65559, 10, 0, 65560, 10, 0, 65561, 10, 0, 65562, 10, 0, 65563, 10, 0, 65564, 10, 0, 65565, 10, 0, 65566, 10, 0, 65567, 10, 0, 65568, 10, 0, 65569, 10, 0, 65570, 10, 0, 65571, 10, 0, 65576, 10, 0, 65577, 10, 0, 65578, 12, 0, 65579, 10, 0, 65580, 10, 0, 65581, 10, 0, 65582, 10, 0, 65583, 10, 0, 65584, 10, 0, 65585, 10, 0, 65586, 10, 0, 65587, 10, 0, 65588, 10, 0, 65589, 10, 0, 65590, 10, 0, 65591, 10, 0, 65592, 10, 0, 65593, 10, 0, 65594, 10, 0, 65595, 10, 0, 65596, 10, 0, 65597, 10, 0, 65598, 10, 0, 65599, 10, 0, 65600, 12, 0, 65601, 10, 0, 65602, 10, 0, 65603, 10, 0, 65604, 10, 0, 65605, 10, 0, 65606, 10, 0, 65607, 10, 0, 65608, 10, 0, 65609, 10, 0, 65610, 10, 0, 65611, 10, 0, 65612, 10, 0, 65613, 10, 0, 65614, 10, 0, 65615, 10, 0, 65616, 10, 0, 65617, 10, 0, 65618, 10, 0, 65619, 10, 0, 65620, 10, 0, 65621, 10, 0, 65622, 10, 0, 65623, 10, 0, 65624, 10, 0, 65625, 10, 0, 65626, 10, 0, 65627, 10, 0, 65628, 10, 0, 65629, 10, 0, 65630, 10, 0, 65631, 10, 0, 65632, 10, 0, 65633, 10, 0, 65634, 10, 0, 65635, 10, 0, 65636, 10, 0, 65637, 10, 0, 65638, 10, 0, 65639, 10, 0, 65640, 10, 0, 65641, 10, 0, 65642, 10, 0, 65643, 10, 0, 65644, 10, 0, 65645, 10, 0, 65646, 10, 0, 65647, 10, 0, 65648, 10, 0, 65649, 10, 0, 65650, 10, 0, 65651, 10, 0, 65652, 10, 0, 65653, 10, 0, 65654, 10, 0, 65655, 10, 0, 65656, 10, 0, 65657, 10, 0, 65658, 10, 0, 65659, 10, 0, 65660, 10, 0, 65661, 10, 0, 65662, 10, 0, 65663, 10, 0, 65664, 10, 0, 65665, 10, 0, 65666, 10, 0, 65667, 10, 0, 65668, 10, 0, 65669, 10, 0, 65670, 10, 0, 65671, 10, 0, 65672, 10, 0, 65673, 10, 0, 65674, 10, 0, 65675, 10, 0, 65676, 10, 0, 65677, 10, 0, 65678, 10, 0, 65679, 10, 0, 65680, 10, 0, 65681, 10, 0, 65682, 10, 0, 65683, 10, 0, 65684, 10, 0, 65685, 10, 0, 65686, 10, 0, 65687, 10, 0, 65688, 10, 0, 65689, 10, 0, 65690, 10, 0, 65691, 10, 0, 65692, 10, 0, 65693, 10, 0, 65694, 10, 0, 65695, 15, 0, 65696, 11, 0 ) +tile_data = PoolIntArray( -1310652, 7, 0, -1310651, -1610612729, 0, -1245116, -1073741822, 0, -1245115, -1610612734, 0, -1179580, -1073741822, 0, -1179579, -1610612734, 0, -1114044, -1073741822, 0, -1114043, -1610612734, 0, -1048508, -1073741822, 0, -1048507, -1610612734, 0, -1048418, -1073741822, 0, -1048417, -1073741814, 0, -1048416, 11, 0, -917510, -1073741813, 0, -917509, -1610612726, 0, -917508, -1610612734, 0, -982972, -1073741822, 0, -982971, -1610612734, 0, -982882, -1073741822, 0, -982881, -1073741814, 0, -982880, 11, 0, -851974, -1073741813, 0, -851973, -1610612726, 0, -851972, -1610612734, 0, -917436, -1073741822, 0, -917435, -1610612734, 0, -917346, -1073741822, 0, -917345, -1073741814, 0, -917344, 11, 0, -786438, -1073741813, 0, -786437, -1610612726, 0, -786436, -1610612734, 0, -851900, -1073741822, 0, -851899, -1610612734, 0, -851810, -1073741822, 0, -851809, -1073741814, 0, -851808, 11, 0, -720902, -1073741813, 0, -720901, -1610612726, 0, -720900, -1610612734, 0, -786364, -1073741822, 0, -786363, -1610612734, 0, -786274, -1073741822, 0, -786273, -1073741814, 0, -786272, 11, 0, -655366, -1073741813, 0, -655365, -1610612726, 0, -655364, -1610612734, 0, -720842, 7, 0, -720841, 2, 0, -720840, 2, 0, -720828, -1073741822, 0, -720827, -1610612734, 0, -720738, -1073741822, 0, -720737, -1073741814, 0, -720736, 11, 0, -589830, -1073741813, 0, -589829, -1610612726, 0, -589828, -1610612734, 0, -655306, -1073741822, 0, -655305, -1610612734, 0, -655292, -1073741817, 0, -655291, 1610612743, 0, -655202, -1073741822, 0, -655201, -1073741814, 0, -655200, 11, 0, -524294, -1073741813, 0, -524293, -1610612726, 0, -524292, -1610612734, 0, -589770, -1073741822, 0, -589769, -1610612734, 0, -589762, 2, 0, -589761, 2, 0, -589760, -1610612729, 0, -589666, -1073741822, 0, -589665, -1073741814, 0, -589664, 11, 0, -458758, 11, 0, -458757, -1610612726, 0, -458756, -1610612734, 0, -524234, -1073741822, 0, -524233, 1610612739, 0, -524232, 2, 0, -524231, 2, 0, -524225, -1073741822, 0, -524224, -1610612734, 0, -524159, 7, 0, -524158, 2, 0, -524157, 2, 0, -524156, 2, 0, -524155, -1610612729, 0, -524149, 7, 0, -524148, 2, 0, -524147, 2, 0, -524146, 2, 0, -524145, 2, 0, -524144, -1610612729, 0, -524130, -1073741822, 0, -524129, -1073741814, 0, -524128, 11, 0, -393222, 11, 0, -393221, -1610612726, 0, -393220, -1610612734, 0, -458698, -1073741822, 0, -458697, -1610612734, 0, -458689, -1073741822, 0, -458688, -1610612734, 0, -458625, 7, 0, -458624, 2, 0, -458623, 1610612739, 0, -458622, 1610612738, 0, -458621, 1610612738, 0, -458620, 1610612738, 0, -458619, 1610612743, 0, -458613, -1073741817, 0, -458612, 1610612738, 0, -458611, 1610612738, 0, -458610, 1610612738, 0, -458609, 1610612738, 0, -458608, -1610612733, 0, -458607, -1610612729, 0, -458594, -1073741822, 0, -458593, -1073741814, 0, -458592, 11, 0, -327686, 11, 0, -327685, -1610612726, 0, -327684, -1610612734, 0, -393162, -1073741822, 0, -393161, -1610612734, 0, -393155, 2, 0, -393154, 2, 0, -393153, 1610612739, 0, -393152, -1610612734, 0, -393120, 2, 0, -393119, 2, 0, -393118, 2, 0, -393093, 7, 0, -393092, 2, 0, -393091, 2, 0, -393090, 2, 0, -393089, 1610612739, 0, -393088, 1610612739, 0, -393087, 1610612743, 0, -393072, -1073741822, 0, -393071, -1610612734, 0, -393058, -1073741822, 0, -393057, -1073741814, 0, -393056, 11, 0, -262150, 11, 0, -262149, -1610612726, 0, -262148, -1610612734, 0, -327647, 7, 0, -327646, 2, 0, -327645, -1610612729, 0, -327626, -1073741822, 0, -327625, -1610612734, 0, -327617, -1073741822, 0, -327616, -1610612734, 0, -327557, -1073741822, 0, -327556, 1610612739, 0, -327555, 1610612739, 0, -327554, 1610612739, 0, -327553, 1610612739, 0, -327552, -1610612734, 0, -327536, -1073741822, 0, -327535, -1610612734, 0, -327522, -1073741822, 0, -327521, -1073741814, 0, -327520, 11, 0, -196614, 11, 0, -196613, -1610612726, 0, -196612, -1610612734, 0, -262111, -1073741822, 0, -262110, 1, 0, -262109, -1610612734, 0, -262090, -1073741822, 0, -262089, 1610612739, 0, -262088, 2, 0, -262087, 2, 0, -262081, -1073741822, 0, -262080, -1610612734, 0, -262041, 7, 0, -262040, -1610612729, 0, -262025, 7, 0, -262024, 2, 0, -262023, 2, 0, -262022, 2, 0, -262021, 1610612739, 0, -262020, 1610612739, 0, -262019, 1610612739, 0, -262018, 1610612739, 0, -262017, 1610612739, 0, -262016, -1610612734, 0, -262000, -1073741822, 0, -261999, -1610612734, 0, -261986, -1073741822, 0, -261985, -1073741814, 0, -261984, 11, 0, -131078, 11, 0, -131077, -1610612726, 0, -131076, -1610612734, 0, -196583, 2, 0, -196582, 2, 0, -196581, 2, 0, -196580, 2, 0, -196579, 2, 0, -196575, -1073741822, 0, -196574, 3, 0, -196573, -1610612734, 0, -196554, -1073741822, 0, -196553, -1610612734, 0, -196545, -1073741822, 0, -196544, -1610612734, 0, -196522, 7, 0, -196521, 2, 0, -196520, 2, 0, -196519, -1610612729, 0, -196513, 7, 0, -196512, 2, 0, -196511, 2, 0, -196510, 2, 0, -196509, -1610612729, 0, -196505, -1073741817, 0, -196504, 1610612743, 0, -196494, 7, 0, -196493, 2, 0, -196492, 2, 0, -196491, 2, 0, -196490, 2, 0, -196489, 1610612739, 0, -196488, 1610612739, 0, -196487, 1610612739, 0, -196486, 1610612739, 0, -196485, 1610612739, 0, -196484, 1610612739, 0, -196483, 1610612739, 0, -196482, 1610612739, 0, -196481, 1610612739, 0, -196480, -1610612734, 0, -196464, -1073741822, 0, -196463, -1610612734, 0, -196450, -1073741822, 0, -196449, -1073741814, 0, -196448, 11, 0, -65542, 11, 0, -65541, -1610612726, 0, -65540, -1610612734, 0, -131039, -1073741822, 0, -131038, 1, 0, -131037, -1610612734, 0, -131032, 7, 0, -131031, 2, 0, -131030, 2, 0, -131029, -1610612729, 0, -131018, -1073741817, 0, -131017, 1610612743, 0, -131011, 2, 0, -131010, 2, 0, -131009, 1610612739, 0, -131008, -1610612734, 0, -130989, 7, 0, -130988, 2, 0, -130987, 2, 0, -130986, 3, 0, -130985, 3, 0, -130984, 3, 0, -130983, 3, 0, -130982, 2, 0, -130981, 2, 0, -130980, 2, 0, -130979, 2, 0, -130978, 2, 0, -130977, 3, 0, -130976, 3, 0, -130975, 3, 0, -130974, 3, 0, -130973, -1610612734, 0, -130960, 7, 0, -130959, 2, 0, -130958, 1610612738, 0, -130957, 1610612738, 0, -130956, 1610612738, 0, -130955, 1610612738, 0, -130954, 1610612738, 0, -130953, 1610612738, 0, -130952, 1610612738, 0, -130951, 1610612738, 0, -130950, 1610612738, 0, -130949, 1610612738, 0, -130948, 1610612738, 0, -130947, 1610612738, 0, -130946, 1610612738, 0, -130945, 1610612738, 0, -130944, 1610612743, 0, -130928, -1073741817, 0, -130927, 1610612743, 0, -130914, -1073741822, 0, -130913, -1073741814, 0, -130912, 11, 0, -6, 11, 0, -5, -1610612726, 0, -4, -1610612734, 0, -65517, 7, 0, -65516, 2, 0, -65515, 2, 0, -65514, -1610612729, 0, -65503, -1073741822, 0, -65502, 3, 0, -65501, -1610612734, 0, -65496, -1073741822, 0, -65495, 3, 0, -65494, 3, 0, -65493, -1610612734, 0, -65473, -1073741822, 0, -65472, -1610612734, 0, -65457, 7, 0, -65456, 2, 0, -65455, 2, 0, -65454, 2, 0, -65453, 3, 0, -65452, 3, 0, -65451, 3, 0, -65450, 3, 0, -65449, 3, 0, -65448, 3, 0, -65447, 3, 0, -65446, 3, 0, -65445, 3, 0, -65444, 3, 0, -65443, 3, 0, -65442, 3, 0, -65441, 3, 0, -65440, 3, 0, -65439, 3, 0, -65438, 3, 0, -65437, -1610612734, 0, -65378, -1073741822, 0, -65377, -1073741814, 0, -65376, 11, 0, 65530, 11, 0, 65531, -1610612726, 0, 65532, 1610612739, 0, 65533, 2, 0, 65534, 2, 0, 65535, 2, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 5, 2, 0, 6, 2, 0, 7, 2, 0, 8, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 12, 2, 0, 13, 2, 0, 14, 2, 0, 15, 2, 0, 16, 2, 0, 17, 2, 0, 18, 2, 0, 19, 3, 0, 20, 3, 0, 21, 3, 0, 22, 1610612739, 0, 23, 2, 0, 24, 2, 0, 25, 2, 0, 26, 2, 0, 27, 2, 0, 28, 2, 0, 29, 2, 0, 30, 2, 0, 31, 2, 0, 32, 2, 0, 33, 3, 0, 34, 1, 0, 35, -1610612734, 0, 40, -1073741822, 0, 41, 3, 0, 42, 3, 0, 43, 3, 0, 44, 2, 0, 45, 2, 0, 46, 2, 0, 47, 2, 0, 48, 2, 0, 49, 2, 0, 50, 2, 0, 51, 2, 0, 52, 2, 0, 53, 2, 0, 54, 2, 0, 55, 2, 0, 56, 2, 0, 57, 2, 0, 58, 2, 0, 59, 2, 0, 60, 2, 0, 61, 2, 0, 62, 2, 0, 63, 3, 0, 64, 3, 0, 65, 2, 0, 66, 2, 0, 67, 2, 0, 68, 2, 0, 69, 2, 0, 70, 2, 0, 71, 2, 0, 72, 2, 0, 73, 2, 0, 74, 2, 0, 75, 2, 0, 76, 2, 0, 77, 2, 0, 78, 2, 0, 79, 3, 0, 80, 3, 0, 81, 3, 0, 82, 3, 0, 83, 3, 0, 84, 1610612739, 0, 85, 1610612739, 0, 86, 1610612739, 0, 87, 1610612739, 0, 88, 1610612739, 0, 89, 1610612739, 0, 90, 1610612739, 0, 91, 1610612739, 0, 92, 1610612739, 0, 93, 1610612739, 0, 94, 1610612739, 0, 95, 1610612739, 0, 96, 1610612739, 0, 97, 1610612739, 0, 98, 1610612739, 0, 99, 1610612739, 0, 100, 2, 0, 101, 2, 0, 102, 2, 0, 103, 2, 0, 104, 2, 0, 105, 2, 0, 106, 2, 0, 107, 2, 0, 108, 2, 0, 109, 2, 0, 110, 2, 0, 111, 2, 0, 112, 2, 0, 113, 2, 0, 114, 2, 0, 115, 2, 0, 116, 2, 0, 117, 2, 0, 118, 2, 0, 119, 2, 0, 120, 2, 0, 121, 2, 0, 122, 2, 0, 123, 2, 0, 124, 2, 0, 125, 2, 0, 126, 2, 0, 127, 2, 0, 128, 2, 0, 129, 2, 0, 130, 2, 0, 131, 2, 0, 132, 2, 0, 133, 2, 0, 134, 2, 0, 135, 2, 0, 136, 2, 0, 137, 2, 0, 138, 2, 0, 139, 2, 0, 140, 2, 0, 141, 2, 0, 142, 2, 0, 143, 2, 0, 144, 2, 0, 145, 2, 0, 146, 2, 0, 147, 2, 0, 148, 2, 0, 149, 2, 0, 150, 2, 0, 151, 2, 0, 152, 2, 0, 153, 2, 0, 154, 2, 0, 155, 2, 0, 156, 2, 0, 157, 2, 0, 158, -1073741821, 0, 159, -1073741814, 0, 160, 11, 0, 131066, 11, 0, 131067, -1610612721, 0, 131068, 10, 0, 131069, 10, 0, 131070, 10, 0, 131071, 10, 0, 65536, 10, 0, 65537, 10, 0, 65538, 10, 0, 65539, 10, 0, 65540, 10, 0, 65541, 10, 0, 65542, 10, 0, 65543, 10, 0, 65544, 10, 0, 65545, 10, 0, 65546, 10, 0, 65547, 10, 0, 65548, 10, 0, 65549, 10, 0, 65550, 10, 0, 65551, 10, 0, 65552, 10, 0, 65553, 10, 0, 65554, 10, 0, 65555, 10, 0, 65556, 12, 0, 65557, 10, 0, 65558, 12, 0, 65559, 10, 0, 65560, 10, 0, 65561, 10, 0, 65562, 10, 0, 65563, 10, 0, 65564, 10, 0, 65565, 10, 0, 65566, 10, 0, 65567, 10, 0, 65568, 10, 0, 65569, 10, 0, 65570, 10, 0, 65571, 10, 0, 65576, 10, 0, 65577, 10, 0, 65578, 12, 0, 65579, 10, 0, 65580, 10, 0, 65581, 10, 0, 65582, 10, 0, 65583, 10, 0, 65584, 10, 0, 65585, 10, 0, 65586, 10, 0, 65587, 10, 0, 65588, 10, 0, 65589, 10, 0, 65590, 10, 0, 65591, 10, 0, 65592, 10, 0, 65593, 10, 0, 65594, 10, 0, 65595, 10, 0, 65596, 10, 0, 65597, 10, 0, 65598, 10, 0, 65599, 10, 0, 65600, 12, 0, 65601, 10, 0, 65602, 10, 0, 65603, 10, 0, 65604, 10, 0, 65605, 10, 0, 65606, 10, 0, 65607, 10, 0, 65608, 10, 0, 65609, 10, 0, 65610, 10, 0, 65611, 10, 0, 65612, 10, 0, 65613, 10, 0, 65614, 10, 0, 65615, 10, 0, 65616, 10, 0, 65617, 10, 0, 65618, 10, 0, 65619, 10, 0, 65620, 10, 0, 65621, 10, 0, 65622, 10, 0, 65623, 10, 0, 65624, 10, 0, 65625, 10, 0, 65626, 10, 0, 65627, 10, 0, 65628, 10, 0, 65629, 10, 0, 65630, 10, 0, 65631, 10, 0, 65632, 10, 0, 65633, 10, 0, 65634, 10, 0, 65635, 10, 0, 65636, 10, 0, 65637, 10, 0, 65638, 10, 0, 65639, 10, 0, 65640, 10, 0, 65641, 10, 0, 65642, 10, 0, 65643, 10, 0, 65644, 10, 0, 65645, 10, 0, 65646, 10, 0, 65647, 10, 0, 65648, 10, 0, 65649, 10, 0, 65650, 10, 0, 65651, 10, 0, 65652, 10, 0, 65653, 10, 0, 65654, 10, 0, 65655, 10, 0, 65656, 10, 0, 65657, 10, 0, 65658, 10, 0, 65659, 10, 0, 65660, 10, 0, 65661, 10, 0, 65662, 10, 0, 65663, 10, 0, 65664, 10, 0, 65665, 10, 0, 65666, 10, 0, 65667, 10, 0, 65668, 10, 0, 65669, 10, 0, 65670, 10, 0, 65671, 10, 0, 65672, 10, 0, 65673, 10, 0, 65674, 10, 0, 65675, 10, 0, 65676, 10, 0, 65677, 10, 0, 65678, 10, 0, 65679, 10, 0, 65680, 10, 0, 65681, 10, 0, 65682, 10, 0, 65683, 10, 0, 65684, 10, 0, 65685, 10, 0, 65686, 10, 0, 65687, 10, 0, 65688, 10, 0, 65689, 10, 0, 65690, 10, 0, 65691, 10, 0, 65692, 10, 0, 65693, 10, 0, 65694, 10, 0, 65695, 15, 0, 65696, 11, 0 ) [node name="Decor2" type="Node2D" parent="."] position = Vector2( 595, -12 ) @@ -228,19 +228,19 @@ position = Vector2( 756, -15 ) z_index = -1 [node name="AnimatedSprite" parent="Coin" index="2"] -frame = 235 +frame = 301 [node name="Coin2" parent="." instance=ExtResource( 11 )] position = Vector2( 744, -120 ) [node name="AnimatedSprite" parent="Coin2" index="2"] -frame = 166 +frame = 232 [node name="Coin3" parent="." instance=ExtResource( 11 )] position = Vector2( 1320, -282 ) [node name="AnimatedSprite" parent="Coin3" index="2"] -frame = 166 +frame = 232 [node name="Coin4" parent="." instance=ExtResource( 11 )] position = Vector2( 2340, -156 ) diff --git a/src/Levels/Actual Level 3.tscn b/src/Levels/Actual Level 3.tscn index 8519db0..1a01454 100644 --- a/src/Levels/Actual Level 3.tscn +++ b/src/Levels/Actual Level 3.tscn @@ -113,11 +113,8 @@ unique_name_in_owner = true drag_margin_top = 0.08 drag_margin_bottom = 0.08 -[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 7 - [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 3 +frame = 11 [node name="Blobby" parent="." instance=ExtResource( 5 )] unique_name_in_owner = true diff --git a/src/StateMachines/StateMachine.gd b/src/StateMachines/StateMachine.gd index c7de971..0a1fe6c 100644 --- a/src/StateMachines/StateMachine.gd +++ b/src/StateMachines/StateMachine.gd @@ -11,8 +11,8 @@ var states = {} onready var parent = get_parent() # Scene Singletons -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") # Basic process flow for every SM diff --git a/src/UserInterface/Buttons/MenuNavigationButton.gd b/src/UserInterface/Buttons/MenuNavigationButton.gd new file mode 100644 index 0000000..5540193 --- /dev/null +++ b/src/UserInterface/Buttons/MenuNavigationButton.gd @@ -0,0 +1,12 @@ +extends Button + +export(String, FILE) var next_screen_path: = "" +onready var selected_screen_base_path: String = "res://src/UserInterface/Screens" + +func _on_button_up() -> void: + get_tree().change_scene(next_screen_path) + get_tree().get_current_scene().queue_free() + get_tree().paused = false + +func _get_configuration_warning() -> String: + return "next_scene_path must be set for the button to work" if next_screen_path == "" else "" diff --git a/src/UserInterface/Screens/ControlsMenu/ActionKeyList.gd b/src/UserInterface/Screens/ControlsMenu/ActionKeyList.gd new file mode 100644 index 0000000..6a63cfd --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/ActionKeyList.gd @@ -0,0 +1,13 @@ +extends Control + +const InputLine = preload("res://src/UserInterface/Screens/ControlsMenu/InputLine.tscn") + +func clear(): + for child in get_children(): + child.free() + +func add_input_line(action_name, key, is_customizable=false): + var line = InputLine.instance() + line.initialize(action_name, key, is_customizable) + add_child(line) + return line diff --git a/src/UserInterface/Screens/ControlsMenu/ControlsMenu.gd b/src/UserInterface/Screens/ControlsMenu/ControlsMenu.gd new file mode 100644 index 0000000..4416c18 --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/ControlsMenu.gd @@ -0,0 +1,28 @@ +extends Control + +onready var _action_list = $"%ActionKeyList" + +func _ready(): + $InputMapper.connect('profile_changed', self, 'rebuild') + $ProfilesMenu.initialize($InputMapper) + $InputMapper.change_profile($ProfilesMenu.selected) + +func rebuild(input_profile, is_customizable=false): + _action_list.clear() + for input_action in input_profile.keys(): + var line = _action_list.add_input_line(input_action, \ + input_profile[input_action], is_customizable) + if is_customizable: + line.connect('change_button_pressed', self, \ + '_on_InputLine_change_button_pressed', [input_action, line]) + +func _on_InputLine_change_button_pressed(action_name, line): + set_process_input(false) + + $KeySelectMenu.open() + var key_scancode = yield($KeySelectMenu, "key_selected") + $InputMapper.change_action_key(action_name, key_scancode) + line.update_key(key_scancode) + + set_process_input(true) + diff --git a/src/UserInterface/Screens/ControlsMenu/ControlsMenu.tscn b/src/UserInterface/Screens/ControlsMenu/ControlsMenu.tscn new file mode 100644 index 0000000..4ae11f7 --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/ControlsMenu.tscn @@ -0,0 +1,257 @@ +[gd_scene load_steps=23 format=2] + +[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=1] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd" type="Script" id=2] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ActionKeyList.gd" type="Script" id=3] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/InputMapper.gd" type="Script" id=4] +[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=5] +[ext_resource path="res://assets/meta/montserrat_extrabold.otf" type="DynamicFontData" id=6] +[ext_resource path="res://assets/environment/background/space.png" type="Texture" id=7] +[ext_resource path="res://assets/environment/background/Spaceship-Wall.png" type="Texture" id=8] +[ext_resource path="res://src/transparency.gdshader" type="Shader" id=9] +[ext_resource path="res://assets/sounds/EpsonStart.ogg" type="AudioStream" id=10] +[ext_resource path="res://src/UserInterface/Buttons/MenuNavigationButton.gd" type="Script" id=11] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ControlsMenu.gd" type="Script" id=12] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/KeySelectMenu.gd" type="Script" id=13] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SaveButton.gd" type="Script" id=14] +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/Reset.gd" type="Script" id=15] + +[sub_resource type="DynamicFont" id=1] +size = 42 +font_data = ExtResource( 6 ) + +[sub_resource type="ShaderMaterial" id=6] +shader = ExtResource( 9 ) +shader_param/transparency = 0.1 + +[sub_resource type="DynamicFont" id=2] +font_data = ExtResource( 6 ) + +[sub_resource type="DynamicFont" id=3] +font_data = ExtResource( 6 ) + +[sub_resource type="DynamicFont" id=4] +font_data = ExtResource( 6 ) + +[sub_resource type="ShaderMaterial" id=8] +shader = ExtResource( 9 ) +shader_param/transparency = 0.778 + +[sub_resource type="DynamicFont" id=7] +size = 20 +font_data = ExtResource( 6 ) + +[node name="ControlsMenu" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme = ExtResource( 5 ) +script = ExtResource( 12 ) + +[node name="InputMapper" type="Node" parent="."] +script = ExtResource( 4 ) + +[node name="background" type="TextureRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +texture = ExtResource( 7 ) +expand = true +stretch_mode = 1 + +[node name="background2" type="TextureRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +texture = ExtResource( 8 ) +expand = true +stretch_mode = 1 + +[node name="ProfilesMenu" type="OptionButton" parent="."] +anchor_left = 0.5 +anchor_top = 0.165 +anchor_right = 0.5 +anchor_bottom = 0.165 +margin_left = -14.5 +margin_right = 14.5 +margin_bottom = 19.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource( 2 ) + +[node name="Titel" type="Label" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -170.0 +margin_right = 170.0 +margin_bottom = 52.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 1 ) +text = "Controlls Menu" +align = 1 +valign = 1 + +[node name="TextureRect" type="TextureRect" parent="Titel"] +material = SubResource( 6 ) +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -39.0 +margin_top = -3.0 +margin_right = 251.0 +margin_bottom = 265.0 +rect_scale = Vector2( 0.0627026, 0.0522158 ) +texture = ExtResource( 1 ) + +[node name="KeymapViewer" type="VBoxContainer" parent="."] +anchor_left = 0.1 +anchor_top = 0.3 +anchor_right = 0.9 +anchor_bottom = 0.75 +margin_left = -20.0 +margin_top = -20.0 +margin_right = 20.0 +margin_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Headers" type="HBoxContainer" parent="KeymapViewer"] +margin_right = 552.0 +margin_bottom = 21.0 +size_flags_horizontal = 3 + +[node name="Action" type="Label" parent="KeymapViewer/Headers"] +margin_right = 242.0 +margin_bottom = 21.0 +grow_horizontal = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 2 ) +text = "Action" +valign = 1 + +[node name="Control" type="Label" parent="KeymapViewer/Headers"] +margin_left = 246.0 +margin_right = 305.0 +margin_bottom = 21.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 3 ) +text = "Button" +align = 1 +valign = 1 + +[node name="Change" type="Label" parent="KeymapViewer/Headers"] +margin_left = 309.0 +margin_right = 552.0 +margin_bottom = 21.0 +grow_horizontal = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 4 ) +text = "Edit" +align = 2 +valign = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="KeymapViewer"] +margin_top = 25.0 +margin_right = 552.0 +margin_bottom = 202.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="ActionKeyList" type="VBoxContainer" parent="KeymapViewer/ScrollContainer"] +unique_name_in_owner = true +margin_right = 552.0 +margin_bottom = 177.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 3 ) + +[node name="Back" type="Button" parent="."] +anchor_left = 0.05 +anchor_top = 0.95 +anchor_right = 0.05 +anchor_bottom = 0.95 +margin_top = -25.0 +margin_right = 75.0 +grow_horizontal = 2 +grow_vertical = 2 +rect_min_size = Vector2( 40, 20 ) +input_pass_on_modal_close_click = false +size_flags_horizontal = 0 +size_flags_vertical = 0 +text = "Back" +script = ExtResource( 11 ) +next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn" + +[node name="Reset" type="Button" parent="."] +anchor_left = 0.5 +anchor_top = 0.95 +anchor_right = 0.5 +anchor_bottom = 0.95 +margin_left = -37.5 +margin_top = -25.0 +margin_right = 37.5 +grow_horizontal = 2 +grow_vertical = 2 +rect_min_size = Vector2( 40, 20 ) +input_pass_on_modal_close_click = false +size_flags_horizontal = 0 +size_flags_vertical = 0 +text = "Reset" +script = ExtResource( 15 ) + +[node name="Save" type="Button" parent="."] +anchor_left = 0.95 +anchor_top = 0.95 +anchor_right = 0.95 +anchor_bottom = 0.95 +margin_left = -75.0 +margin_top = -25.0 +grow_horizontal = 2 +grow_vertical = 2 +rect_min_size = Vector2( 40, 20 ) +input_pass_on_modal_close_click = false +size_flags_horizontal = 0 +size_flags_vertical = 0 +text = "Save" +script = ExtResource( 14 ) + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 10 ) +volume_db = -10.065 +autoplay = true +bus = "Music" + +[node name="KeySelectMenu" type="Panel" parent="."] +visible = false +material = SubResource( 8 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 13 ) + +[node name="Prompt" type="Label" parent="KeySelectMenu"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -170.0 +margin_top = -26.0 +margin_right = 170.0 +margin_bottom = 26.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +custom_fonts/font = SubResource( 7 ) +text = "Press a key (ESC to cancel)" +align = 1 +valign = 1 + +[connection signal="button_up" from="Back" to="Back" method="_on_button_up"] +[connection signal="button_up" from="Reset" to="Reset" method="_on_button_up"] +[connection signal="button_up" from="Save" to="Save" method="_on_button_up"] diff --git a/src/UserInterface/Screens/ControlsMenu/InputLine.gd b/src/UserInterface/Screens/ControlsMenu/InputLine.gd new file mode 100644 index 0000000..9debd3d --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/InputLine.gd @@ -0,0 +1,14 @@ +extends HBoxContainer + +signal change_button_pressed + +func initialize(action_name, key, can_change): + $Action.text = action_name.capitalize() + $Key.text = OS.get_scancode_string(key) + $ChangeButton.disabled = !can_change + +func update_key(scancode): + $Key.text = OS.get_scancode_string(scancode) + +func _on_ChangeButton_pressed(): + emit_signal('change_button_pressed') diff --git a/src/UserInterface/Screens/ControlsMenu/InputLine.tscn b/src/UserInterface/Screens/ControlsMenu/InputLine.tscn new file mode 100644 index 0000000..fcf41fe --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/InputLine.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/InputLine.gd" type="Script" id=1] + +[node name="InputLine" type="HBoxContainer"] +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_top = -10.0 +margin_bottom = 10.0 +script = ExtResource( 1 ) + +[node name="Action" type="Label" parent="."] +margin_right = 287.0 +margin_bottom = 20.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Up" +valign = 1 + +[node name="Key" type="Label" parent="."] +margin_left = 291.0 +margin_right = 578.0 +margin_bottom = 20.0 +grow_horizontal = 0 +grow_vertical = 0 +size_flags_horizontal = 3 +size_flags_vertical = 1 +text = "W Key" +valign = 1 + +[node name="ChangeButton" type="Button" parent="."] +margin_left = 582.0 +margin_right = 640.0 +margin_bottom = 20.0 +grow_horizontal = 0 +grow_vertical = 0 +rect_min_size = Vector2( 40, 20 ) +input_pass_on_modal_close_click = false +size_flags_horizontal = 0 +size_flags_vertical = 0 +text = "Change" +icon_align = 1 + +[connection signal="pressed" from="ChangeButton" to="." method="_on_ChangeButton_pressed"] diff --git a/src/UserInterface/Screens/ControlsMenu/InputMapper.gd b/src/UserInterface/Screens/ControlsMenu/InputMapper.gd new file mode 100644 index 0000000..244783e --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/InputMapper.gd @@ -0,0 +1,58 @@ +extends Node + +signal profile_changed(new_profile, is_customizable) + +var current_profile_id = 0 + +var profiles = { + 0: 'keyboard', + 1: 'controller', + 2: 'keyboard_default', + 3: 'controller_default', +} + +var keyboard_default = { + 'move_up': KEY_UP, + 'move_down': KEY_DOWN, + 'move_left': KEY_LEFT, + 'move_right': KEY_RIGHT +} + +var controller_default = { + 'move_up': KEY_W, + 'move_down': KEY_S, + 'move_left': KEY_A, + 'move_right': KEY_D +} + +var keyboard = keyboard_default +var controller = controller_default + +func change_profile(id): + current_profile_id = id + var profile = get(profiles[id]) + var is_customizable = true if id < 2 else false + + for action_name in profile.keys(): + change_action_key(action_name, profile[action_name]) + emit_signal('profile_changed', profile, is_customizable) + return profile + +func change_action_key(action_name, key_scancode): + erase_action_events(action_name) + + var new_event = InputEventKey.new() + new_event.set_scancode(key_scancode) + InputMap.action_add_event(action_name, new_event) + get_selected_profile()[action_name] = key_scancode + +func erase_action_events(action_name): + var input_events = InputMap.get_action_list(action_name) + for event in input_events: + InputMap.action_erase_event(action_name, event) + +func get_selected_profile(): + return get(profiles[current_profile_id]) + +func _on_ProfilesMenu_item_selected(ID): + change_profile(ID) diff --git a/src/UserInterface/Screens/ControlsMenu/KeySelectMenu.gd b/src/UserInterface/Screens/ControlsMenu/KeySelectMenu.gd new file mode 100644 index 0000000..fe4c336 --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/KeySelectMenu.gd @@ -0,0 +1,21 @@ +extends Panel + +signal key_selected(scancode) + +func _ready(): + set_process_input(false) + +func _input(event): + if !event.is_pressed(): + return + if event.scancode != 16777217: + emit_signal("key_selected", event.scancode) + close() + +func open(): + show() + set_process_input(true) + +func close(): + hide() + set_process_input(false) diff --git a/src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd b/src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd new file mode 100644 index 0000000..b7fa2dd --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd @@ -0,0 +1,7 @@ +extends OptionButton + +func initialize(input_mapper): + for profile_index in input_mapper.profiles: + var profile_name = input_mapper.profiles[profile_index].capitalize() + add_item(profile_name, profile_index) + self.connect("item_selected", input_mapper, "_on_ProfilesMenu_item_selected") diff --git a/src/UserInterface/Screens/ControlsMenu/Reset.gd b/src/UserInterface/Screens/ControlsMenu/Reset.gd new file mode 100644 index 0000000..5af0636 --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/Reset.gd @@ -0,0 +1,7 @@ +extends Button + +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") + +func _on_button_up() -> void: + InputMap.load_from_globals() + SaveManager.save_default() diff --git a/src/UserInterface/Screens/ControlsMenu/SaveButton.gd b/src/UserInterface/Screens/ControlsMenu/SaveButton.gd new file mode 100644 index 0000000..28a4bac --- /dev/null +++ b/src/UserInterface/Screens/ControlsMenu/SaveButton.gd @@ -0,0 +1,6 @@ +extends Button + +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") + +func _on_button_up() -> void: + SaveManager.save_default() diff --git a/src/UserInterface/Screens/HUD.gd b/src/UserInterface/Screens/HUD.gd index f06a766..f763578 100644 --- a/src/UserInterface/Screens/HUD.gd +++ b/src/UserInterface/Screens/HUD.gd @@ -7,8 +7,8 @@ onready var timer: Label = $HUDOverlay/GetBackTimer onready var currency: Label = $HUDOverlay/Currency onready var kills: Label = $HUDOverlay/Kills onready var frees: Label = $HUDOverlay/Frees -onready var levelState := get_tree().root.get_child(1).get_node("%LevelState") -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(2).get_node("%LevelState") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") func _ready(): @@ -38,7 +38,7 @@ func _zoom_timer() -> void: func update_interface() -> void: - var wallet = GlobalState.wallet + levelState.currency + var wallet = GlobalState.gsr.wallet + levelState.currency currency.text = "Orbs: %s" % wallet kills.text = "Kills: %s" % levelState.kills diff --git a/src/UserInterface/Screens/MainScreen.tscn b/src/UserInterface/Screens/MainScreen.tscn index cb1ccf3..6c98e13 100644 --- a/src/UserInterface/Screens/MainScreen.tscn +++ b/src/UserInterface/Screens/MainScreen.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://src/UserInterface/Buttons/QuitButton.tscn" type="PackedScene" id=1] [ext_resource path="res://src/UserInterface/Buttons/Titel.tscn" type="PackedScene" id=2] @@ -9,6 +9,13 @@ [ext_resource path="res://src/UserInterface/Screens/LevelSelectButtonGroup.tres" type="ButtonGroup" id=7] [ext_resource path="res://assets/environment/background/Spaceship-Wall.png" type="Texture" id=8] [ext_resource path="res://assets/sounds/EpsonStart.ogg" type="AudioStream" id=9] +[ext_resource path="res://src/UserInterface/Buttons/MenuNavigationButton.gd" type="Script" id=10] +[ext_resource path="res://assets/meta/montserrat_extrabold.otf" type="DynamicFontData" id=11] +[ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=12] + +[sub_resource type="DynamicFont" id=1] +size = 69 +font_data = ExtResource( 11 ) [node name="MainScreen" type="Control"] anchor_right = 1.0 @@ -18,6 +25,8 @@ size_flags_horizontal = 0 size_flags_vertical = 0 theme = ExtResource( 5 ) +[node name="SignalManager" parent="." instance=ExtResource( 12 )] + [node name="background" type="TextureRect" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 @@ -41,6 +50,7 @@ margin_bottom = 85.0 grow_horizontal = 2 size_flags_horizontal = 2 size_flags_vertical = 2 +custom_fonts/font = SubResource( 1 ) text = "bobbi" [node name="MenuContainer" type="HBoxContainer" parent="."] @@ -60,14 +70,22 @@ size_flags_horizontal = 3 [node name="PlayButton" parent="MenuContainer/Buttons" instance=ExtResource( 3 )] margin_right = 296.0 -margin_bottom = 48.0 +margin_bottom = 30.0 next_scene_path = "res://src/Levels/Actual Level 1.tscn" +[node name="Controlls" parent="MenuContainer/Buttons" instance=ExtResource( 3 )] +margin_top = 34.0 +margin_right = 296.0 +margin_bottom = 65.0 +text = "Controls" +script = ExtResource( 10 ) +next_screen_path = "res://src/UserInterface/Screens/ControlsMenu/ControlsMenu.tscn" + [node name="QuitButton" parent="MenuContainer/Buttons" instance=ExtResource( 1 )] anchor_left = 0.0 anchor_right = 0.0 margin_left = 0.0 -margin_top = 52.0 +margin_top = 69.0 margin_right = 296.0 margin_bottom = 100.0 diff --git a/src/Utilities/GlobalState.gd b/src/Utilities/GlobalState.gd new file mode 100644 index 0000000..892321d --- /dev/null +++ b/src/Utilities/GlobalState.gd @@ -0,0 +1,46 @@ +extends Node + +#export(Dictionary) var progress_dict := {} setget set_progress, get_progress +#export(int) var wallet := 0 setget set_wallet +#export(Dictionary) var input_map +#export(bool) var show_tutorial +export(Resource) var gsr + +func set_progress(value) -> void: + gsr.progress_dict = value + SaveManager.save_default() + +func get_progress() -> Dictionary: + return gsr.progress_dict + +func set_savepoint(levelName: String, position: Vector2) -> void: + if(!gsr.progress_dict.has(levelName)): + gsr.progress_dict[levelName] = {} + gsr.progress_dict[levelName]["savepoint"] = position + SaveManager.save_default() + +func get_property_value(levelName: String, propertyName: String) -> int: + if gsr.progress_dict.has(levelName) && gsr.progress_dict[levelName].has(propertyName): + return gsr.progress_dict[levelName][propertyName] + else: + return 0 + +func get_savepoint(levelName: String) -> Vector2: + if gsr.progress_dict.has(levelName) && gsr.progress_dict[levelName].has("savepoint"): + return gsr.progress_dict[levelName]["savepoint"] + else: + return Vector2() + +# TODO This is permanent immediatly +func set_wallet(value) -> void: + gsr.wallet = value + SaveManager.save_default() + +func reinstate() -> void: + if gsr.input_map.size() <= 1: + InputMap.load_from_globals() + + for action in gsr.input_map: + InputMap.action_erase_events(action) + for input_event in gsr.input_map[action]: + InputMap.action_add_event(action, input_event) diff --git a/src/Utilities/GlobalStateResource.gd b/src/Utilities/GlobalStateResource.gd new file mode 100644 index 0000000..d499b53 --- /dev/null +++ b/src/Utilities/GlobalStateResource.gd @@ -0,0 +1,7 @@ +extends Resource +class_name GlobalStateResource + +export(Dictionary) var progress_dict := {} +export(int) var wallet := 0 +export(Dictionary) var input_map +export(bool) var show_tutorial diff --git a/src/Utilities/InputMapLoader.gd b/src/Utilities/InputMapLoader.gd new file mode 100644 index 0000000..ae12560 --- /dev/null +++ b/src/Utilities/InputMapLoader.gd @@ -0,0 +1,4 @@ +extends Node + + + diff --git a/src/Utilities/LevelState.gd b/src/Utilities/LevelState.gd index cdb6d1a..cd8b7e4 100644 --- a/src/Utilities/LevelState.gd +++ b/src/Utilities/LevelState.gd @@ -1,6 +1,6 @@ extends Node -onready var signalManager := get_tree().root.get_child(1).get_node("%SignalManager") +onready var signalManager := get_tree().root.get_child(2).get_node("%SignalManager") onready var levelName := get_tree().get_current_scene().get_name() #TODO Easteregg pls @@ -20,6 +20,9 @@ func reset() -> void: kills = 0 currency = 0 frees = 0 + # TODO Maybe not the place for this? + if GlobalState.gsr.progress_dict.has(levelName): + GlobalState.gsr.progress_dict[levelName].erase("savepoint") func set_currency(value: int) -> void: currency = value @@ -42,14 +45,14 @@ func set_dead(value: bool) -> void: # Spends the currency when enough is available # and returns true if so. Else it does not spend and return false. func spend_currency(cost: int) -> bool: - if GlobalState.wallet + currency < cost: + if GlobalState.gsr.wallet + currency < cost: return false var remainder = currency - cost if remainder >= 0: currency = remainder else: currency = 0 - GlobalState.set_wallet(GlobalState.wallet + remainder) + GlobalState.set_wallet(GlobalState.gsr.wallet + remainder) return true @@ -74,11 +77,9 @@ func update_global_state() -> void: progress_dict[levelName]["kills"] = GlobalState.get_property_value(levelName,"kills") + kills progress_dict[levelName]["deaths"] = GlobalState.get_property_value(levelName,"deaths") + deaths progress_dict[levelName]["frees"] = GlobalState.get_property_value(levelName,"frees") + frees - # TODO This is not the best place for this - progress_dict[levelName].erase("savepoint") - - GlobalState.set_wallet(GlobalState.wallet + currency) + # TODO Wallet is independant from progress_dict because??? + GlobalState.set_wallet(GlobalState.gsr.wallet + currency) GlobalState.set_progress(progress_dict) func player_dying(animation_number: int = 0) -> void: diff --git a/src/Utilities/SignalManager.gd b/src/Utilities/SignalManager.gd index 12e28f8..9fd2642 100644 --- a/src/Utilities/SignalManager.gd +++ b/src/Utilities/SignalManager.gd @@ -7,6 +7,7 @@ signal currency_updated() signal kills_updated() signal frees_updated() signal player_died(animation_number) +# TODO The persisting process could be cancelled when the level is unloaded signal level_completed() signal power_up_collected(kind) signal got_stomped() diff --git a/src/transparency.gdshader b/src/transparency.gdshader new file mode 100644 index 0000000..6a09628 --- /dev/null +++ b/src/transparency.gdshader @@ -0,0 +1,8 @@ +shader_type canvas_item; + +uniform float transparency : hint_range(0.0, 1.0) = 0.5; + +void fragment() { + COLOR = texture(TEXTURE, UV); + COLOR.a = transparency; +} \ No newline at end of file