Skip to content

Commit

Permalink
important fixes
Browse files Browse the repository at this point in the history
re-export week7 notesplashes
redo / add a few lua functions.
lane underlay rework
fix get/set property
  • Loading branch information
TheRealJake12 committed Oct 29, 2023
1 parent 11c6690 commit 2ee6893
Show file tree
Hide file tree
Showing 8 changed files with 1,175 additions and 158 deletions.
Binary file modified art/flashFiles/NOTE_assets.fla
Binary file not shown.
13 changes: 6 additions & 7 deletions assets/preload/data/songs/tutorial/modchart.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
function start(song) -- do nothing
spinLength = 0
function onCreatePost()
spinLength = 0
end

function update(elapsed)

if difficulty == 2 and curStep > 400 then
if spinLength < 32 then
spinLength = spinLength + 0.2
end


local currentBeat = (songPos / 1000)*(bpm/60)
for i=0,7,1 do
local receptor = _G['receptor_'..i]
Expand All @@ -21,16 +19,17 @@ function update(elapsed)
end

function beatHit(beat) -- do nothing

end

function stepHit(step) -- do nothing

if curStep == 63 then
showOnlyStrums = true
hideHUD(true)
end

if curStep == 415 then
showOnlyStrums = false
hideHUD(false)
end

end
Expand Down
Binary file modified assets/shared/images/splashes/Week7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 33 additions & 33 deletions assets/shared/images/splashes/Week7.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="Week7.png">
<!-- Created with Adobe Animate version 21.0.0.35450 -->
<!-- Created with Adobe Animate version 22.0.2.168 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="note splash 1 blue0000" x="1850" y="262" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0001" x="1540" y="556" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0002" x="1056" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0000" x="1014" y="535" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0001" x="795" y="264" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0002" x="266" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 blue0003" x="0" y="0" width="260" height="298"/>
<SubTexture name="note splash 1 green0000" x="663" y="806" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0001" x="1757" y="556" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0002" x="1312" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0003" x="264" y="0" width="260" height="298"/>
<SubTexture name="note splash 1 purple0000" x="1121" y="818" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0001" x="0" y="563" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0002" x="1568" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0003" x="528" y="0" width="260" height="298"/>
<SubTexture name="note splash 1 red0000" x="1314" y="818" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0001" x="217" y="563" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0002" x="1056" y="295" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0003" x="792" y="0" width="260" height="298"/>
<SubTexture name="note splash 2 blue0000" x="1121" y="590" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0001" x="434" y="564" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0002" x="1312" y="295" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0003" x="1824" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0000" x="1507" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0001" x="663" y="564" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0002" x="1581" y="295" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0003" x="538" y="302" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0000" x="1680" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0001" x="892" y="590" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0002" x="0" y="302" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0003" x="766" y="302" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0000" x="1853" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0001" x="434" y="806" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0002" x="269" y="302" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0003" x="1312" y="556" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 1 green0000" x="1014" y="811" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0001" x="795" y="535" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0002" x="266" y="297" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 green0003" x="0" y="304" width="260" height="298"/>
<SubTexture name="note splash 1 purple0000" x="1209" y="752" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0001" x="795" y="806" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0002" x="266" y="594" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 purple0003" x="0" y="608" width="260" height="298"/>
<SubTexture name="note splash 1 red0000" x="1404" y="752" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0001" x="1014" y="264" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0002" x="266" y="891" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note splash 1 red0003" x="0" y="912" width="260" height="298"/>
<SubTexture name="note splash 2 blue0000" x="1209" y="1028" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0001" x="1233" y="264" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0002" x="524" y="0" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 blue0003" x="795" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0000" x="1384" y="1028" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0001" x="1464" y="264" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0002" x="524" y="263" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 green0003" x="1025" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0000" x="1559" y="1028" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0001" x="1233" y="508" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0002" x="524" y="526" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 purple0003" x="1255" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0000" x="1599" y="752" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0001" x="1464" y="508" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0002" x="524" y="789" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note splash 2 red0003" x="1485" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
</TextureAtlas>
108 changes: 86 additions & 22 deletions source/ModchartState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,92 @@ class ModchartState

// callbacks

Lua_helper.add_callback(lua, "getProperty", getPropertyByName);
Lua_helper.add_callback(lua, "setProperty", setPropertyByName);
Lua_helper.add_callback(lua, "getProperty", function(variable:String)
{
var killMe:Array<String> = variable.split('.');
if (killMe.length > 1)
{
var coverMeInPiss:Dynamic = null;
coverMeInPiss = Reflect.getProperty(PlayState, killMe[0]);

for (i in 1...killMe.length - 1)
{
coverMeInPiss = Reflect.getProperty(coverMeInPiss, killMe[i]);
}
Debug.logTrace("getProp");
return Reflect.getProperty(coverMeInPiss, killMe[killMe.length - 1]);
}
Debug.logTrace("getProp");
return Reflect.getProperty(PlayState.instance, variable);

});
Lua_helper.add_callback(lua, "setProperty", function(variable:String, value:Dynamic)
{
var killMe:Array<String> = variable.split('.');
if (killMe.length > 1)
{
var coverMeInPiss:Dynamic = null;
coverMeInPiss = Reflect.getProperty(PlayState.instance, killMe[0]);

for (i in 1...killMe.length - 1)
{
coverMeInPiss = Reflect.getProperty(coverMeInPiss, killMe[i]);
}
Debug.logTrace("setProp");
return Reflect.setProperty(coverMeInPiss, killMe[killMe.length - 1], value);
}
Debug.logTrace("setProp");
return Reflect.setProperty(PlayState.instance, variable, value);

});
Lua_helper.add_callback(lua, "getPropertyFromGroup", function(obj:String, index:Int, variable:Dynamic)
{
if (Std.isOfType(Reflect.getProperty(PlayState, obj), FlxTypedGroup))
{
return Reflect.getProperty(Reflect.getProperty(PlayState, obj).members[index], variable);
}

var leArray:Dynamic = Reflect.getProperty(PlayState.instance, obj)[index];
if (leArray != null)
{
if (Type.typeof(variable) == Type.ValueType.TInt)
{
return leArray[variable];
}
return Reflect.getProperty(leArray, variable);
}
Debug.logTrace("Object #" + index + " from group: " + obj + " doesn't exist!");
return null;
});
Lua_helper.add_callback(lua, "setPropertyFromGroup", function(obj:String, index:Int, variable:Dynamic, value:Dynamic)
{
if (Std.isOfType(Reflect.getProperty(PlayState.instance, obj), FlxTypedGroup))
{
return Reflect.setProperty(Reflect.getProperty(PlayState.instance, obj).members[index], variable, value);
}

var leArray:Dynamic = Reflect.getProperty(PlayState.instance, obj)[index];
if (leArray != null)
{
if (Type.typeof(variable) == Type.ValueType.TInt)
{
return leArray[variable] = value;
}
return Reflect.setProperty(leArray, variable, value);
}
});
Lua_helper.add_callback(lua, "makeSprite", makeLuaSprite);

Lua_helper.add_callback(lua, "cameraFlash", function(camera:String, color:String, duration:Float, forced:Bool)
{
cameraFromString(camera).flash(CoolUtil.colorFromString(color), duration, null, forced);
});

Lua_helper.add_callback(lua, "hideHUD", function(hidden:Bool)
{
hideTheHUD(hidden);
});

// sprites

Lua_helper.add_callback(lua, "createWiggle", function(freq:Float, amplitude:Float, speed:Float)
Expand Down Expand Up @@ -576,26 +653,6 @@ class ModchartState
return PlayState.instance.camHUD.y;
});

Lua_helper.add_callback(lua, "setLaneUnderLayPos", function(value:Int)
{
PlayState.laneunderlay.x = value;
});

Lua_helper.add_callback(lua, "setOpponentLaneUnderLayOpponentPos", function(value:Int)
{
PlayState.laneunderlayOpponent.x = value;
});

Lua_helper.add_callback(lua, "setLaneUnderLayAlpha", function(value:Int)
{
PlayState.laneunderlay.alpha = value;
});

Lua_helper.add_callback(lua, "setOpponentLaneUnderLayOpponentAlpha", function(value:Int)
{
PlayState.laneunderlayOpponent.alpha = value;
});

Lua_helper.add_callback(lua, "getNotes", function(y:Float)
{
Lua.newtable(lua);
Expand Down Expand Up @@ -649,10 +706,17 @@ class ModchartState
return PlayState.instance.camStrums;
case 'camGame' | 'game':
return PlayState.instance.camGame;
case 'overlayCam' | 'overlay':
return PlayState.instance.overlayCam;
}
return PlayState.instance.camGame;
}

public function hideTheHUD(hide:Bool)
{
return PlayState.instance.hideHUD(hide);
}

public static function getFlxEaseByString(?ease:String = '')
{
switch (ease.toLowerCase().trim())
Expand Down
Loading

0 comments on commit 2ee6893

Please sign in to comment.