Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignable Sounds to Countdown (per-stage) #15439

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/limo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week4",
"defaultZoom": 0.9,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [1030, -120],
"girlfriend": [400, 130],
Expand All @@ -27,4 +28,4 @@
"boyfriend": "bf-car",
"gf": "gf-car"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/mall.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week5",
"defaultZoom": 0.8,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [970, 100],
"girlfriend": [400, 130],
Expand All @@ -28,4 +29,4 @@
"boyfriend": "bf-christmas",
"gf": "gf-christmas"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/mallEvil.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week5",
"defaultZoom": 1.05,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [1090, 100],
"girlfriend": [400, 130],
Expand All @@ -24,4 +25,4 @@
"boyfriend": "bf-christmas",
"gf": "gf-christmas"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/philly.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week3",
"defaultZoom": 1.05,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [770, 100],
"girlfriend": [400, 130],
Expand All @@ -27,4 +28,4 @@
"boyfriend": "bf",
"gf": "gf"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/phillyBlazin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "weekend1",
"defaultZoom": 0.75,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [900, 800],
"girlfriend": [470, 595],
Expand Down Expand Up @@ -30,4 +31,4 @@
"boyfriend": "pico-playable",
"gf": "nene"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/phillyStreets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "weekend1",
"defaultZoom": 0.77,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [1930, 450],
"girlfriend": [1175, 200],
Expand Down Expand Up @@ -38,4 +39,4 @@
"boyfriend": "pico-playable",
"gf": "nene"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/school.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week6",
"defaultZoom": 1.05,
"stageUI": "pixel",
"introSounds": ["intro3-pixel", "intro2-pixel", "intro1-pixel", "introGo-pixel"],

"boyfriend": [970, 320],
"girlfriend": [580, 430],
Expand All @@ -28,4 +29,4 @@
"boyfriend": "bf-pixel",
"gf": "gf-pixel"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/schoolEvil.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week6",
"defaultZoom": 1.05,
"stageUI": "pixel",
"introSounds": ["intro3-pixel", "intro2-pixel", "intro1-pixel", "introGo-pixel"],

"boyfriend": [970, 320],
"girlfriend": [580, 430],
Expand All @@ -24,4 +25,4 @@
"boyfriend": "bf-pixel",
"gf": "gf-pixel"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/spooky.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week2",
"defaultZoom": 1.05,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [770, 100],
"girlfriend": [400, 130],
Expand All @@ -23,4 +24,4 @@
"boyfriend": "bf",
"gf": "gf"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week1",
"defaultZoom": 0.9,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [770, 100],
"girlfriend": [400, 130],
Expand All @@ -25,4 +26,4 @@
"boyfriend": "bf",
"gf": "gf"
}
}
}
3 changes: 2 additions & 1 deletion assets/base_game/shared/stages/tank.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"directory": "week7",
"defaultZoom": 0.9,
"stageUI": "",
"introSounds": ["intro3", "intro2", "intro1", "introGo"],

"boyfriend": [810, 100],
"girlfriend": [200, 65],
Expand Down Expand Up @@ -31,4 +32,4 @@
"boyfriend": "bf",
"gf": "gf-tankmen"
}
}
}
4 changes: 2 additions & 2 deletions setup/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ haxelib install lime 8.1.2
haxelib install openfl 9.3.3
haxelib install flixel 5.6.1
haxelib install flixel-addons 3.2.2
haxelib install flixel-tools 1.5.1
haxelib install flixel-tools 1.5.1
haxelib install hscript-iris 1.0.2
haxelib install tjson 1.4.0
haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c072720e0d1236b94afe68e3e
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit 633fcc051399afed6781dd60cbf30ed8c3fe2c5a
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc 3538a1c2bb07b04208cd014220207f8173acdb21
haxelib git hxvlc https://github.com/MAJigsaw77/hxvlc 70e7f5f3e76d526ac6fb8f0e6665efe7dfda589d
haxelib git funkin.vis https://github.com/FunkinCrew/funkVis d5361037efa3a02c4ab20b5bd14ca11e7d00f519
haxelib git funkin.vis https://github.com/FunkinCrew/funkVis 22b1ce089dd924f15cdc4632397ef3504d464e90
haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666
echo Finished!
2 changes: 1 addition & 1 deletion setup/windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c0
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit 633fcc051399afed6781dd60cbf30ed8c3fe2c5a
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc 3538a1c2bb07b04208cd014220207f8173acdb21
haxelib git hxvlc https://github.com/MAJigsaw77/hxvlc 70e7f5f3e76d526ac6fb8f0e6665efe7dfda589d
haxelib git funkin.vis https://github.com/FunkinCrew/funkVis d5361037efa3a02c4ab20b5bd14ca11e7d00f519
haxelib git funkin.vis https://github.com/FunkinCrew/funkVis 22b1ce089dd924f15cdc4632397ef3504d464e90
haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666
echo Finished!
pause
14 changes: 14 additions & 0 deletions source/backend/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ class CoolUtil
inline public static function capitalize(text:String)
return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();

/**
* Plays a sound safely by checking if it exists or not.
*
* made to play some sounds in-game with no concerns as to whether it will crash or not.
*
* this is safer than calling Paths.sound due to an extra check
* @param sound The sound stream (i.e: String, openfl.media.Sound, etc)
* @param volume Sound's volume
**/
public static function playSoundSafe(sound:flixel.system.FlxAssets.FlxSoundAsset, ?beepOnError: Bool = true, volume: Float = 1.0)
{
if(sound != null) FlxG.sound.play(sound, volume);
}

inline public static function coolTextFile(path:String):Array<String>
{
var daList:String = null;
Expand Down
12 changes: 6 additions & 6 deletions source/backend/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ class Paths
return 'assets/videos/$key.$VIDEO_EXT';
}

inline static public function sound(key:String, ?modsAllowed:Bool = true):Sound
return returnSound('sounds/$key', modsAllowed);
inline static public function sound(key:String, ?modsAllowed:Bool = true, ?playBeep: Bool = true):Sound
return returnSound('sounds/$key', null, modsAllowed, playBeep);

inline static public function music(key:String, ?modsAllowed:Bool = true):Sound
return returnSound('music/$key', modsAllowed);
inline static public function music(key:String, ?modsAllowed:Bool = true, ?playBeep: Bool = true):Sound
return returnSound('music/$key', null, modsAllowed, playBeep);

inline static public function inst(song:String, ?modsAllowed:Bool = true):Sound
return returnSound('${formatToSongPath(song)}/Inst', 'songs', modsAllowed);
Expand Down Expand Up @@ -198,7 +198,7 @@ class Paths

if (bitmap == null)
{
trace('oh no its returning null NOOOO ($file)');
trace('Tried loading bitmap, caught null at "$file"');
return null;
}
}
Expand Down Expand Up @@ -246,7 +246,7 @@ class Paths
return 'assets/fonts/$key';
}

public static function fileExists(key:String, type:AssetType, ?ignoreMods:Bool = false, ?parentFolder:String = null)
public static function fileExists(key:String, ?type:AssetType = TEXT, ?ignoreMods:Bool = false, ?parentFolder:String = null)
{
#if MODS_ALLOWED
if(!ignoreMods)
Expand Down
3 changes: 3 additions & 0 deletions source/backend/StageData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ typedef StageFile = {
var defaultZoom:Float;
@:optional var isPixelStage:Null<Bool>;
var stageUI:String;
@default(["intro3", "intro2", "intro1", "introGo"])
var introSounds: Array<String>;

var boyfriend:Array<Dynamic>;
var girlfriend:Array<Dynamic>;
Expand Down Expand Up @@ -42,6 +44,7 @@ class StageData {
directory: "",
defaultZoom: 0.9,
stageUI: "normal",
introSounds: ["intro3", "intro2", "intro1", "introGo"],

boyfriend: [770, 100],
girlfriend: [400, 130],
Expand Down
2 changes: 1 addition & 1 deletion source/states/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class MainMenuState extends MusicBeatState
}
}
});

for (memb in menuItems)
{
if(memb == item)
Expand Down
Loading