low memory mode

This commit is contained in:
Yoshman29
2023-02-18 16:45:49 +01:00
parent 6238c55a1d
commit 5599b8ca16
12 changed files with 99 additions and 55 deletions
+6 -2
View File
@@ -10,8 +10,12 @@ function update(elapsed:Float) {
}
// back limo drive
for(e in [bgLimo, dancer1, dancer2, dancer3, dancer4, dancer5]) {
e.rotOffset.x = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
if (Options.lowMemoryMode) {
bgLimo.rotOffset.x = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
} else {
for(e in [bgLimo, dancer1, dancer2, dancer3, dancer4, dancer5]) {
e.rotOffset.x = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
}
}
}
function beatHit(curBeat:Int) {
+33 -26
View File
@@ -4,36 +4,43 @@
<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" />
<!-- DANCERS !-->
<sprite name="dancer1" x="130" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer2" x="500" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer3" x="870" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer4" x="1240" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer5" x="1610" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<!-- ONLY FOR INSTANCES WITH LOW MEMORY MODE DISABLED -->
<high-memory>
<!-- DANCERS !-->
<sprite name="dancer1" x="130" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer2" x="500" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer3" x="870" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer4" x="1240" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<sprite name="dancer5" x="1610" y="80" sprite="limoDancer" scroll="0.4" zoomfactor="0.55">
<anim name="danceLeft" anim="bg dancer sketch PINK" loop="false" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14" />
<anim name="danceRight" anim="bg dancer sketch PINK" loop="false" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
</sprite>
<!-- SUPER FAST CAR !-->
<sprite name="fastCar" x="-300" y="160" sprite="fastCarLol" zoomfactor="0.75" />
</high-memory>
<!-- SUPER FAST CAR !-->
<sprite name="fastCar" x="-300" y="160" sprite="fastCarLol" zoomfactor="0.75" />
<!-- MORE LIMO STUFF !-->
<girlfriend />
<sprite name="limo" x="-120" y="550" sprite="limoDrive" />
<boyfriend x="1030" y="-120" camxoffset="-300"/>
<sprite name="overlayShit" x="-500" y="480" sprite="limoOverlay" scroll="0">
<property name="alpha" type="float" value="0.5" />
</sprite>
<high-memory>
<sprite name="overlayShit" x="-500" y="480" sprite="limoOverlay" scroll="0">
<property name="alpha" type="float" value="0.5" />
</sprite>
</high-memory>
</stage>
+8 -2
View File
@@ -1,12 +1,18 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.8" name="mall" folder="stages/mall/">
<sprite name="bg" x="-1000" y="-500" sprite="bgWalls" scroll="0.2"/>
<sprite name="upperBoppers" x="-240" y="-90" sprite="upperBop" scroll="0.2" />
<high-memory>
<sprite name="upperBoppers" x="-240" y="-90" sprite="upperBop" scroll="0.2" />
</high-memory>
<sprite name="bgEscalator" x="-1100" y="-600" sprite="bgEscalator" scroll="0.3" scale="0.9" updateHitbox="true"/>
<sprite name="tree" x="370" y="-250" sprite="christmasTree" scroll="0.4"/>
<sprite name="bottomBoppers" x="-300" y="140" sprite="bottomBop" scroll="0.9"/>
<sprite name="fgSnow" x="-600" y="700" sprite="fgSnow"/>
<sprite name="santa" x="-840" y="150" sprite="santa"/>
<high-memory>
<sprite name="santa" x="-840" y="150" sprite="santa"/>
</high-memory>
<girlfriend />
<dad />
+5 -2
View File
@@ -9,14 +9,17 @@
<sprite name="bgStreet" x="-204" y="0" sprite="weebStreet"
antialiasing="false" scale="6" scroll="0.95" updateHitbox="true"/>
<sprite name="fgTrees" x="-30" y="130" sprite="weebTreesBack"
antialiasing="false" scale="4.8" scroll="0.9" updateHitbox="true" type="loop"/>
<sprite name="bgTrees" x="-1180" y="-1600" sprite="weebTrees"
antialiasing="false" scale="8.4" scroll="0.85" updateHitbox="true" type="loop"/>
<sprite name="treeLeaves" x="-200" y="-40" sprite="petals"
antialiasing="false" scale="6" scroll="0.85" updateHitbox="true" type="loop"/>
<high-memory>
<sprite name="treeLeaves" x="-200" y="-40" sprite="petals"
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">
<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"/>
+24 -14
View File
@@ -2,16 +2,23 @@
<stage zoom="0.9" name="tank" folder="stages/tank/">
<!-- BG STUFF -->
<sprite name="tankBg" x="-500" y="0" sprite="tankBg" scroll="0" zoomfactor="0"/>
<sprite name="tankSky" x="-400" y="-600" sprite="tankSky" scroll="0" zoomfactor="0"/>
<sprite name="tankClouds" x="-350" y="0" sprite="tankClouds" scroll="0.1" zoomfactor="0">
<property name="velocity.x" type="float" value="10" />
</sprite>
<high-memory>
<sprite name="tankClouds" x="-350" y="0" sprite="tankClouds" scroll="0.1" zoomfactor="0">
<property name="velocity.x" type="float" value="10" />
</sprite>
</high-memory>
<sprite name="tankMountains" x="-300" y="-20" sprite="tankMountains" scroll="0.2" scale="1.2" updateHitbox="true" zoomfactor="0.10"/>
<sprite name="tankBuildings" x="-300" y="-20" sprite="tankBuildings" scroll="0.3" scale="1.1" updateHitbox="true" zoomfactor="0.25"/>
<sprite name="tankRuins" x="-200" y="0" sprite="tankRuins" scroll="0.35" scale="1.1" updateHitbox="true" zoomfactor="0.35"/>
<sprite name="smokeLeft" x="-200" y="-100" sprite="smokeLeft" scroll="0.4" zoomfactor="0.6"/>
<sprite name="smokeRight" x="1100" y="-100" sprite="smokeRight" scroll="0.4" zoomfactor="0.6"/>
<sprite name="tankWatchtower" x="100" y="50" sprite="tankWatchtower" scroll="0.5" onBeat="true" zoomfactor="0.7"/>
<high-memory>
<sprite name="tankBuildings" x="-300" y="-20" sprite="tankBuildings" scroll="0.3" scale="1.1" updateHitbox="true" zoomfactor="0.25"/>
<sprite name="tankRuins" x="-200" y="0" sprite="tankRuins" scroll="0.35" scale="1.1" updateHitbox="true" zoomfactor="0.35"/>
</high-memory>
<high-memory>
<sprite name="smokeLeft" x="-200" y="-100" sprite="smokeLeft" scroll="0.4" zoomfactor="0.6"/>
<sprite name="smokeRight" x="1100" y="-100" sprite="smokeRight" scroll="0.4" zoomfactor="0.6"/>
<sprite name="tankWatchtower" x="100" y="50" sprite="tankWatchtower" scroll="0.5" onBeat="true" zoomfactor="0.7"/>
</high-memory>
<sprite name="tankRolling" x="300" y="300" sprite="tankRolling" scroll="0.5" zoomfactor="0.8" type="loop"/>
<sprite name="tankGround" x="-420" y="-150" sprite="tankGround" scale="1.15" updateHitbox="true" zoomfactor="1.0"/>
@@ -21,10 +28,13 @@
<boyfriend x="810"/>
<!-- FOREGROUND TANKMANS -->
<sprite name="tank0" x="-500" y="650" sprite="tank0" scrollx="1.7" scrolly="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank1" x="-300" y="750" sprite="tank1" scrollx="2" scrolly="0.2" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank2" x="450" y="940" sprite="tank2" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank4" x="1300" y="900" sprite="tank4" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank5" x="1620" y="700" sprite="tank5" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank3" x="1300" y="1200" sprite="tank3" scrollx="3.5" scrolly="2.5" onBeat="true" zoomfactor="1.25"/>
<high-memory>
<sprite name="tank0" x="-500" y="650" sprite="tank0" scrollx="1.7" scrolly="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank1" x="-300" y="750" sprite="tank1" scrollx="2" scrolly="0.2" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank2" x="450" y="940" sprite="tank2" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank4" x="1300" y="900" sprite="tank4" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank5" x="1620" y="700" sprite="tank5" scroll="1.5" onBeat="true" zoomfactor="1.25"/>
<sprite name="tank3" x="1300" y="1200" sprite="tank3" scrollx="3.5" scrolly="2.5" onBeat="true" zoomfactor="1.25"/>
</high-memory>
</stage>
+1 -1
View File
@@ -1 +1 @@
2253
2260
+10
View File
@@ -1,5 +1,6 @@
package funkin.game;
import funkin.options.Options;
import flixel.FlxG;
import flixel.FlxState;
import flixel.FlxSprite;
@@ -50,7 +51,16 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (spritesParentFolder.charAt(spritesParentFolder.length-1) != "/") spritesParentFolder = spritesParentFolder + "/";
}
var elems = [];
for(node in stageXML.elements) {
if (node.name == "high-memory" && !Options.lowMemoryMode)
for(e in node.elements)
elems.push(e);
else
elems.push(node);
}
for(node in elems) {
var sprite:Dynamic = switch(node.name) {
case "sprite" | "spr" | "sparrow":
if (!node.has.sprite || !node.has.name || !node.has.x || !node.has.y) continue;
@@ -52,7 +52,7 @@ class CreditsCodename extends OptionsScreen {
public override function createAdditional() {
for(k=>c in contributors) {
var spr = new FlxSprite(0, k * 96);
var spr = new FlxSprite(0, (OptionsScreen.optionHeight * (k+0.5)) - 48);
spr.antialiasing = true;
spr.setUnstretchedGraphicSize(96, 96, false);
spr.updateHitbox();
@@ -87,7 +87,6 @@ class CreditsCodename extends OptionsScreen {
for(k=>spr in contributorsSprites) {
var alpha = options[k];
spr.x = alpha.x - 10;
spr.y = alpha.y - ((alpha.height - spr.height) / 2);
}
}
+2 -1
View File
@@ -25,9 +25,10 @@ class Options
public static var antialiasing:Bool = true;
public static var volume:Float = 1;
public static var week6PixelPerfect:Bool = true;
public static var lowMemoryMode:Bool = false;
public static var betaUpdates:Bool = false;
public static var hitWindow:Float = 250;
public static var framerate:Int = 1000;
public static var framerate:Int = 120;
public static var lastLoadedMod:String = null;
+3 -3
View File
@@ -32,9 +32,9 @@ class OptionsMenu extends MusicBeatState {
state: GameplayOptions
},
{
name: 'Behaviour',
desc: 'Change Behaviour options such as Flashing menus...',
state: BehaviourOptions
name: 'Appearance',
desc: 'Change Appearance options such as Flashing menus...',
state: AppearanceOptions
},
{
name: 'Miscellaneous',
+1 -1
View File
@@ -93,7 +93,7 @@ class OptionsScreen extends MusicBeatState {
FlxG.camera.scroll.y = lerp(FlxG.camera.scroll.y, scrollDest.y, 0.25);
for(option in options) {
var angle = Math.cos((option.y + (optionHeight / 2) - (FlxG.camera.scroll.y + (FlxG.height / 2))) / FlxG.height * Math.PI);
var angle = Math.cos((option.y + (optionHeight / 2) - (FlxG.camera.scroll.y + (FlxG.height / 2))) / (FlxG.height * 1.25) * Math.PI);
option.x = -50 + (Math.abs(angle) * 150);
}
@@ -1,6 +1,6 @@
package funkin.options.categories;
class BehaviourOptions extends OptionsScreen {
class AppearanceOptions extends OptionsScreen {
public override function create() {
options = [
new Checkbox(
@@ -15,6 +15,10 @@ class BehaviourOptions extends OptionsScreen {
"Flashing Menu",
"If unchecked, will disable menu flashing when you select an option in the Main Menu, and other flashs will be slower",
"flashingMenu"),
new Checkbox(
"Low Memory Mode",
"If checked, will disable certain background elements in stages to reduce memory usage.",
"lowMemoryMode"),
new Checkbox(
"Auto Pause",
"If checked, switching windows will pause the game",