1
Fork 0
mirror of https://github.com/Cookie-CHR/LD54-SPAce-ltd.git synced 2024-11-23 07:44:20 +00:00

⚙️ Main code (without graphics and music

This commit is contained in:
Cookie 2023-10-15 18:46:50 +02:00 committed by GitHub
parent 53353cbab0
commit e9fe958fc2
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1319 additions and 0 deletions

19
Components/Background.gd Normal file
View file

@ -0,0 +1,19 @@
extends TileMap
var rng =RandomNumberGenerator.new()
func _ready():
#randomize background
rng.randomize()
for x in range(0, 16):
for y in range(0, 10):
set_cell(0, Vector2(x,y), 0, Vector2(rng.randi_range(0,3), rng.randi_range(0,3)))
func _process(_delta):
#change one tile from time to time, randomly
for x in range(0, 16):
for y in range(0, 10):
if(rng.randi_range(0,200)==0):
set_cell(0, Vector2(x,y), 0, Vector2(rng.randi_range(0,3), rng.randi_range(0,3)))

75
Components/base.gd Normal file
View file

@ -0,0 +1,75 @@
extends Node2D
var curr_player = null
var player_array = {}
@export var planets = {
"rock": 0,
"sun": 0,
"ice": 0,
"grass": 0,
"black": 0
}
@export var map = [
["O", "-", "-", "-", "O"],
]
var total_moves = 0
signal game_success
signal game_fail
func _ready():
var i = 0
for p in planets:
if(planets[p]>0):
var spawner_packed = load("res://Components/spawner.tscn")
var spawner = spawner_packed.instantiate()
spawner.type = p
spawner.charges = planets[p]
spawner.name = "spawner_"+p
spawner.position = Vector2(290+120*i, 550)
add_child(spawner)
i+=1
total_moves += planets[p]
$TileMap.draw_map(map)
func _input(_event):
if Input.is_action_just_pressed("click"):
if curr_player != null:
var success = $TileMap.check_success(get_global_mouse_position(), player_array)
if(!success):
emit_signal("game_fail")
return
var complete = $TileMap.occupy_slot(get_global_mouse_position(), player_array)
if (complete):
AudioPlayer._play("drop")
delete_player()
total_moves -= 1
if (total_moves == 0):
emit_signal("game_success")
func delete_player():
curr_player.queue_free()
curr_player = null
player_array = {}
func new_player(type):
var curr_packed = load("res://Components/planet.tscn")
var curr = curr_packed.instantiate()
curr.type = type
add_child(curr)
curr_player = curr
player_array = {
"type":curr.type ,
"texture":curr_player.sprite.texture,
"modulate":curr_player.sprite.modulate,
"rotation":curr_player.sprite.rotation_degrees
}
func change_player():
var type = player_array["type"]
for child in get_children():
if child.name == "spawner_"+type:
child.charges +=1
child.adjust_look(child.charges)
delete_player()

101
Components/dictionary.gd Normal file
View file

@ -0,0 +1,101 @@
extends Node
var texture = {
"rock": preload("res://Images/Rock.png"),
"sun": preload("res://Images/Sun.png"),
"ice": preload("res://Images/Ice.png"),
"grass": preload("res://Images/Grass.png"),
"black": preload("res://Images/BlackHole.png")
}
var name_ext = {
"R": "rock",
"G": "grass",
"S": "sun",
"I": "ice",
"B": "black"
}
var planets_lvl = {
"0": { "rock": 3, "sun": 5, "ice": 5, "grass": 0, "black": 0 },
"1": { "rock": 3, "sun": 0, "ice": 0, "grass": 3, "black": 0 },
"2": { "rock": 2, "sun": 2, "ice": 0, "grass": 4, "black": 0 },
"3": { "rock": 5, "sun": 0, "ice": 0, "grass": 2, "black": 0 },
"4": { "rock": 4, "sun": 3, "ice": 3, "grass": 0, "black": 0 },
"5": { "rock": 1, "sun": 0, "ice": 0, "grass": 0, "black": 4 },
"6": { "rock": 2, "sun": 1, "ice": 1, "grass": 6, "black": 1 },
"7": { "rock": 5, "sun": 2, "ice": 2, "grass": 4, "black": 4 },
"8": { "rock": 2, "sun": 2, "ice": 2, "grass": 2, "black": 2 },
}
var map_lvl = {
"0": [["O", "-", "-", "-", "O"],
["O", "-", "B", "B", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "S", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "I", "-", "O"],
["O", "-", "-", "-", "O"]],
"1": [["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"]],
"2": [["O", "O", "-", "O", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "O", "-", "O", "O"]],
"3": [["O", "-", "I", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "I", "-", "O"]],
"4": [["O", "S", "-", "I", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"]],
"5": [["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"],
["O", "-", "-", "-", "O"]],
"6": [["-", "-", "-", "-"],
["-", "-", "-", "-"],
["-", "-", "B", "-"],
["-", "-", "-", "-"]],
"7": [["-", "-", "-", "-", "-"],
["-", "-", "-", "-", "-"],
["-", "-", "-", "-", "-"],
["-", "-", "-", "-", "-"],
["-", "-", "-", "-", "-"]],
"8": [["-", "-", "-", "-", "-"],
["-", "B", "-", "-", "-"],
["-", "-", "-", "B", "-"],
["-", "-", "-", "-", "-"]],
}
var label_lvl = {
"0": "",
"1": "Welcome! You must be our new empoyee, right?
Here's a bunch of planets, just put them in any free space on the grid.",
"2": "This guy ordered some suns, too.
Rocky planets can stand the heat, but grassy planets don't. Put them far apart!",
"3": "Same thing with icy planets: their cold aura might damage the grass.
Oh, and of course I don't need to tell you not to put suns near icy planets, right?",
"4": "Note from the developer: I should probably have made different effects for intersecting auras, but the thought alone made me want to drop the whole game. Enjoy your '?'.",
"5": "Nasty black holes! Who would even order such things?
These buggers suck anything that gets in their vicinity, so don't put anything close to them",
"6": "Alright, tutorial's over.
Let's do something a little nastier, shall we?",
"7": "",
"8": "Last level.
I know, the game is short, but I'm already out of Ideas and it's been two weeks",
}

47
Components/gameplay.tscn Normal file
View file

@ -0,0 +1,47 @@
[gd_scene load_steps=7 format=3 uid="uid://ccwl3llks0yht"]
[ext_resource type="Script" path="res://Components/base.gd" id="1_0ugql"]
[ext_resource type="Texture2D" uid="uid://cltng1ui8ahj0" path="res://Images/Tiles.jpg" id="2_3n581"]
[ext_resource type="Script" path="res://Components/higlight_cell.gd" id="3_lxogb"]
[ext_resource type="Script" path="res://Music/Music_Changer.gd" id="5_vryqo"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_guvom"]
texture = ExtResource("2_3n581")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
[sub_resource type="TileSet" id="TileSet_eahiy"]
tile_size = Vector2i(80, 80)
custom_data_layer_0/name = "occupier"
custom_data_layer_0/type = 4
sources/1 = SubResource("TileSetAtlasSource_guvom")
[node name="Base" type="Node2D"]
script = ExtResource("1_0ugql")
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_eahiy")
cell_quadrant_size = 40
format = 2
layer_1/name = ""
layer_1/enabled = true
layer_1/modulate = Color(1, 1, 1, 1)
layer_1/y_sort_enabled = false
layer_1/y_sort_origin = 0
layer_1/z_index = 0
layer_1/tile_data = PackedInt32Array()
script = ExtResource("3_lxogb")
[node name="Main" type="AudioStreamPlayer2D" parent="."]
script = ExtResource("5_vryqo")

24
Components/gather_info.gd Normal file
View file

@ -0,0 +1,24 @@
extends Node2D
signal game_success
signal game_fail
var base_scn = preload("res://Components/gameplay.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
var level = self.name
var base = base_scn.instantiate()
base.planets = Diction.planets_lvl[level]
base.map = Diction.map_lvl[level]
base.connect("game_success", forward.bind("success"))
base.connect("game_fail", forward.bind("fail"))
add_child(base)
$Label.text = Diction.label_lvl[level]
func forward(x):
if (x=="success"):
emit_signal("game_success")
else:
emit_signal("game_fail")

View file

@ -0,0 +1,42 @@
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready():
for child in get_children():
if child.name == "Play":
child.connect("pressed", play)
if child.name == "Credits":
child.connect("pressed", credits)
if child.name == "Menu":
child.connect("pressed", menu)
if child.name == "Map":
child.connect("pressed", map)
if child.name == "Mute":
child.connect("pressed", mute_unmute.bind(child))
if child.name.is_valid_int():
child.connect("pressed", to_level.bind(child.name))
func play():
LevelManager._go_to_level(1)
func credits():
LevelManager._go_to_credits()
func menu():
LevelManager._go_to_menu()
func map():
LevelManager._go_to_map()
func to_level(x):
LevelManager._go_to_level(int(str(x)))
func mute_unmute(child):
if Muter.get_mute():
child.icon = (load("res://Images/sound_on.png"))
else:
child.icon = (load("res://Images/sound_off.png"))
Muter.mute_unmute()

136
Components/higlight_cell.gd Normal file
View file

@ -0,0 +1,136 @@
extends TileMap
var max_pos = {"x": 10, "y": 5}
var min_pos = {"x":4, "y":1}
var occupier_arr = {}
var prev_cell = null
func calculateMin():
return {"x":4, "y":((8-max_pos["y"]))/2}
func draw_map(map):
var rng = RandomNumberGenerator.new()
min_pos = calculateMin()
max_pos = {"x": map[0].size()-1, "y": map.size()-1}
for x in range(0, max_pos["x"]+1):
for y in range(0, max_pos["y"]+1):
if(map[y][x]=="-"):
occupier_arr[str(min_pos["x"]+x)+"-"+str(min_pos["y"]+y)] = ""
if(get_cell_atlas_coords(0,Vector2(min_pos["x"]+x,min_pos["y"]+y))==Vector2i(-1, -1)):
set_cell(0, Vector2(min_pos["x"]+x,min_pos["y"]+y), 1, Vector2(0,0))
elif(map[y][x]=="O"):
occupier_arr[str(min_pos["x"]+x)+"-"+str(min_pos["y"]+y)] = ""
set_cell(0, Vector2(min_pos["x"]+x,min_pos["y"]+y), 1, Vector2(2,0))
else:
occupy_slot(map_to_local(Vector2(min_pos["x"]+x,min_pos["y"]+y)), {
"type": Diction.name_ext[map[y][x]],
"texture": Diction.texture[Diction.name_ext[map[y][x]]],
"modulate": Color(1-rng.randf_range(0,0.1),1-rng.randf_range(0,0.1),1-rng.randf_range(0,0.1)),
"rotation": randf_range(-360,360)
})
func _process(_delta):
var mouse_pos = local_to_map(get_global_mouse_position())
if(!in_range(mouse_pos)) or get_parent().curr_player == null:
if prev_cell != null:
set_cell(1, prev_cell, 1)
prev_cell = null
return
if prev_cell == null:
prev_cell = mouse_pos
return
if prev_cell != mouse_pos:
if(get_cell_atlas_coords(0,mouse_pos)!=Vector2i(2, 0)):
set_cell(1, mouse_pos, 1, Vector2(1,0))
set_cell(1, prev_cell, 1)
prev_cell = mouse_pos
func occupy_slot(pos, player):
var mouse_pos = local_to_map(pos)
if(!in_range(mouse_pos) or get_cell_atlas_coords(0,mouse_pos)==Vector2i(2, 0)):
return false
set_cell(0, mouse_pos, 1, Vector2(2,0))
set_cell(1, mouse_pos, 1)
if player.type!="rock" and player.type!="grass":
paint_neighbors(player.type, mouse_pos)
var sprite = Sprite2D.new()
sprite.texture = player["texture"]
sprite.modulate = player["modulate"]
sprite.rotation_degrees = player["rotation"]
sprite.position = map_to_local(mouse_pos)
add_child(sprite)
occupier_arr[str(mouse_pos.x)+"-"+str(mouse_pos.y)] = player['type']
return true
func paint_neighbors(type, mouse_pos):
var neighbors = [
get_neighbor_cell(mouse_pos, self.tile_set.CellNeighbor.CELL_NEIGHBOR_RIGHT_SIDE ), #CELL_NEIGHBOR_RIGHT_SIDE
get_neighbor_cell(mouse_pos, self.tile_set.CellNeighbor.CELL_NEIGHBOR_LEFT_SIDE ), #CELL_NEIGHBOR_LEFT_SIDE
get_neighbor_cell(mouse_pos, self.tile_set.CellNeighbor.CELL_NEIGHBOR_BOTTOM_SIDE ), #CELL_NEIGHBOR_BOTTOM_SIDE
get_neighbor_cell(mouse_pos, self.tile_set.CellNeighbor.CELL_NEIGHBOR_TOP_SIDE ), #CELL_NEIGHBOR_TOP_SIDE
]
for neighbor in neighbors:
if(!in_range(neighbor) or get_cell_atlas_coords(0,neighbor)==Vector2i(2, 0)):
continue;
if (get_cell_atlas_coords(0,neighbor)!=Vector2i(0, 0) and get_cell_atlas_coords(0,neighbor)!=Vector2i(-1, -1) and
!(type=="sun" and get_cell_atlas_coords(0,neighbor)==Vector2i(0, 1)) and
!(type=="ice" and get_cell_atlas_coords(0,neighbor)==Vector2i(1, 1))):
set_cell(0, neighbor, 1, Vector2(2,1))
else:
if(type=="sun"):
set_cell(0, neighbor, 1, Vector2(0,1))
if(type=="ice"):
set_cell(0, neighbor, 1, Vector2(1,1))
if(type=="black"):
if(neighbor == neighbors[0]):
set_cell(0, neighbor, 1, Vector2(2,2))
if(neighbor == neighbors[1]):
set_cell(0, neighbor, 1, Vector2(3,2))
if(neighbor == neighbors[2]):
set_cell(0, neighbor, 1, Vector2(1,2))
if(neighbor == neighbors[3]):
set_cell(0, neighbor, 1, Vector2(0,2))
func in_range(pos):
return bool(pos.x>=min_pos["x"] and pos.x<=min_pos["x"]+max_pos["x"] and pos.y>=min_pos["y"] and pos.y<=min_pos["y"]+max_pos["y"])
func check_success(pos, player):
var mouse_pos = local_to_map(pos)
var neighbors = [
get_neighbor_cell(mouse_pos, 0 ), #CELL_NEIGHBOR_RIGHT_SIDE
get_neighbor_cell(mouse_pos, 4 ), #CELL_NEIGHBOR_LEFT_SIDE
get_neighbor_cell(mouse_pos, 8 ), #CELL_NEIGHBOR_BOTTOM_SIDE
get_neighbor_cell(mouse_pos, 12 ), #CELL_NEIGHBOR_TOP_SIDE
]
for neighbor in neighbors:
var source_id = self.get_cell_source_id(0, neighbor, false)
if(source_id == -1):
continue
var occupier = occupier_arr[str(neighbor.x)+"-"+str(neighbor.y)]
if (occupier=="black" or
(player.type=="black" and occupier != "") or
(player.type=="ice" and occupier == "sun") or
(player.type=="sun" and occupier == "ice") or
(player.type=="grass" and occupier == "sun") or
(player.type=="grass" and occupier == "ice") or
(player.type=="ice" and occupier == "grass") or
(player.type=="sun" and occupier == "grass")):
return false
return true

View file

@ -0,0 +1,47 @@
[gd_scene load_steps=6 format=3 uid="uid://nkjpbpsveojp"]
[ext_resource type="Texture2D" uid="uid://lp5b8jgmg3g" path="res://Images/panel_level_over.png" id="1_3ww73"]
[ext_resource type="Texture2D" uid="uid://b1equ153xngag" path="res://Images/next.png" id="2_crt0o"]
[ext_resource type="Texture2D" uid="uid://c831drc16pkbk" path="res://Images/map_small.png" id="3_1osls"]
[sub_resource type="LabelSettings" id="LabelSettings_ep2fd"]
line_spacing = 0.0
font_size = 30
[sub_resource type="Theme" id="Theme_tesxp"]
default_font_size = 22
[node name="panel" type="Node2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_3ww73")
[node name="Label" type="Label" parent="."]
offset_left = -96.0
offset_top = -113.0
offset_right = 95.0
offset_bottom = -13.0
text = "Level
completed!"
label_settings = SubResource("LabelSettings_ep2fd")
horizontal_alignment = 1
[node name="Next" type="Button" parent="."]
offset_left = -87.0
offset_right = 112.0
offset_bottom = 68.0
theme = SubResource("Theme_tesxp")
text = "Next level"
icon = ExtResource("2_crt0o")
flat = true
[node name="Map" type="Button" parent="."]
offset_left = -86.0
offset_top = 66.0
offset_right = 89.0
offset_bottom = 134.0
theme = SubResource("Theme_tesxp")
text = "To map
"
icon = ExtResource("3_1osls")
flat = true

View file

@ -0,0 +1,50 @@
[gd_scene load_steps=7 format=3 uid="uid://cbgt7o417o8og"]
[ext_resource type="Texture2D" uid="uid://lp5b8jgmg3g" path="res://Images/panel_level_over.png" id="1_fcgbh"]
[ext_resource type="Texture2D" uid="uid://bwxxlavill7em" path="res://Images/reset.png" id="2_0dcvu"]
[ext_resource type="Texture2D" uid="uid://c831drc16pkbk" path="res://Images/map_small.png" id="3_do5ir"]
[sub_resource type="LabelSettings" id="LabelSettings_ep2fd"]
line_spacing = 0.0
font_size = 30
[sub_resource type="Theme" id="Theme_0sxms"]
default_font_size = 22
[sub_resource type="Theme" id="Theme_ei5xv"]
default_font_size = 22
[node name="panel" type="Node2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_fcgbh")
[node name="Label" type="Label" parent="."]
offset_left = -96.0
offset_top = -111.0
offset_right = 95.0
offset_bottom = -11.0
text = "Level
failed!"
label_settings = SubResource("LabelSettings_ep2fd")
horizontal_alignment = 1
[node name="Reset" type="Button" parent="."]
offset_left = -83.0
offset_right = 64.0
offset_bottom = 68.0
theme = SubResource("Theme_0sxms")
text = "Retry"
icon = ExtResource("2_0dcvu")
flat = true
[node name="Map" type="Button" parent="."]
offset_left = -83.0
offset_top = 66.0
offset_right = 92.0
offset_bottom = 134.0
theme = SubResource("Theme_ei5xv")
text = "To map
"
icon = ExtResource("3_do5ir")
flat = true

View file

@ -0,0 +1,27 @@
extends Control
var level_scn = preload("res://scenes/level.tscn")
func _go_to_level(num):
get_tree().get_current_scene().queue_free()
var root = get_tree().get_root()
if(!Diction.planets_lvl.has(str(num))):
get_tree().change_scene_to_file("res://scenes/victory.tscn")
else:
var level = level_scn.instantiate()
level.name = "Level"
level.curr_level = num
root.add_child(level)
get_tree().set_current_scene(level)
func _go_to_credits():
get_tree().change_scene_to_file("res://scenes/credits.tscn")
func _go_to_menu():
get_tree().change_scene_to_file("res://scenes/menu.tscn")
func _go_to_map():
get_tree().change_scene_to_file("res://scenes/map.tscn")

View file

@ -0,0 +1,54 @@
extends Control
var base_scn = preload("res://scenes/level_inner.tscn")
var victory_panel = preload("res://Components/level_completed.tscn")
var fail_panel = preload("res://Components/level_fail.tscn")
signal game_success
signal game_fail
var curr_level = 1
# Called when the node enters the scene tree for the first time.
func _ready():
var base = base_scn.instantiate()
base.name = str(curr_level)
base.connect("game_success",_spawn_panel.bind("success"))
base.connect("game_fail",_spawn_panel.bind("fail"))
add_child(base)
base.find_child("Reset").connect("pressed",_reset_level)
base.find_child("Map").connect("pressed",_to_map)
base.find_child("Mute").connect("pressed", mute_unmute.bind(base.find_child("Mute")))
func _spawn_panel(panel):
if(panel == "success"):
var p = victory_panel.instantiate()
p.position = Vector2(576, 324)
add_child(p)
p.find_child("Next").connect("pressed",_next_level)
p.find_child("Map").connect("pressed",_to_map)
if(panel == "fail"):
var p = fail_panel.instantiate()
p.position = Vector2(576, 324)
add_child(p)
p.find_child("Reset").connect("pressed",_reset_level)
p.find_child("Map").connect("pressed",_to_map)
func _next_level():
LevelManager._go_to_level(int(curr_level)+1)
func _reset_level():
LevelManager._go_to_level(int(curr_level))
func _to_map():
LevelManager._go_to_map()
func mute_unmute(child):
if Muter.get_mute():
child.icon = (load("res://Images/sound_on.png"))
else:
child.icon = (load("res://Images/sound_off.png"))
Muter.mute_unmute()

18
Components/planet.tscn Normal file
View file

@ -0,0 +1,18 @@
[gd_scene load_steps=5 format=3 uid="uid://wy72xrwtrek0"]
[ext_resource type="Script" path="res://Components/sprite_follow_mouse.gd" id="1_1lk5a"]
[ext_resource type="Texture2D" uid="uid://ljtkplpv5okm" path="res://Images/Rock.png" id="2_8hn2a"]
[ext_resource type="Script" path="res://Components/sprite__variations.gd" id="3_6q0s6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7fgh8"]
size = Vector2(80, 80)
[node name="Area2D" type="Area2D"]
script = ExtResource("1_1lk5a")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_8hn2a")
script = ExtResource("3_6q0s6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_7fgh8")

View file

@ -0,0 +1,32 @@
extends Button
@export var type = "rock"
@export var charges = 3
# Called when the node enters the scene tree for the first time.
func _ready():
adjust_look(charges)
func _on_pressed():
if(charges <1):
return
if get_parent().curr_player != null:
get_parent().change_player()
get_parent().new_player(type)
charges -=1
adjust_look(charges)
func adjust_look(_charges):
for n in get_children():
remove_child(n)
n.queue_free()
for i in range(_charges):
var sprite = Sprite2D.new()
sprite.texture = Diction.texture[type]
sprite.position.x = (get_rect().size.x/2)+(float(i)-float(charges/2))*10
sprite.position.y = get_rect().size.y/2
add_child(sprite)
AudioPlayer._play(type)

11
Components/spawner.tscn Normal file
View file

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=3 uid="uid://dcqe7738k3qwj"]
[ext_resource type="Script" path="res://Components/planet_spawner.gd" id="1_5ujup"]
[node name="Spawner" type="Button"]
offset_right = 140.0
offset_bottom = 70.0
flat = true
script = ExtResource("1_5ujup")
[connection signal="pressed" from="." to="." method="_on_pressed"]

View file

@ -0,0 +1,12 @@
extends Sprite2D
var rng = RandomNumberGenerator.new()
# Called when the node enters the scene tree for the first time.
func _ready():
modulate = Color(1-rng.randf_range(0,0.1),1-rng.randf_range(0,0.1),1-rng.randf_range(0,0.1))
rotation_degrees = randf_range(-360,360)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View file

@ -0,0 +1,11 @@
extends Area2D
@export var type = "planet"
@onready var sprite = $Sprite2D
func _ready():
sprite.texture = Diction.texture[type]
func _process(_delta):
global_position = get_global_mouse_position()

21
Components/sprite_snap.gd Normal file
View file

@ -0,0 +1,21 @@
extends Node2D
@onready var _map = $TileMap
var min_x = 0
var min_y = 0
var max_x = 10
var max_y = 10
var max_border = 100
var prev_coord = null
func _process(_delta):
var mouse_pos = _map.local_to_map(get_global_mouse_position())
_map.set_cell(0, mouse_pos, 0, Vector2(1,0))
if prev_coord != null and prev_coord != mouse_pos:
_map.set_cell(0, prev_coord, 0, Vector2(0,0))
prev_coord = mouse_pos

14
change_level.gd Normal file
View file

@ -0,0 +1,14 @@
extends Node
func go_to_level(num):
get_tree().change_scene("res://scenes/level.tscn")
func go_to_menu():
get_tree().change_scene("res://scenes/menu.tscn")
func go_to_credits():
get_tree().change_scene("res://scenes/credits.tscn")
func go_to_level_map():
get_tree().change_scene("res://scenes/level_map.tscn")

1
icon.svg Normal file
View file

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><g transform="translate(32 32)"><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99z" fill="#363d52"/><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99zm0 4h96c6.64 0 12 5.35 12 11.99v95.98c0 6.64-5.35 11.99-12 11.99h-96c-6.64 0-12-5.35-12-11.99v-95.98c0-6.64 5.36-11.99 12-11.99z" fill-opacity=".4"/></g><g stroke-width="9.92746" transform="matrix(.10073078 0 0 .10073078 12.425923 2.256365)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 919.24059 771.67186)"/><path d="m0 0v-47.514-6.035-5.492c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325c5.09692 6.4164715 9.92323 13.494208 13.621 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.4426579-6.973692 9.2079702-13.9828876 13.621-19.449z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 104.69892 525.90697)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.066.067c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 784.07144 817.24284)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 389.21484 625.67104)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 367.36686 631.05679)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 511.99336 724.73954)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 634.78706 625.67104)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 656.64056 631.05679)"/></g></svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

97
scenes/credits.tscn Normal file
View file

@ -0,0 +1,97 @@
[gd_scene load_steps=13 format=3 uid="uid://bao5s24kn8qpa"]
[ext_resource type="Script" path="res://Components/Background.gd" id="1_423tl"]
[ext_resource type="Script" path="res://Components/general_scene_changer.gd" id="1_xxc27"]
[ext_resource type="Texture2D" uid="uid://b2tu02r3uttdi" path="res://Images/panel_title.png" id="2_gf2cj"]
[ext_resource type="Texture2D" uid="uid://bm167coy4emtp" path="res://Images/bg_tiles.jpg" id="2_w3675"]
[ext_resource type="Script" path="res://Music/Music_Changer.gd" id="3_dn2m5"]
[ext_resource type="Texture2D" uid="uid://cr7vrio6w8l41" path="res://Images/map_big.png" id="4_pc6ee"]
[ext_resource type="Texture2D" uid="uid://c2ao8hiirsvj3" path="res://Images/sound_on.png" id="7_8l5rl"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ckc8x"]
texture = ExtResource("2_w3675")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
[sub_resource type="TileSet" id="TileSet_45bsw"]
tile_size = Vector2i(80, 80)
sources/0 = SubResource("TileSetAtlasSource_ckc8x")
[sub_resource type="LabelSettings" id="LabelSettings_dyh2m"]
font_size = 64
[sub_resource type="Theme" id="Theme_vuhen"]
default_font_size = 40
[sub_resource type="LabelSettings" id="LabelSettings_3s42i"]
font_size = 22
[node name="Node2D" type="Node2D"]
script = ExtResource("1_xxc27")
[node name="Title_back" type="Sprite2D" parent="."]
position = Vector2(576, 120)
texture = ExtResource("2_gf2cj")
[node name="Background" type="TileMap" parent="."]
tile_set = SubResource("TileSet_45bsw")
format = 2
script = ExtResource("1_423tl")
[node name="Label" type="Label" parent="."]
offset_top = 70.0
offset_right = 1153.0
offset_bottom = 220.0
text = "Credits"
label_settings = SubResource("LabelSettings_dyh2m")
horizontal_alignment = 1
[node name="Menu" type="Button" parent="."]
offset_left = 29.0
offset_top = 538.0
offset_right = 501.0
offset_bottom = 626.0
theme = SubResource("Theme_vuhen")
text = "Back to main menu"
icon = ExtResource("4_pc6ee")
flat = true
[node name="Title" type="AudioStreamPlayer2D" parent="."]
script = ExtResource("3_dn2m5")
[node name="Label2" type="Label" parent="."]
offset_left = 68.0
offset_top = 266.0
offset_right = 1078.0
offset_bottom = 478.0
text = "Made for Ludum Dare 54, whose theme was \"limited space\".
This was made for Extra category, though, so instead of a weekend it actually took 2 whole weeks
Game by Cookie_CHR
Music by Kevin MacLeod (incompetech.com)
Sounds by freesound.org"
label_settings = SubResource("LabelSettings_3s42i")
autowrap_mode = 2
[node name="Mute" type="Button" parent="."]
offset_left = 1035.0
offset_top = 537.0
offset_right = 1123.0
offset_bottom = 625.0
icon = ExtResource("7_8l5rl")
flat = true

12
scenes/level.tscn Normal file
View file

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://dvc1i3crokekb"]
[ext_resource type="Script" path="res://Components/manage_win_lose.gd" id="1_1sjci"]
[node name="Level" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_1sjci")

90
scenes/level_inner.tscn Normal file
View file

@ -0,0 +1,90 @@
[gd_scene load_steps=12 format=3 uid="uid://c4ar0urinkumn"]
[ext_resource type="Script" path="res://Components/gather_info.gd" id="1_mu346"]
[ext_resource type="Texture2D" uid="uid://bm167coy4emtp" path="res://Images/bg_tiles.jpg" id="2_yirj8"]
[ext_resource type="Script" path="res://Components/Background.gd" id="3_oqvqd"]
[ext_resource type="Texture2D" uid="uid://bwmvqhr07rn8f" path="res://Images/panel_left.png" id="4_d5jl4"]
[ext_resource type="Texture2D" uid="uid://bwxxlavill7em" path="res://Images/reset.png" id="5_4snwg"]
[ext_resource type="Texture2D" uid="uid://1w1ni6nwrk2g" path="res://Images/panel_right.png" id="5_5pvxa"]
[ext_resource type="Texture2D" uid="uid://c831drc16pkbk" path="res://Images/map_small.png" id="7_ac74y"]
[ext_resource type="Texture2D" uid="uid://c2ao8hiirsvj3" path="res://Images/sound_on.png" id="8_2lwdi"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ckc8x"]
texture = ExtResource("2_yirj8")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
[sub_resource type="TileSet" id="TileSet_jkdn8"]
tile_size = Vector2i(80, 80)
sources/0 = SubResource("TileSetAtlasSource_ckc8x")
[sub_resource type="Theme" id="Theme_oykpo"]
default_font_size = 22
[node name="1" type="Node2D"]
script = ExtResource("1_mu346")
[node name="Background" type="TileMap" parent="."]
tile_set = SubResource("TileSet_jkdn8")
format = 2
script = ExtResource("3_oqvqd")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("4_d5jl4")
centered = false
[node name="Sprite2D2" type="Sprite2D" parent="."]
position = Vector2(912, -1)
texture = ExtResource("5_5pvxa")
centered = false
[node name="Label" type="Label" parent="."]
offset_left = 50.0
offset_top = 143.0
offset_right = 190.0
offset_bottom = 512.0
autowrap_mode = 2
[node name="Reset" type="Button" parent="."]
offset_left = 950.0
offset_top = 52.0
offset_right = 1101.0
offset_bottom = 120.0
theme = SubResource("Theme_oykpo")
text = "Reset"
icon = ExtResource("5_4snwg")
flat = true
[node name="Map" type="Button" parent="."]
offset_left = 950.0
offset_top = 116.0
offset_right = 1112.0
offset_bottom = 184.0
theme = SubResource("Theme_oykpo")
text = "To map"
icon = ExtResource("7_ac74y")
flat = true
[node name="Mute" type="Button" parent="."]
offset_left = 908.0
offset_top = 544.0
offset_right = 996.0
offset_bottom = 632.0
theme = SubResource("Theme_oykpo")
icon = ExtResource("8_2lwdi")
flat = true

15
scenes/manage_win_lose.gd Normal file
View file

@ -0,0 +1,15 @@
extends Control
signal game_success
signal game_fail
var curr_level = 1
# Called when the node enters the scene tree for the first time.
func _ready():
get_child(0).connect("game_success",_next_level)
pass # Replace with function body.
func _next_level():
LevelManager._go_to_level(curr_level+1)

165
scenes/map.tscn Normal file
View file

@ -0,0 +1,165 @@
[gd_scene load_steps=12 format=3 uid="uid://bwfsv1qjmeviv"]
[ext_resource type="Script" path="res://Components/general_scene_changer.gd" id="1_8m7k7"]
[ext_resource type="Texture2D" uid="uid://bm167coy4emtp" path="res://Images/bg_tiles.jpg" id="1_ghmmv"]
[ext_resource type="Script" path="res://Components/Background.gd" id="2_uqh1v"]
[ext_resource type="Texture2D" uid="uid://br1a16wisvhv1" path="res://Images/play.png" id="3_o31g5"]
[ext_resource type="Texture2D" uid="uid://c2jt84cjjanl0" path="res://Images/credits.png" id="4_tjfhq"]
[ext_resource type="Texture2D" uid="uid://ces3pya5ahesu" path="res://Images/button_generic.png" id="6_7q4qy"]
[ext_resource type="Texture2D" uid="uid://c2ao8hiirsvj3" path="res://Images/sound_on.png" id="7_cvauv"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ckc8x"]
texture = ExtResource("1_ghmmv")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
[sub_resource type="TileSet" id="TileSet_i8p2w"]
tile_size = Vector2i(80, 80)
sources/0 = SubResource("TileSetAtlasSource_ckc8x")
[sub_resource type="Theme" id="Theme_q4yhi"]
default_font_size = 40
[sub_resource type="Theme" id="Theme_0nnai"]
default_font_size = 60
[node name="Node2D" type="Node2D"]
script = ExtResource("1_8m7k7")
[node name="Background" type="TileMap" parent="."]
tile_set = SubResource("TileSet_i8p2w")
format = 2
script = ExtResource("2_uqh1v")
[node name="Play" type="Button" parent="."]
offset_left = 35.0
offset_top = 536.0
offset_right = 451.0
offset_bottom = 624.0
theme = SubResource("Theme_q4yhi")
text = " Play from level 1"
icon = ExtResource("3_o31g5")
flat = true
[node name="Credits" type="Button" parent="."]
offset_left = 673.0
offset_top = 534.0
offset_right = 909.0
offset_bottom = 622.0
theme = SubResource("Theme_q4yhi")
text = " Credits"
icon = ExtResource("4_tjfhq")
flat = true
[node name="1" type="Button" parent="."]
offset_left = 216.0
offset_top = 93.0
offset_right = 384.0
offset_bottom = 261.0
theme = SubResource("Theme_0nnai")
text = "1
"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="2" type="Button" parent="."]
offset_left = 398.0
offset_top = 93.0
offset_right = 566.0
offset_bottom = 261.0
theme = SubResource("Theme_0nnai")
text = "2"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="3" type="Button" parent="."]
offset_left = 576.0
offset_top = 93.0
offset_right = 744.0
offset_bottom = 261.0
theme = SubResource("Theme_0nnai")
text = "3"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="4" type="Button" parent="."]
offset_left = 752.0
offset_top = 93.0
offset_right = 920.0
offset_bottom = 261.0
theme = SubResource("Theme_0nnai")
text = "4"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="5" type="Button" parent="."]
offset_left = 216.0
offset_top = 273.0
offset_right = 384.0
offset_bottom = 441.0
theme = SubResource("Theme_0nnai")
text = "5"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="6" type="Button" parent="."]
offset_left = 398.0
offset_top = 273.0
offset_right = 566.0
offset_bottom = 441.0
theme = SubResource("Theme_0nnai")
text = "6"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="7" type="Button" parent="."]
offset_left = 576.0
offset_top = 273.0
offset_right = 744.0
offset_bottom = 441.0
theme = SubResource("Theme_0nnai")
text = "7"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="8" type="Button" parent="."]
offset_left = 752.0
offset_top = 273.0
offset_right = 920.0
offset_bottom = 441.0
theme = SubResource("Theme_0nnai")
text = "8
"
icon = ExtResource("6_7q4qy")
flat = true
icon_alignment = 1
[node name="Mute" type="Button" parent="."]
offset_left = 1035.0
offset_top = 537.0
offset_right = 1123.0
offset_bottom = 625.0
icon = ExtResource("7_cvauv")
flat = true

121
scenes/menu.tscn Normal file
View file

@ -0,0 +1,121 @@
[gd_scene load_steps=15 format=3 uid="uid://idke5d3nbvlb"]
[ext_resource type="Script" path="res://Components/general_scene_changer.gd" id="1_67dfy"]
[ext_resource type="Script" path="res://Components/Background.gd" id="1_n26um"]
[ext_resource type="Texture2D" uid="uid://br1a16wisvhv1" path="res://Images/play.png" id="2_xhpm7"]
[ext_resource type="Texture2D" uid="uid://bm167coy4emtp" path="res://Images/bg_tiles.jpg" id="2_xtxga"]
[ext_resource type="Texture2D" uid="uid://c2jt84cjjanl0" path="res://Images/credits.png" id="3_wi1kt"]
[ext_resource type="Texture2D" uid="uid://b2tu02r3uttdi" path="res://Images/panel_title.png" id="4_h1wkc"]
[ext_resource type="Script" path="res://Music/Music_Changer.gd" id="5_p47x8"]
[ext_resource type="Texture2D" uid="uid://cr7vrio6w8l41" path="res://Images/map_big.png" id="5_sekhn"]
[ext_resource type="Texture2D" uid="uid://c2ao8hiirsvj3" path="res://Images/sound_on.png" id="9_nwuj2"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ckc8x"]
texture = ExtResource("2_xtxga")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
[sub_resource type="TileSet" id="TileSet_rdt8d"]
tile_size = Vector2i(80, 80)
sources/0 = SubResource("TileSetAtlasSource_ckc8x")
[sub_resource type="Theme" id="Theme_bdtx7"]
default_font_size = 40
[sub_resource type="LabelSettings" id="LabelSettings_o5ulb"]
font_size = 20
[sub_resource type="LabelSettings" id="LabelSettings_hit1v"]
font_size = 70
[node name="Menu" type="Node2D"]
script = ExtResource("1_67dfy")
[node name="Background" type="TileMap" parent="."]
tile_set = SubResource("TileSet_rdt8d")
format = 2
script = ExtResource("1_n26um")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(576, 120)
texture = ExtResource("4_h1wkc")
[node name="Play" type="Button" parent="."]
offset_left = 176.0
offset_top = 302.0
offset_right = 592.0
offset_bottom = 390.0
theme = SubResource("Theme_bdtx7")
text = " Play from level 1"
icon = ExtResource("2_xhpm7")
flat = true
[node name="Map" type="Button" parent="."]
offset_left = 176.0
offset_top = 394.0
offset_right = 419.0
offset_bottom = 482.0
theme = SubResource("Theme_bdtx7")
text = " To map"
icon = ExtResource("5_sekhn")
flat = true
[node name="Credits" type="Button" parent="."]
offset_left = 176.0
offset_top = 487.0
offset_right = 412.0
offset_bottom = 575.0
theme = SubResource("Theme_bdtx7")
text = " Credits"
icon = ExtResource("3_wi1kt")
flat = true
[node name="Title" type="AudioStreamPlayer2D" parent="."]
script = ExtResource("5_p47x8")
[node name="Title_label" type="Label" parent="."]
offset_top = 38.0
offset_right = 1153.0
offset_bottom = 188.0
text = "Welcome to"
label_settings = SubResource("LabelSettings_o5ulb")
horizontal_alignment = 1
[node name="Title_label2" type="Label" parent="."]
offset_top = 65.0
offset_right = 1153.0
offset_bottom = 215.0
text = "S. P. Ace Ltd"
label_settings = SubResource("LabelSettings_hit1v")
horizontal_alignment = 1
[node name="Title_label3" type="Label" parent="."]
offset_top = 158.0
offset_right = 1153.0
offset_bottom = 223.0
text = "Where we provide planets for all your universal needs!"
label_settings = SubResource("LabelSettings_o5ulb")
horizontal_alignment = 1
[node name="Mute" type="Button" parent="."]
offset_left = 1035.0
offset_top = 537.0
offset_right = 1123.0
offset_bottom = 625.0
icon = ExtResource("9_nwuj2")
flat = true

77
scenes/victory.tscn Normal file
View file

@ -0,0 +1,77 @@
[gd_scene load_steps=11 format=3 uid="uid://ckw1xtbjh8ww3"]
[ext_resource type="Script" path="res://Components/general_scene_changer.gd" id="1_do0t6"]
[ext_resource type="Texture2D" uid="uid://bm167coy4emtp" path="res://Images/bg_tiles.jpg" id="2_k07c0"]
[ext_resource type="Script" path="res://Components/Background.gd" id="2_uq73q"]
[ext_resource type="Texture2D" uid="uid://br1a16wisvhv1" path="res://Images/play.png" id="3_cq5fk"]
[ext_resource type="Texture2D" uid="uid://c2jt84cjjanl0" path="res://Images/credits.png" id="4_ja667"]
[ext_resource type="Script" path="res://Music/Music_Changer.gd" id="5_5ahf7"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ckc8x"]
texture = ExtResource("2_k07c0")
texture_region_size = Vector2i(80, 80)
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
[sub_resource type="TileSet" id="TileSet_j64ai"]
tile_size = Vector2i(80, 80)
sources/0 = SubResource("TileSetAtlasSource_ckc8x")
[sub_resource type="LabelSettings" id="LabelSettings_lbbq6"]
font_size = 64
[sub_resource type="Theme" id="Theme_rbj1f"]
default_font_size = 40
[node name="Victory" type="Node2D"]
script = ExtResource("1_do0t6")
[node name="Background" type="TileMap" parent="."]
tile_set = SubResource("TileSet_j64ai")
format = 2
script = ExtResource("2_uq73q")
[node name="Label" type="Label" parent="."]
offset_right = 1153.0
offset_bottom = 150.0
text = "Congratulations,
you won the game!"
label_settings = SubResource("LabelSettings_lbbq6")
horizontal_alignment = 1
[node name="Play" type="Button" parent="."]
offset_left = 176.0
offset_top = 279.0
offset_right = 470.0
offset_bottom = 367.0
theme = SubResource("Theme_rbj1f")
text = " Play again"
icon = ExtResource("3_cq5fk")
flat = true
[node name="Credits" type="Button" parent="."]
offset_left = 176.0
offset_top = 378.0
offset_right = 412.0
offset_bottom = 466.0
theme = SubResource("Theme_rbj1f")
text = " Credits"
icon = ExtResource("4_ja667")
flat = true
[node name="Title" type="AudioStreamPlayer2D" parent="."]
script = ExtResource("5_5ahf7")