Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
added main menu tips from SB Engine!!
Added the icon bounce from SB Engine
(credits to Stefan2008 for both)
  • Loading branch information
JordanSantiagoYT committed Nov 8, 2023
1 parent 7c7ee41 commit bcf29fd
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 4 deletions.
35 changes: 35 additions & 0 deletions assets/preload/data/funnyTips.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
The code for this was made by Stefan2008!
OS Engine? Hah, that engine sucks.
SB Engine = Stone Block Engine (REAL)
CommunityGame should try JS Engine
have you heard about joke songs?
Support ShadowMario! He made Psych Engine.
JS Engine is a modified Psych Engine 0.6.3 with new additions and changes!
"Try to add something here tho." yeah i just did
This engine has an Android build AND an ingame updater!
Stefan2008 is a real one
'this engine sucks' YOU SUCK!!
this is truly a peak engine
The only engine that can compare with this is smth like uhh Denpa? DenpaEx?
Double Kill but literally everyone sings it when?
MaysLastPlays: Don't be so trollgy like other guys!
Did you know that this engine was formerly named 'Psych Engine: No Botplay Lag Edition' before having its name changed to 'JS Engine'? - Jordan Santiago
Stefan2008: 'Actually there's so many tips here tho' Jordan: 'yeah sure'
Hey MemeHoovy. You are so awesome, cool and nice person.
Grafex Engine? Good choice, so yeah.
this engine is better than os engine in every way
Make spammy charts in as little as 10 minutes!
'Bahnschrift is the better font then VCR OSD Mono's one' yeah, for SB Engine it might be
Welcome to HaxeFlixel!
Powered entirely by JavaScript!
JS Engine?!!?!?! JAVASCRIPT REFERENCE?!!??!
Tip: Press the notes.
Wait, Play Engine moment?
Tip: Press the keys and don't die.
OH MY GOD!! SCROLLING TEXT!!
Download JS Engine right now! oh wait you're already here, uhhh... STOP USING OS ENGINE
THERES TOO MUCH ZOOMING PLEASE HELP ME TURN IT OFF- Options, then Visuals & UI, then turn off Double Note Ghosts.
I kinda like future in 2024- Wait, 2024 EXISTS????? HUHHHH???
Stefan's grammar is so bad and un-understandable for real
Mario is the best rythm gamer on mania charts. Go subscribe him tho btw.
Mays, you know what happend if you gonna ignore Trollge?
5 changes: 5 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y
public static var minCGBMS:Int = 5;
public static var maxCGBMS:Int = 5;
public static var autosaveCharts:Bool = true;
public static var tipTexts:Bool = true;
public static var antiCheatEnable:Bool = false;
public static var showRamUsage:Bool = true;
public static var showMaxRamUsage:Bool = true;
Expand Down Expand Up @@ -240,6 +241,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y
//FlxG.save.data.cursing = cursing;
//FlxG.save.data.violence = violence;
FlxG.save.data.progAudioLoad = progAudioLoad;
FlxG.save.data.tipTexts = tipTexts;
FlxG.save.data.noGunsRNG = noGunsRNG;
FlxG.save.data.camZooms = camZooms;
FlxG.save.data.daMenuMusic = daMenuMusic;
Expand Down Expand Up @@ -454,6 +456,9 @@ class ClientPrefs { //default settings if it can't find a save file containing y
if(FlxG.save.data.cameraPanning != null) {
cameraPanning = FlxG.save.data.cameraPanning;
}
if(FlxG.save.data.tipTexts != null) {
tipTexts = FlxG.save.data.tipTexts;
}
if(FlxG.save.data.botTxtFade != null) {
botTxtFade = FlxG.save.data.botTxtFade;
}
Expand Down
82 changes: 82 additions & 0 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import lime.app.Application;
import Achievements;
import editors.MasterEditorMenu;
import flixel.input.keyboard.FlxKey;
import flixel.util.FlxTimer;

using StringTools;

Expand Down Expand Up @@ -48,6 +49,13 @@ class MainMenuState extends MusicBeatState
var camFollowPos:FlxObject;
var debugKeys:Array<FlxKey>;

var tipTextMargin:Float = 10;
var tipTextScrolling:Bool = false;
var tipBackground:FlxSprite;
var tipText:FlxText;
var isTweening:Bool = false;
var lastString:String = '';

override function create()
{
MusicBeatState.windowNameSuffix = " - Main Menu";
Expand Down Expand Up @@ -87,6 +95,7 @@ class MainMenuState extends MusicBeatState
bg.antialiasing = ClientPrefs.globalAntialiasing;
add(bg);


camFollow = new FlxObject(0, 0, 1, 1);
camFollowPos = new FlxObject(0, 0, 1, 1);
add(camFollow);
Expand Down Expand Up @@ -150,6 +159,21 @@ class MainMenuState extends MusicBeatState

// NG.core.calls.event.logEvent('swag').send();

tipBackground = new FlxSprite();
tipBackground.scrollFactor.set();
tipBackground.alpha = 0.7;
tipBackground.visible = ClientPrefs.tipTexts;
add(tipBackground);

tipText = new FlxText(0, 0, 0, "");
tipText.scrollFactor.set();
tipText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, CENTER);
tipText.updateHitbox();
tipText.visible = ClientPrefs.tipTexts;
add(tipText);

tipBackground.makeGraphic(FlxG.width, Std.int((tipTextMargin * 2) + tipText.height), FlxColor.BLACK);

changeItem();

#if ACHIEVEMENTS_ALLOWED
Expand All @@ -165,6 +189,9 @@ class MainMenuState extends MusicBeatState
}
#end

changeItem();
tipTextStartScrolling();

#if android
addVirtualPad(UP_DOWN, A_B_C);
#end
Expand All @@ -182,9 +209,64 @@ class MainMenuState extends MusicBeatState
#end

var selectedSomethin:Bool = false;
//credit to stefan2008 and sb engine for this code
function tipTextStartScrolling()
{
tipText.x = tipTextMargin;
tipText.y = -tipText.height;

new FlxTimer().start(1.0, function(timer:FlxTimer)
{
FlxTween.tween(tipText, {y: tipTextMargin}, 0.3);
new FlxTimer().start(2.25, function(timer:FlxTimer)
{
tipTextScrolling = true;
});
});
}

function changeTipText() {
var selectedText:String = '';
var textArray:Array<String> = CoolUtil.coolTextFile(SUtil.getPath() + Paths.txt('funnyTips'));

tipText.alpha = 1;
isTweening = true;
selectedText = textArray[FlxG.random.int(0, (textArray.length - 1))].replace('--', '\n');
FlxTween.tween(tipText, {alpha: 0}, 1, {
ease: FlxEase.linear,
onComplete: function(freak:FlxTween) {
if (selectedText != lastString) {
tipText.text = selectedText;
lastString = selectedText;
} else {
selectedText = textArray[FlxG.random.int(0, (textArray.length - 1))].replace('--', '\n');
tipText.text = selectedText;
}

tipText.alpha = 0;

FlxTween.tween(tipText, {alpha: 1}, 1, {
ease: FlxEase.linear,
onComplete: function(freak:FlxTween) {
isTweening = false;
}
});
}
});
}

override function update(elapsed:Float)
{
if (tipTextScrolling)
{
tipText.x -= elapsed * 130;
if (tipText.x < -tipText.width)
{
tipTextScrolling = false;
tipTextStartScrolling();
changeTipText();
}
}
if (FlxG.sound.music.volume < 0.8)
{
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
Expand Down
48 changes: 45 additions & 3 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import flixel.util.FlxSort;
import flixel.util.FlxStringUtil;
import flixel.util.FlxTimer;
import haxe.Json;
import haxe.Int64;
import lime.utils.Assets;
import openfl.Lib;
import openfl.filters.BitmapFilter;
Expand Down Expand Up @@ -1920,9 +1919,11 @@ class PlayState extends MusicBeatState
add(iconP2);
reloadHealthBarColors();

if (SONG.player1 == 'bf' || SONG.player1 == 'boyfriend') { //in case any mods just have bfs json name set to boyfriend and not bf
if (ClientPrefs.bfIconStyle == 'VS Nonsense V2') iconP1.changeIcon('bfnonsense');
if (ClientPrefs.bfIconStyle == 'Doki Doki+') iconP1.changeIcon('bfdoki');
if (ClientPrefs.bfIconStyle == 'Leather Engine') iconP1.changeIcon('bfleather');
}

if (ClientPrefs.timeBarType == 'Disabled') {
timeBarBG.destroy();
Expand Down Expand Up @@ -5288,7 +5289,7 @@ if (ClientPrefs.showNPS) {
iconP1.offset.y = Math.abs(Math.sin(funnyBeat * Math.PI)) * 16 - 4;
iconP2.offset.y = Math.abs(Math.sin(funnyBeat * Math.PI)) * 16 - 4;
}
if (ClientPrefs.iconBounceType == 'New Psych') {
if (ClientPrefs.iconBounceType == 'New Psych' || ClientPrefs.iconBounceType == 'SB Engine') {
var mult:Float = FlxMath.lerp(1, iconP1.scale.x, CoolUtil.boundTo(1 - (elapsed * 9 * playbackRate), 0, 1));
iconP1.scale.set(mult, mult);
iconP1.updateHitbox();
Expand All @@ -5311,6 +5312,29 @@ if (ClientPrefs.showNPS) {
iconP1.centerOffsets();
iconP2.centerOffsets();
}
var speed:Float = 1;
//you're welcome Stefan2008 :)
if (ClientPrefs.iconBounceType == 'SB Engine') {
speed *= playbackRate;
if (iconP1.angle >= 0) {
if (iconP1.angle != 0) {
iconP1.angle -= speed;
}
} else {
if (iconP1.angle != 0) {
iconP1.angle += speed;
}
}
if (iconP2.angle >= 0) {
if (iconP2.angle != 0) {
iconP2.angle -= speed;
}
} else {
if (iconP2.angle != 0) {
iconP2.angle += speed;
}
}
}
iconP1.updateHitbox();
iconP2.updateHitbox();

Expand Down Expand Up @@ -7695,7 +7719,7 @@ if (unspawnNotes[0] != null && (Conductor.songPosition + 1800 / songSpeed) >= fi
pixelShitPart1 = 'kadethings/';
pixelShitPart2 = '';
}
if (allSicks && ClientPrefs.marvRateColor == 'Golden' && noteDiff < ClientPrefs.marvWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && !ClientPrefs.noMarvJudge)
if (allSicks && ClientPrefs.marvRateColor == 'Golden' && noteDiff < ClientPrefs.sickWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && !ClientPrefs.noMarvJudge)
{
pixelShitPart1 = 'goldstuff/';
pixelShitPart2 = '';
Expand Down Expand Up @@ -9328,6 +9352,24 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
iconP1.scale.set(1.2, 1.2);
iconP2.scale.set(1.2, 1.2);
}
//you're welcome Stefan2008 :)
if (ClientPrefs.iconBounceType == 'SB Engine') {
if (curBeat % gfSpeed == 0) {
if (curBeat % (gfSpeed * 2) == 0) {
iconP1.scale.set(0.8, 0.8);
iconP2.scale.set(1.2, 1.3);

iconP1.angle = -15;
iconP2.angle = 15;
} else {
iconP2.scale.set(0.8, 0.8);
iconP1.scale.set(1.2, 1.3);

iconP2.angle = -15;
iconP1.angle = 15;
}
}
}

iconP1.updateHitbox();
iconP2.updateHitbox();
Expand Down
8 changes: 7 additions & 1 deletion source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class VisualsUISubState extends BaseOptionsMenu
'iconBounceType',
'string',
'Golden Apple',
['Golden Apple', 'Dave and Bambi', 'Old Psych', 'New Psych', 'VS Steve', 'Plank Engine', 'Strident Crisis']);
['Golden Apple', 'Dave and Bambi', 'Old Psych', 'New Psych', 'VS Steve', 'Plank Engine', 'Strident Crisis', 'SB Engine']);
addOption(option);

var option:Option = new Option('Note Splash Type:',
Expand Down Expand Up @@ -551,6 +551,12 @@ class VisualsUISubState extends BaseOptionsMenu
true);
addOption(option);

var option:Option = new Option('Main Menu Tips',
"If unchecked, hides those tips at the top in the main menu!",
'tipTexts',
'bool',
true);
addOption(option);

super();
}
Expand Down

1 comment on commit bcf29fd

@Stefan2008Git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Aww dude :)
Finnaly you are crediting me for something really good

Please sign in to comment.