Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Aug 25, 2024
1 parent 2c737fa commit 1a17a1d
Show file tree
Hide file tree
Showing 26 changed files with 390 additions and 339 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<br>
<h1>Friday Night Funkin' • <code>Astro Engine</code> (<strong>Beta</strong>)</h1>
<br>
<img src="https://img.shields.io/github/forks/Hackx2/FNF-AstroEngine?style=for-the-badge" />
<img src="https://img.shields.io/github/license/Hackx2/FNF-AstroEngine?style=for-the-badge" />
<img src="https://img.shields.io/github/actions/workflow/status/Hackx2/FNF-AstroEngine/windows.yml?style=for-the-badge" />
<img src="https://img.shields.io/github/forks/AstroEngineDevs/FNF-AstroEngine?style=for-the-badge" />
<img src="https://img.shields.io/github/license/AstroEngineDevs/FNF-AstroEngine?style=for-the-badge" />
<img src="https://img.shields.io/github/actions/workflow/status/AstroEngineDevs/FNF-AstroEngine/windows.yml?style=for-the-badge" />
<br>

Hello, this is a modified version of the **Psych Engine** that includes events and functions missing from the original engine.
Expand Down Expand Up @@ -39,3 +39,8 @@ Could not parse frame number of: `haxelib install flixel 5.6.1`
---

</div>
question-ai-logo
useruser
fullfull
closeclose
Chat AI
Binary file added assets/shared/images/soundtray/bars_1.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/shared/images/soundtray/bars_10.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/shared/images/soundtray/bars_2.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/shared/images/soundtray/bars_3.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/shared/images/soundtray/bars_4.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/shared/images/soundtray/bars_5.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/shared/images/soundtray/bars_6.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/shared/images/soundtray/bars_7.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/shared/images/soundtray/bars_8.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/shared/images/soundtray/bars_9.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/shared/images/soundtray/volumebox.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/shared/sounds/soundtray/VolMAX.mp3
Binary file not shown.
Binary file added assets/shared/sounds/soundtray/VolMAX.ogg
Binary file not shown.
Binary file added assets/shared/sounds/soundtray/Voldown.mp3
Binary file not shown.
Binary file added assets/shared/sounds/soundtray/Voldown.ogg
Binary file not shown.
Binary file added assets/shared/sounds/soundtray/Volup.mp3
Binary file not shown.
Binary file added assets/shared/sounds/soundtray/Volup.ogg
Binary file not shown.
132 changes: 76 additions & 56 deletions source/funkin/backend/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,45 @@ import openfl.utils.Assets;

class CoolUtil
{
inline public static function quantize(f:Float, snap:Float){
inline public static function quantize(f:Float, snap:Float)
{
// changed so this actually works lol
var m:Float = Math.fround(f * snap);
trace(snap);
return (m / snap);
}


public static function floorDecimal(value:Float, decimals:Int):Float
{
if(decimals < 1)
return Math.floor(value);

var tempMult:Float = 1;
for (i in 0...decimals)
tempMult *= 10;

var newValue:Float = Math.floor(value * tempMult);
return newValue / tempMult;
}

{
if (decimals < 1)
return Math.floor(value);

var tempMult:Float = 1;
for (i in 0...decimals)
tempMult *= 10;

inline public static function boundTo(value:Float, min:Float, max:Float):Float {
return Math.max(min, Math.min(max, value));
var newValue:Float = Math.floor(value * tempMult);
return newValue / tempMult;
}

public static function coolLerp(base:Float, target:Float, ratio:Float):Float
return base + cameraLerp(ratio) * (target - base);

public static function cameraLerp(lerp:Float):Float
return lerp * (FlxG.elapsed / (1 / 60));

inline public static function boundTo(value:Float, min:Float, max:Float):Float
return Math.max(min, Math.min(max, value));

public static function coolTextFile(path:String):Array<String>
{
var daList:Array<String> = [];
#if sys
if(FileSystem.exists(path)) daList = File.getContent(path).trim().split('\n');
if (FileSystem.exists(path))
daList = File.getContent(path).trim().split('\n');
#else
if(Assets.exists(path)) daList = Assets.getText(path).trim().split('\n');
if (Assets.exists(path))
daList = Assets.getText(path).trim().split('\n');
#end

for (i in 0...daList.length)
Expand All @@ -55,16 +60,20 @@ class CoolUtil

return daList;
}

inline public static function colorFromString(color:String):FlxColor
{
var hideChars = ~/[\t\n\r]/;
var color:String = hideChars.split(color).join('').trim();
if(color.startsWith('0x')) color = color.substring(color.length - 6);

var colorNum:Null<FlxColor> = FlxColor.fromString(color);
if(colorNum == null) colorNum = FlxColor.fromString('#$color');
return colorNum != null ? colorNum : FlxColor.WHITE;
}
{
var hideChars = ~/[\t\n\r]/;
var color:String = hideChars.split(color).join('').trim();
if (color.startsWith('0x'))
color = color.substring(color.length - 6);

var colorNum:Null<FlxColor> = FlxColor.fromString(color);
if (colorNum == null)
colorNum = FlxColor.fromString('#$color');
return colorNum != null ? colorNum : FlxColor.WHITE;
}

public static function listFromString(string:String):Array<String>
{
var daList:Array<String> = [];
Expand All @@ -77,25 +86,35 @@ class CoolUtil

return daList;
}
public static function dominantColor(sprite:flixel.FlxSprite):Int{

public static function dominantColor(sprite:flixel.FlxSprite):Int
{
var countByColor:Map<Int, Int> = [];
for(col in 0...sprite.frameWidth){
for(row in 0...sprite.frameHeight){
var colorOfThisPixel:Int = sprite.pixels.getPixel32(col, row);
if(colorOfThisPixel != 0){
if(countByColor.exists(colorOfThisPixel)){
countByColor[colorOfThisPixel] = countByColor[colorOfThisPixel] + 1;
}else if(countByColor[colorOfThisPixel] != 13520687 - (2*13520687)){
countByColor[colorOfThisPixel] = 1;
}
}
for (col in 0...sprite.frameWidth)
{
for (row in 0...sprite.frameHeight)
{
var colorOfThisPixel:Int = sprite.pixels.getPixel32(col, row);
if (colorOfThisPixel != 0)
{
if (countByColor.exists(colorOfThisPixel))
{
countByColor[colorOfThisPixel] = countByColor[colorOfThisPixel] + 1;
}
else if (countByColor[colorOfThisPixel] != 13520687 - (2 * 13520687))
{
countByColor[colorOfThisPixel] = 1;
}
}
}
}
}
var maxCount = 0;
var maxKey:Int = 0;//after the loop this will store the max color
var maxKey:Int = 0; // after the loop this will store the max color
countByColor[flixel.util.FlxColor.BLACK] = 0;
for(key in countByColor.keys()){
if(countByColor[key] >= maxCount){
for (key in countByColor.keys())
{
if (countByColor[key] >= maxCount)
{
maxCount = countByColor[key];
maxKey = key;
}
Expand All @@ -113,7 +132,8 @@ class CoolUtil
return dumbArray;
}

public static function browserLoad(site:String) {
public static function browserLoad(site:String)
{
#if linux
Sys.command('/usr/bin/xdg-open', [site]);
#else
Expand All @@ -130,25 +150,25 @@ class CoolUtil
since newer flixel versions are being enforced anyways.
@crowplexus
**/
inline public static function getSavePath():String {
inline public static function getSavePath():String
{
final company:String = FlxG.stage.application.meta.get('company');
@:privateAccess
return '${company}/${FlxSave.validate(FlxG.stage.application.meta.get('file'))}';
}


public static function setTextBorderFromString(text:FlxText, border:String)
{
switch (border.toLowerCase().trim())
{
switch(border.toLowerCase().trim())
{
case 'shadow':
text.borderStyle = SHADOW;
case 'outline':
text.borderStyle = OUTLINE;
case 'outline_fast', 'outlinefast':
text.borderStyle = OUTLINE_FAST;
default:
text.borderStyle = NONE;
}
case 'shadow':
text.borderStyle = SHADOW;
case 'outline':
text.borderStyle = OUTLINE;
case 'outline_fast', 'outlinefast':
text.borderStyle = OUTLINE_FAST;
default:
text.borderStyle = NONE;
}
}
}
162 changes: 0 additions & 162 deletions source/funkin/backend/objects/SpectralAnalyzerEx.hx

This file was deleted.

Loading

0 comments on commit 1a17a1d

Please sign in to comment.