fixed stuff for porting WIP 9

new stage xml camera starting point
This commit is contained in:
⍚~Nex
2024-02-25 16:43:00 +01:00
parent 4831faeb8c
commit e18e1a2c7a
15 changed files with 31 additions and 39 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.9" name="limo" folder="stages/limo/">
<stage zoom="0.9" name="limo" folder="stages/limo/" startCamPosY="400">
<!-- BG LIMOS !-->
<sprite name="skyBG" x="-120" y="-50" sprite="limoSunset" scroll="0.1" zoomfactor="0"/>
<sprite name="bgLimo" x="-200" y="480" sprite="bgLimo" scroll="0.4" zoomfactor="0.55" />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="mall-evil" folder="stages/mall/">
<stage zoom="1.05" name="mall-evil" folder="stages/mall/" startCamPosY="400" startCamPosX="1300">
<sprite name="bg" x="-400" y="-500" sprite="evilBG" scroll="0.2"/>
<sprite name="evilTree" x="300" y="-300" sprite="evilTree" scroll="0.2"/>
<sprite name="evilSnow" x="-200" y="700" sprite="evilSnow" />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.8" name="mall" folder="stages/mall/">
<stage zoom="0.8" name="mall" folder="stages/mall/" startCamPosY="450" startCamPosX="500">
<sprite name="bg" x="-1000" y="-500" sprite="bgWalls" scroll="0.2"/>
<high-memory>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="philly" folder="stages/philly/">
<stage zoom="1.05" name="philly" folder="stages/philly/" startCamPosY="510" startCamPosX="950">
<sprite name="bg" x="-100" y="0" sprite="sky" scroll="0.1" zoomfactor="0"/>
<sprite name="city" x="-10" y="0" sprite="city" scroll="0.3" scale="0.85" updateHitbox="true" zoomfactor="0.3"/>
<sprite name="light" x="-10" y="0" sprite="win" scroll="0.3" scale="0.85" updateHitbox="true" zoomfactor="0.3"/>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1" name="school-evil" folder="stages/school/" >
<stage zoom="1" name="school-evil" folder="stages/school/" startCamPosY="200" startCamPosX="300">
<sprite name="bg" x="400" y="200" sprite="animatedEvilSchool"
antialiasing="false" scale="6" scrollx="0.8" scrolly="0.9" type="loop"/>
</stage>
+4 -9
View File
@@ -1,15 +1,10 @@
function create() {
importScript("data/scripts/pixel");
if (PlayState.SONG.meta.name.toLowerCase() == "roses") {
flabbergastGirls();
bgGirls.animation.remove("danceLeft");
bgGirls.animation.remove("danceRight");
bgGirls.animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false);
bgGirls.animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false);
}
bgGirls.animation.play("danceLeft", true); // horrible fix, please fix later
}
public function flabbergastGirls() {
bgGirls.animation.remove("danceLeft");
bgGirls.animation.remove("danceRight");
bgGirls.animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false);
bgGirls.animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false);
bgGirls.animation.play("danceLeft", true);
}
+2 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1" folder="stages/school/">
<stage zoom="1" folder="stages/school/" startCamPosY="550" startCamPosX="600">
<sprite name="bgSky" x="-12" y="0" sprite="weebSky"
antialiasing="false" scale="6" scroll="0.1" updateHitbox="true"/>
@@ -23,7 +23,7 @@
antialiasing="false" scale="6" scroll="0.85" updateHitbox="true" type="loop"/>
</high-memory>
<sprite name="bgGirls" x="-100" y="190" sprite="bgFreaks" scroll="0.9" scale="6" antialiasing="false" updateHitbox="true">
<sprite name="bgGirls" x="-100" y="190" sprite="bgFreaks" scroll="0.9" scale="6" antialiasing="false" updateHitbox="true" type="onbeat">
<anim name="danceLeft" anim="BG girls group" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13" fps="24" loop="false"/>
<anim name="danceRight" anim="BG girls group" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" fps="24" loop="false"/>
</sprite>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="spooky" folder="stages/spooky/">
<stage zoom="1.05" name="spooky" folder="stages/spooky/" startCamPosY="400" startCamPosX="600">
<sprite name="bg" x="-200" y="-100" sprite="halloween_bg" anim="idle" type="none" scale="1.05">
<anim name="idle" anim="halloweem bg0" type="loop" />
<anim name="lightning" anim="halloweem bg lightning strike" loop="false"/>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.9" name="stage" folder="stages/default/">
<stage zoom="0.9" name="stage" folder="stages/default/" startCamPosY="600" startCamPosX="1000">
<sprite name="bg" x="-600" y="-200" sprite="stageback" scroll="0.9" />
<sprite name="stageFront" x="-600" y="600" sprite="stagefront" scroll="0.9" />
<girlfriend />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.9" name="tank" folder="stages/tank/">
<stage zoom="0.9" name="tank" folder="stages/tank/" startCamPosY="400" startCamPosX="300">
<!-- BG STUFF -->
<sprite name="tankSky" x="-400" y="-600" sprite="tankSky" scroll="0" zoomfactor="0"/>
<high-memory>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -13
View File
@@ -563,19 +563,22 @@ class PlayState extends MusicBeatState
comboGroup.maxSize = 25;
#end
// SCRIPTS & STAGE INITIALISATION
// CAMERA, SCRIPTS & STAGE INITIALISATION
#if REGION
camFollow = new FlxObject(0, 0, 2, 2);
add(camFollow);
if (SONG.stage == null || SONG.stage.trim() == "") SONG.stage = "stage";
add(stage = new Stage(SONG.stage));
// var camPos:FlxPoint = new FlxPoint(dadMidpoint.x, dadMidpoint.y);
// dadMidpoint.put();
var camPos:FlxPoint = new FlxPoint(0, 0);
FlxG.camera.follow(camFollow, LOCKON, 0.04);
FlxG.camera.zoom = defaultCamZoom;
// camHUD.zoom = defaultHudZoom;
if (!chartingMode || Options.charterEnablePlaytestScripts) {
switch(SONG.meta.name) {
// case "":
// ADD YOUR HARDCODED SCRIPTSa HERE!
// ADD YOUR HARDCODED SCRIPTS HERE!
default:
var scriptsFolders:Array<String> = ['songs/${SONG.meta.name.toLowerCase()}/scripts', 'data/charts/', 'songs/'];
@@ -675,7 +678,7 @@ class PlayState extends MusicBeatState
scripts.call("create");
#end
// CAMERA & HUD INITIALISATION
// HUD INITIALISATION & CAMERA FINALISATION
#if REGION
var event = EventManager.get(AmountEvent).recycle(4);
if (!scripts.event("onPreGenerateStrums", event).cancelled) {
@@ -686,13 +689,7 @@ class PlayState extends MusicBeatState
for(str in strumLines)
str.generate(str.data, (chartingMode && Charter.startHere) ? Charter.startTime : null);
camFollow = new FlxObject(0, 0, 2, 2);
camFollow.setPosition(camPos.x, camPos.y);
add(camFollow);
FlxG.camera.follow(camFollow, LOCKON, 0.04);
FlxG.camera.zoom = defaultCamZoom;
// camHUD.zoom = defaultHudZoom;
// Its after all of that code for scripts stuff - Nex
if (smoothTransitionData != null && smoothTransitionData.stage == curStage) {
FlxG.camera.scroll.set(smoothTransitionData.camX, smoothTransitionData.camY);
FlxG.camera.zoom = smoothTransitionData.camZoom;
+4 -4
View File
@@ -48,10 +48,10 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (stageXML != null) {
if (PlayState.instance != null) {
if (stageXML.has.zoom) {
var parsed:Null<Float> = Std.parseFloat(stageXML.att.zoom);
if (parsed != null && PlayState.instance != null) PlayState.instance.defaultCamZoom = parsed;
}
var parsed:Null<Float>;
if(stageXML.has.startCamPosX && (parsed = Std.parseFloat(stageXML.att.startCamPosX)) != null) PlayState.instance.camFollow.x = parsed;
if(stageXML.has.startCamPosY && (parsed = Std.parseFloat(stageXML.att.startCamPosY)) != null) PlayState.instance.camFollow.y = parsed;
if(stageXML.has.zoom && (parsed = Std.parseFloat(stageXML.att.zoom)) != null) PlayState.instance.defaultCamZoom = parsed;
PlayState.instance.curStage = stageXML.has.name ? stageXML.att.name : stage;
}
if (stageXML.has.folder) {