Skip to content

Commit

Permalink
working on full release now yay
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Oct 14, 2024
1 parent 3705e07 commit 09e861a
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 7 deletions.
1 change: 1 addition & 0 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<!-- [ Custom Defines ] -->

<define name="FUTURE_POLYMOD" if="desktop" />
<define name="UPDATE_CHECK" unless="debug" />

<!-- [ Path Settings ] -->

Expand Down
Empty file.
Empty file.
Binary file added assets/images/gameplay/rankings/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gameplay/rankings/s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/menuList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
play
mods
credits
options
exit
26 changes: 20 additions & 6 deletions source/backend/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import flixel.graphics.FlxGraphic;

using haxe.io.Path;

enum SpriteSheetType {
ASEPRITE;
PACKER;
SPARROW;
TEXTURE_PATCHER_JSON;
TEXTURE_PATCHER_XML;
}

@:keep
@:access(openfl.display.BitmapData)
class Paths {
Expand Down Expand Up @@ -174,12 +182,18 @@ class Paths {
inline static public function image(key:String, ?cache:Bool = true):FlxGraphic
return returnGraphic('images/$key', cache);

inline static public function getSparrowAtlas(key:String, ?cache:Bool = true):FlxAtlasFrames {
if (FileSystem.exists(file('images/$key.png')) && FileSystem.exists(xml('images/$key')))
return FlxAtlasFrames.fromSparrow(returnGraphic('images/$key', cache), xml('images/$key'));

trace('oops! couldnt find $key!');
return FlxAtlasFrames.fromSparrow(returnGraphic('images/errorSparrow', cache), xml('images/errorSparrow'));
public static inline function spritesheet(key:String, ?cache:Bool = true, ?type:SpriteSheetType):FlxAtlasFrames {
if (type == null)
type = SPARROW;

return switch (type) {
case ASEPRITE: FlxAtlasFrames.fromAseprite(image(key, cache), image(key, cache).withExtension('json'));
case PACKER: FlxAtlasFrames.fromSpriteSheetPacker(image(key, cache), image(key, cache).withExtension('txt'));
case SPARROW: FlxAtlasFrames.fromSparrow(image(key, cache), image(key, cache).withExtension('xml'));
case TEXTURE_PATCHER_JSON: FlxAtlasFrames.fromTexturePackerJson(image(key, cache), image(key, cache).withExtension('json'));
case TEXTURE_PATCHER_XML: FlxAtlasFrames.fromTexturePackerXml(image(key, cache), image(key, cache).withExtension('xml'));
default: FlxAtlasFrames.fromSparrow(returnGraphic('images/errorSparrow', cache), xml('images/errorSparrow'));
}
}

public static function returnGraphic(key:String, ?cache:Bool = true):FlxGraphic {
Expand Down
4 changes: 4 additions & 0 deletions source/backend/SaveData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ package backend;
public var songSpeed:Int = 2;
public var hitSoundVolume:Float = 0;
public var laneUnderlay:Float = 0;
public var perfectWindow:Float = 22.5;
public var niceWindow:Float = 45;
public var okayWindow:Float = 90;
public var noWindow:Float = 135;
public var antialiasing:Bool = true;
public var fpsCounter:Bool = true;
#if desktop
Expand Down
2 changes: 1 addition & 1 deletion source/states/InitialState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InitialState extends ExtendableState {

trace('current platform: ${PlatformUtil.getPlatform()}');

#if desktop
#if (desktop || UPDATE_CHECK)
UpdateState.updateCheck();
#else
trace('Sorry! No update support on: ${PlatformUtil.getPlatform()}!');
Expand Down
56 changes: 56 additions & 0 deletions source/states/ScriptedState.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package states;

class ScriptedState extends ExtendableState {
public var script:Hscript;

public function new(path:String, ?args:Array<Dynamic>) {
super();

script = new Hscript(Paths.script('classes/$path'));

script.setVariable('this', this);
script.setVariable('add', function(obj:FlxBasic) {
add(obj);
});
script.setVariable('remove', function(obj:FlxBasic) {
remove(obj);
});
script.setVariable('insert', function(pos:Int, obj:FlxBasic) {
insert(pos, obj);
});

script.executeFunc('new', (args != null) ? args : []);
}

override function draw() {
super.draw();
script.executeFunc('draw', []);
}

override function create() {
Paths.clearStoredMemory();
Paths.clearUnusedMemory();

super.create();
}

override function update(elapsed:Float) {
super.update(elapsed);
script.executeFunc('update', [elapsed]);
}

override function beatHit() {
super.beatHit();
script.executeFunc('beatHit', [curBeat]);
}

override function stepHit() {
super.stepHit();
script.executeFunc('stepHit', [curStep]);
}

override function destroy() {
super.destroy();
script.executeFunc('destroy', []);
}
}
56 changes: 56 additions & 0 deletions source/substates/ScriptedSubState.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package substates;

class ScriptedSubState extends ExtendableSubState {
public var script:Hscript;

public function new(path:String, ?args:Array<Dynamic>) {
super();

script = new Hscript(Paths.script('classes/$path'));

script.setVariable('this', this);
script.setVariable('add', function(obj:FlxBasic) {
add(obj);
});
script.setVariable('remove', function(obj:FlxBasic) {
remove(obj);
});
script.setVariable('insert', function(pos:Int, obj:FlxBasic) {
insert(pos, obj);
});

script.executeFunc('new', (args != null) ? args : []);
}

override function draw() {
super.draw();
script.executeFunc('draw', []);
}

override function create() {
Paths.clearStoredMemory();
Paths.clearUnusedMemory();

super.create();
}

override function update(elapsed:Float) {
super.update(elapsed);
script.executeFunc('update', [elapsed]);
}

override function beatHit() {
super.beatHit();
script.executeFunc('beatHit', [curBeat]);
}

override function stepHit() {
super.stepHit();
script.executeFunc('stepHit', [curStep]);
}

override function destroy() {
super.destroy();
script.executeFunc('destroy', []);
}
}

0 comments on commit 09e861a

Please sign in to comment.