music no longer hard coded

This commit is contained in:
pennyrigate 2023-01-10 00:07:00 -05:00
parent 3b52ec2cbf
commit 1e0202864f
16 changed files with 151 additions and 101 deletions

View file

@ -1,3 +1,3 @@
source_md5="80a374a7f80261ece53dd37429da46c1"
dest_md5="87a32645729271bbe1cb1f471b22c2d9"
source_md5="aff7804c167257371eab7b5aa385d22d"
dest_md5="bfae7fad8d38eb817dfedfbc4bd4220d"

View file

@ -0,0 +1,3 @@
source_md5="1771a21a6b8409378f2c52aaf535f670"
dest_md5="58eed7ee61fb42886dc28383cf6521a8"

BIN
audio/music/smokestack.mp3 Normal file

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/smokestack.mp3-27e96096ab30e2a396e177e479e12ab9.mp3str"
[deps]
source_file="res://audio/music/smokestack.mp3"
dest_files=[ "res://.import/smokestack.mp3-27e96096ab30e2a396e177e479e12ab9.mp3str" ]
[params]
loop=true
loop_offset=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

After

Width:  |  Height:  |  Size: 494 B

Before After
Before After

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=13 format=2]
[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=1]
[ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2]
@ -8,37 +8,61 @@
[ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=6]
[ext_resource path="res://objects/enemy/snail.tscn" type="PackedScene" id=7]
[ext_resource path="res://graphics/backgrounds/cave.png" type="Texture" id=8]
[ext_resource path="res://objects/ladder/ladder.tscn" type="PackedScene" id=9]
[ext_resource path="res://objects/enemy/bat.tscn" type="PackedScene" id=10]
[ext_resource path="res://maps/map.gd" type="Script" id=11]
[ext_resource path="res://audio/music/smokestack.mp3" type="AudioStream" id=12]
[node name="Map" type="Node2D"]
script = ExtResource( 11 )
music = ExtResource( 12 )
[node name="Camera2D" parent="." instance=ExtResource( 6 )]
[node name="Sprite" type="Sprite" parent="Camera2D"]
position = Vector2( 128, 96 )
z_index = -2
texture = ExtResource( 8 )
[node name="CanvasLayer" parent="." instance=ExtResource( 4 )]
[node name="Enemies" type="Node2D" parent="."]
[node name="Snail" parent="Enemies" instance=ExtResource( 7 )]
position = Vector2( 88, 171 )
left_up_boundry = 3.0
right_down_boundry = 3.0
[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 32, 166 )
[node name="Ground" type="TileMap" parent="."]
tile_set = ExtResource( 2 )
cell_size = Vector2( 8, 8 )
collision_layer = 9
format = 1
tile_data = PoolIntArray( 1245200, 0, 65537, 1245201, 0, 65537, 1245202, 0, 65537, 1245203, 0, 65537, 1310741, 0, 65537, 1376268, 0, 262144, 1376274, 0, 262144, 1376284, 0, 262144, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 1441830, 0, 0, 1441831, 0, 0, 1441832, 0, 0, 1441833, 0, 0, 1441834, 0, 0, 1441835, 0, 0, 1441836, 0, 0, 1441837, 0, 0, 1441838, 0, 0, 1441839, 0, 0, 1441840, 0, 0, 1441841, 0, 0, 1441842, 0, 0, 1441843, 0, 0, 1441844, 0, 0, 1441845, 0, 0, 1441846, 0, 0, 1441847, 0, 0, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0 )
tile_data = PoolIntArray( 851983, 0, 65537, 851984, 0, 65537, 851985, 0, 65537, 851986, 0, 65537, 851987, 0, 65537, 851988, 0, 65537, 983040, 0, 65537, 983041, 0, 65537, 983042, 0, 65537, 983045, 0, 65537, 983046, 0, 65537, 983047, 0, 65537, 983048, 0, 65537, 983049, 0, 65537, 983050, 0, 65537, 983051, 0, 65537, 1048591, 0, 65537, 1048592, 0, 65537, 1048593, 0, 65537, 1048594, 0, 65537, 1048595, 0, 65537, 1048596, 0, 65537, 1179658, 0, 65537, 1179659, 0, 65537, 1245200, 0, 65537, 1245201, 0, 65537, 1245202, 0, 65537, 1245203, 0, 65537, 1310727, 0, 65537, 1310728, 0, 65537, 1310729, 0, 65537, 1310741, 0, 65537, 1376268, 0, 262144, 1376274, 0, 262144, 1376284, 0, 262144, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 1441830, 0, 0, 1441831, 0, 0, 1441832, 0, 0, 1441833, 0, 0, 1441834, 0, 0, 1441835, 0, 0, 1441836, 0, 0, 1441837, 0, 0, 1441838, 0, 0, 1441839, 0, 0, 1441840, 0, 0, 1441841, 0, 0, 1441842, 0, 0, 1441843, 0, 0, 1441844, 0, 0, 1441845, 0, 0, 1441846, 0, 0, 1441847, 0, 0, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0 )
[node name="Rock" parent="." instance=ExtResource( 3 )]
[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 32, 166 )
[node name="Ladder" type="TileMap" parent="."]
tile_set = ExtResource( 2 )
cell_size = Vector2( 8, 8 )
collision_layer = 9
format = 1
tile_data = PoolIntArray( 786445, 0, 196610, 851981, 0, 196608, 917517, 0, 196608, 983053, 0, 196608, 1048589, 0, 196608, 1114125, 0, 196608, 1179661, 0, 196608, 1245197, 0, 196608, 1245200, 0, 65537, 1245201, 0, 65537, 1245202, 0, 65537, 1245203, 0, 65537, 1310727, 0, 65537, 1310728, 0, 65537, 1310729, 0, 65537, 1310733, 0, 196608, 1310741, 0, 65537, 1376268, 0, 262144, 1376269, 0, 196609, 1376274, 0, 262144, 1376284, 0, 262144, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 1441830, 0, 0, 1441831, 0, 0, 1441832, 0, 0, 1441833, 0, 0, 1441834, 0, 0, 1441835, 0, 0, 1441836, 0, 0, 1441837, 0, 0, 1441838, 0, 0, 1441839, 0, 0, 1441840, 0, 0, 1441841, 0, 0, 1441842, 0, 0, 1441843, 0, 0, 1441844, 0, 0, 1441845, 0, 0, 1441846, 0, 0, 1441847, 0, 0, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0 )
[node name="Platforms" type="Node2D" parent="."]
[node name="Ladder" parent="Platforms" instance=ExtResource( 9 )]
position = Vector2( 104, 96 )
scale = Vector2( 1, 10 )
[node name="Rock" parent="Platforms" instance=ExtResource( 3 )]
position = Vector2( 138, 144 )
[node name="Enemies" type="Node2D" parent="."]
[node name="Snail" parent="Enemies" instance=ExtResource( 7 )]
position = Vector2( 194, 171 )
left_up_boundry = 3.0
right_down_boundry = 3.0
[node name="Bat" parent="Enemies" instance=ExtResource( 10 )]
position = Vector2( 120, 96 )
right_down_boundry = 10.0
[node name="Death" type="TileMap" parent="."]
tile_set = ExtResource( 5 )
cell_size = Vector2( 8, 8 )

View file

@ -45,7 +45,7 @@ func _physics_process(delta):
Game.change_map(levels.level[current_level].scene)
func change_current_shard(amount):
if current_shard + amount != 0 && current_shard + amount != 8: #Check if in range
if current_shard + amount != -1 && current_shard + amount != 8: #Check if in range
current_shard += amount
shard_arrow.position.x += 15 * amount

View file

@ -0,0 +1,11 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://maps/leveldata/level_info.gd" type="Script" id=1]
[ext_resource path="res://maps/cave.tscn" type="PackedScene" id=2]
[resource]
script = ExtResource( 1 )
level_title = "Blue Ray Cavern"
shard_title = [ "Climb the big vine", "Next to the lone tree", "Slime's Treasure", "The snake pit", "5 Rainbow Stars", "Collection bonus", "Time bonus", "Life bonus", "", "" ]
level_number = 0
scene = ExtResource( 2 )

View file

@ -6,6 +6,6 @@
[resource]
script = ExtResource( 1 )
level_title = "Level 1"
shard_title = [ "Climb the big vine", "Next to the lone tree", "Slime's Treasure", "The snake pit", "5 Rainbow Stars", "Collection bonus", "Time bonus", "Life bonus", "Beat without dying", "No turning platforms" ]
shard_title = [ "Climb the big vine", "Next to the lone tree", "Slime's Treasure", "The snake pit", "5 Rainbow Stars", "Collection bonus", "Time bonus", "Life bonus", "", "" ]
level_number = 0
scene = ExtResource( 2 )

View file

@ -1,9 +1,10 @@
[gd_resource type="Resource" load_steps=4 format=2]
[gd_resource type="Resource" load_steps=5 format=2]
[ext_resource path="res://maps/leveldata/level1_info.tres" type="Resource" id=1]
[ext_resource path="res://maps/leveldata/levels.gd" type="Script" id=2]
[ext_resource path="res://maps/leveldata/level0_info.tres" type="Resource" id=3]
[ext_resource path="res://maps/leveldata/cave_info.tres" type="Resource" id=4]
[resource]
script = ExtResource( 2 )
level = [ ExtResource( 3 ), ExtResource( 1 ) ]
level = [ ExtResource( 3 ), ExtResource( 1 ), ExtResource( 4 ) ]

View file

@ -10,7 +10,7 @@ var life_bonus = true
var collectible_bonus = false
func _ready():
Game.play_sound(load("res://audio/music/rumble_loop.mp3"),Game.ac_music)
Game.play_sound(music,Game.ac_music)
Game.current_level = save_location
func _physics_process(delta):

View file

@ -32,7 +32,6 @@ save_location = 1
music = ExtResource( 19 )
[node name="Camera2D" parent="." instance=ExtResource( 8 )]
smoothing_enabled = false
[node name="Background" type="Sprite" parent="Camera2D"]
z_index = -2

View file

@ -1,84 +1,6 @@
[gd_scene load_steps=4 format=2]
[sub_resource type="GDScript" id=5]
script/source = "extends CanvasLayer
#Console by hazel
export var max_lines: int = 10
export var opacity: float = 0.5
onready var console: Label = $Console
onready var line_edit = $LineEdit
var lines: int = 0
var time: float = 0.0
var n: int = 0
var debug = false
func _ready():
#Auto do debug when playtesting
if not OS.is_debug_build():
console.visible = false
debug = false
else:
console.visible = false
debug = true
$Console/Panel.modulate.a = opacity
console.modulate.a = opacity
func _physics_process(delta):
#DEBUG
if debug == true:
#Show console
if Input.is_action_just_pressed(\"debug_show\"):
console.visible = !console.visible
#Restart scene
if Input.is_action_just_pressed(\"debug_restart\"):
if Game.score > Game.high_score: Game.high_score = Game.score
Game.score = 0
Game.golds = 0
Game.stars = [false,false,false,false,false]
Game.shards = 0
Game.arrows = 0
Game.lives = 2
Game.ac_climb.stop()
get_tree().reload_current_scene()
#Move player to mouse
if Input.is_action_pressed(\"debug_move_player\"):
Game.get_map().get_node(\"Player\").position = get_viewport().get_mouse_position()
Debug.print(get_viewport().get_mouse_position())
#Debug 1
if Input.is_action_just_pressed(\"debug_1\"):
Game.change_map(load(\"res://maps/level_select.tscn\"))
#Debug 2
if Input.is_action_just_pressed(\"debug_2\"):
var save = ConfigFile.new()
save.load(str(\"user://file\") + str(1) + str(\".pr\"))
Game.score = save.get_value(str(Game.current_level),\"Score\",0)
func print(text):
lines += 1
if lines > 1:
console.text += \"\\n\"
if lines > 10:
var n = console.text.find(\"\\n\")
var t = console.text
t.erase(0, n+1)
lines -= 1
console.text = t + str(text)
else:
console.text += str(text)
func _on_visible_toggled(button_pressed):
if button_pressed:
console.visible = true
else:
console.visible = false
"
[ext_resource path="res://scripts/debug.gd" type="Script" id=1]
[sub_resource type="InputEventAction" id=4]
action = "toggle_console"
@ -88,7 +10,7 @@ shortcut = SubResource( 4 )
[node name="Debug" type="CanvasLayer"]
layer = 128
script = SubResource( 5 )
script = ExtResource( 1 )
[node name="Console" type="Label" parent="."]
anchor_right = 1.0

75
scripts/debug.gd Normal file
View file

@ -0,0 +1,75 @@
extends CanvasLayer
#Console by hazel
#Export
export var max_lines: int = 10
export var opacity: float = 0.5
#Onready
onready var console: Label = $Console
##Runtime
var lines: int = 0
var time: float = 0.0
var n: int = 0
var debug = false
func _ready():
#Auto do debug when playtesting
if not OS.is_debug_build():
console.visible = false
debug = false
else:
console.visible = false
debug = true
$Console/Panel.modulate.a = opacity
console.modulate.a = opacity
func _physics_process(delta):
#DEBUG
if debug == true:
#Show console
if Input.is_action_just_pressed("debug_show"):
console.visible = !console.visible
#Restart scene
if Input.is_action_just_pressed("debug_restart"):
if Game.score > Game.high_score: Game.high_score = Game.score
Game.score = 0
Game.golds = 0
Game.stars = [false,false,false,false,false]
Game.shards = 0
Game.arrows = 0
Game.lives = 2
Game.ac_climb.stop()
get_tree().reload_current_scene()
#Move player to mouse
if Input.is_action_pressed("debug_move_player"):
Game.get_map().get_node("Player").position = get_viewport().get_mouse_position()
Debug.print(get_viewport().get_mouse_position())
#Debug 1
if Input.is_action_just_pressed("debug_1"):
Game.change_map(load("res://maps/level_select.tscn"))
#Debug 2
if Input.is_action_just_pressed("debug_2"):
var save = ConfigFile.new()
save.load(str("user://file") + str(1) + str(".pr"))
Game.score = save.get_value(str(Game.current_level),"Score",0)
func print(text):
lines += 1
if lines > 1:
console.text += "\n"
if lines > 10:
var n = console.text.find("\n")
var t = console.text
t.erase(0, n+1)
lines -= 1
console.text = t + str(text)
else:
console.text += str(text)
func _on_visible_toggled(button_pressed):
if button_pressed:
console.visible = true
else:
console.visible = false