post stuff!! also now every asset can be animated
This commit is contained in:
@@ -14,6 +14,6 @@ function onDadHit(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function createPost() {
|
||||
function postCreate() {
|
||||
generateNotes(CoolUtil.parseJson(Paths.chart('stress', 'picospeaker')).song);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ function create() {
|
||||
enableCameraHacks = false;
|
||||
}
|
||||
|
||||
function updatePost(elapsed) {
|
||||
function postUpdate(elapsed) {
|
||||
var sin = Math.sin(curBeatFloat * Math.PI / 2);
|
||||
|
||||
camGame.angle = sin * -15;
|
||||
|
||||
@@ -76,7 +76,7 @@ function onPlayerHit(event:NoteHitEvent) {
|
||||
/**
|
||||
* CAMERA HACKS!!
|
||||
*/
|
||||
function createPost() {
|
||||
function postCreate() {
|
||||
if (enablePauseMenu) {
|
||||
PauseSubState.script = 'data/scripts/week6-pause';
|
||||
}
|
||||
@@ -147,7 +147,7 @@ var pixellyShaders = [];
|
||||
// n.offset.x -= 1;
|
||||
// });
|
||||
// }
|
||||
function updatePost(elapsed) {
|
||||
function postUpdate(elapsed) {
|
||||
for(e in pixellyCameras) {
|
||||
if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
|
||||
@@ -72,9 +72,6 @@ function confText(text) {
|
||||
if (!isThorns) text.borderColor = 0xFF953E3E;
|
||||
}
|
||||
|
||||
function createPost() {
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
FlxG.cameras.remove(pauseCam);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1309
|
||||
1311
|
||||
@@ -14,6 +14,6 @@ function onDadHit(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function createPost() {
|
||||
function postCreate() {
|
||||
generateNotes(CoolUtil.parseJson(Paths.chart('stress', 'picospeaker')).song);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ function create() {
|
||||
enableCameraHacks = false;
|
||||
}
|
||||
|
||||
function updatePost(elapsed) {
|
||||
function postUpdate(elapsed) {
|
||||
var sin = Math.sin(curBeatFloat * Math.PI / 2);
|
||||
|
||||
camGame.angle = sin * -15;
|
||||
|
||||
@@ -76,7 +76,7 @@ function onPlayerHit(event:NoteHitEvent) {
|
||||
/**
|
||||
* CAMERA HACKS!!
|
||||
*/
|
||||
function createPost() {
|
||||
function postCreate() {
|
||||
if (enablePauseMenu) {
|
||||
PauseSubState.script = 'data/scripts/week6-pause';
|
||||
}
|
||||
@@ -147,7 +147,7 @@ var pixellyShaders = [];
|
||||
// n.offset.x -= 1;
|
||||
// });
|
||||
// }
|
||||
function updatePost(elapsed) {
|
||||
function postUpdate(elapsed) {
|
||||
for(e in pixellyCameras) {
|
||||
if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
|
||||
@@ -72,9 +72,6 @@ function confText(text) {
|
||||
if (!isThorns) text.borderColor = 0xFF953E3E;
|
||||
}
|
||||
|
||||
function createPost() {
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
FlxG.cameras.remove(pauseCam);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class Note extends FlxSprite
|
||||
{
|
||||
// case "My Custom Note Type": // hardcoding note types
|
||||
default:
|
||||
frames = Paths.getSparrowAtlas(event.noteSprite);
|
||||
frames = Paths.getFrames(event.noteSprite);
|
||||
|
||||
switch(event.strumID % 4) {
|
||||
case 0:
|
||||
|
||||
@@ -339,7 +339,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
|
||||
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(Paths.image('game/healthBar'));
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadAnimatedGraphic(Paths.image('game/healthBar'));
|
||||
healthBarBG.screenCenter(X);
|
||||
healthBarBG.scrollFactor.set();
|
||||
add(healthBarBG);
|
||||
@@ -483,7 +483,7 @@ class PlayState extends MusicBeatState
|
||||
var spr = event.spritePath;
|
||||
if (!Assets.exists(spr)) spr = Paths.image('$spr');
|
||||
|
||||
sprite = new FlxSprite().loadGraphic(spr);
|
||||
sprite = new FlxSprite().loadAnimatedGraphic(spr);
|
||||
sprite.scrollFactor.set();
|
||||
sprite.scale.set(event.scale, event.scale);
|
||||
sprite.updateHitbox();
|
||||
@@ -1138,7 +1138,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (!inCutscene)
|
||||
keyShit();
|
||||
|
||||
@@ -1379,12 +1379,12 @@ class PlayState extends MusicBeatState
|
||||
|
||||
songScore += score;
|
||||
|
||||
rating.loadGraphic(Paths.image('${event.ratingPrefix}$daRating${event.ratingSuffix}'));
|
||||
rating.loadAnimatedGraphic(Paths.image('${event.ratingPrefix}$daRating${event.ratingSuffix}'));
|
||||
rating.acceleration.y = 550;
|
||||
rating.velocity.y -= FlxG.random.int(140, 175);
|
||||
rating.velocity.x -= FlxG.random.int(0, 10);
|
||||
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image('${event.ratingPrefix}combo${event.ratingSuffix}'));
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadAnimatedGraphic(Paths.image('${event.ratingPrefix}combo${event.ratingSuffix}'));
|
||||
comboSpr.acceleration.y = 600;
|
||||
comboSpr.velocity.y -= 150;
|
||||
comboSpr.velocity.x += FlxG.random.int(1, 10);
|
||||
@@ -1407,7 +1407,7 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
var e = separatedScore.charAt(i);
|
||||
|
||||
var numScore:FlxSprite = new FlxSprite((43 * i) - 90, 80).loadGraphic(Paths.image('${event.ratingPrefix}num$e${event.ratingSuffix}'));
|
||||
var numScore:FlxSprite = new FlxSprite((43 * i) - 90, 80).loadAnimatedGraphic(Paths.image('${event.ratingPrefix}num$e${event.ratingSuffix}'));
|
||||
numScore.antialiasing = event.numAntialiasing;
|
||||
numScore.scale.set(event.numScale, event.numScale);
|
||||
numScore.updateHitbox();
|
||||
|
||||
@@ -21,25 +21,25 @@ class GitarooPause extends MusicBeatState
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menus/pauseAlt//pauseBG'));
|
||||
var bg:FlxSprite = new FlxSprite().loadAnimatedGraphic(Paths.image('menus/pauseAlt//pauseBG'));
|
||||
add(bg);
|
||||
|
||||
var bf:FlxSprite = new FlxSprite(0, 30);
|
||||
bf.frames = Paths.getSparrowAtlas('menus/pauseAlt//bfLol');
|
||||
bf.frames = Paths.getFrames('menus/pauseAlt//bfLol');
|
||||
bf.animation.addByPrefix('lol', "funnyThing", 13);
|
||||
bf.animation.play('lol');
|
||||
add(bf);
|
||||
bf.screenCenter(X);
|
||||
|
||||
replayButton = new FlxSprite(FlxG.width * 0.28, FlxG.height * 0.7);
|
||||
replayButton.frames = Paths.getSparrowAtlas('menus/pauseAlt//pauseUI');
|
||||
replayButton.frames = Paths.getFrames('menus/pauseAlt//pauseUI');
|
||||
replayButton.animation.addByPrefix('selected', 'bluereplay', 0, false);
|
||||
replayButton.animation.appendByPrefix('selected', 'yellowreplay');
|
||||
replayButton.animation.play('selected');
|
||||
add(replayButton);
|
||||
|
||||
cancelButton = new FlxSprite(FlxG.width * 0.58, replayButton.y);
|
||||
cancelButton.frames = Paths.getSparrowAtlas('menus/pauseAlt//pauseUI');
|
||||
cancelButton.frames = Paths.getFrames('menus/pauseAlt//pauseUI');
|
||||
cancelButton.animation.addByPrefix('selected', 'bluecancel', 0, false);
|
||||
cancelButton.animation.appendByPrefix('selected', 'cancelyellow');
|
||||
cancelButton.animation.play('selected');
|
||||
|
||||
@@ -54,7 +54,7 @@ class MainMenuState extends MusicBeatState
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuBG'));
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG'));
|
||||
bg.scrollFactor.x = 0;
|
||||
bg.scrollFactor.y = 0.18;
|
||||
bg.scale.set(1.15, 1.15);
|
||||
@@ -66,7 +66,7 @@ class MainMenuState extends MusicBeatState
|
||||
camFollow = new FlxObject(0, 0, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuDesat'));
|
||||
magenta = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuDesat'));
|
||||
magenta.scrollFactor.x = 0;
|
||||
magenta.scrollFactor.y = 0.18;
|
||||
magenta.scale.set(1.15, 1.15);
|
||||
@@ -84,7 +84,7 @@ class MainMenuState extends MusicBeatState
|
||||
for (i in 0...optionShit.length)
|
||||
{
|
||||
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
|
||||
menuItem.frames = Paths.getSparrowAtlas('menus/mainmenu/${optionShit[i]}');
|
||||
menuItem.frames = Paths.getFrames('menus/mainmenu/${optionShit[i]}');
|
||||
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
|
||||
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
|
||||
menuItem.animation.play('idle');
|
||||
|
||||
@@ -71,7 +71,7 @@ class StoryMenuState extends MusicBeatState {
|
||||
weekSprites = new FlxTypedGroup<MenuItem>();
|
||||
|
||||
// DUMBASS ARROWS
|
||||
var assets = Paths.getSparrowAtlas('menus/storymenu/assets');
|
||||
var assets = Paths.getFrames('menus/storymenu/assets');
|
||||
var directions = ["left", "right"];
|
||||
|
||||
leftArrow = new FlxSprite((FlxG.width + 400) / 2, weekBG.y + weekBG.height + 10 + 10);
|
||||
|
||||
@@ -69,14 +69,14 @@ class TitleState extends MusicBeatState
|
||||
add(bg);
|
||||
|
||||
logoBl = new FlxSprite(-150, -100);
|
||||
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
logoBl.frames = Paths.getFrames('logoBumpin');
|
||||
logoBl.antialiasing = true;
|
||||
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logoBl.animation.play('bump');
|
||||
logoBl.updateHitbox();
|
||||
|
||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
|
||||
gfDance.frames = Paths.getFrames('gfDanceTitle');
|
||||
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
||||
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
||||
gfDance.antialiasing = true;
|
||||
@@ -84,7 +84,7 @@ class TitleState extends MusicBeatState
|
||||
add(logoBl);
|
||||
|
||||
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
||||
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
||||
titleText.frames = Paths.getFrames('titleEnter');
|
||||
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
||||
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
||||
titleText.antialiasing = true;
|
||||
@@ -97,7 +97,7 @@ class TitleState extends MusicBeatState
|
||||
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
add(blackScreen);
|
||||
|
||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
|
||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadAnimatedGraphic(Paths.image('newgrounds_logo'));
|
||||
add(ngSpr);
|
||||
ngSpr.visible = false;
|
||||
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
|
||||
|
||||
@@ -56,7 +56,7 @@ class OptionsMenu extends MusicBeatState {
|
||||
if (fromPlayState != null) OptionsMenu.fromPlayState = fromPlayState;
|
||||
}
|
||||
public override function create() {
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuBGBlue'));
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue'));
|
||||
bg.scrollFactor.set();
|
||||
bg.scale.set(1.15, 1.15);
|
||||
bg.updateHitbox();
|
||||
|
||||
@@ -43,7 +43,7 @@ class OptionsScreen extends MusicBeatState {
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
super.create();
|
||||
|
||||
bg = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuBG'));
|
||||
bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG'));
|
||||
bg.scrollFactor.set();
|
||||
bg.scale.set(1.15, 1.15);
|
||||
bg.updateHitbox();
|
||||
|
||||
@@ -56,7 +56,7 @@ class KeybindSetting extends FlxTypedSpriteGroup<FlxSprite> {
|
||||
|
||||
if (sparrowIcon != null) {
|
||||
icon = new FlxSprite();
|
||||
icon.frames = Paths.getSparrowAtlas(sparrowIcon);
|
||||
icon.frames = Paths.getFrames(sparrowIcon);
|
||||
icon.antialiasing = true;
|
||||
icon.animation.addByPrefix('icon', sparrowAnim, 24, true);
|
||||
icon.animation.play('icon');
|
||||
|
||||
@@ -105,8 +105,8 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
|
||||
isSubState = FlxG.state != this;
|
||||
alphabets = new FlxTypedGroup<KeybindSetting>();
|
||||
bg = new FlxSprite(-80).loadGraphic(Paths.image(isSubState ? 'menus/menuTransparent' : 'menus/menuBGBlue'));
|
||||
coloredBG = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuDesat'));
|
||||
bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image(isSubState ? 'menus/menuTransparent' : 'menus/menuBGBlue'));
|
||||
coloredBG = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuDesat'));
|
||||
for(bg in [bg, coloredBG]) {
|
||||
bg.scrollFactor.set();
|
||||
bg.scale.set(1.15, 1.15);
|
||||
|
||||
@@ -25,7 +25,7 @@ class Checkbox extends TextOption {
|
||||
super(text, desc, null);
|
||||
|
||||
checkbox = new FlxSprite(10, -40);
|
||||
checkbox.frames = Paths.getSparrowAtlas('menus/options/checkboxThingie');
|
||||
checkbox.frames = Paths.getFrames('menus/options/checkboxThingie');
|
||||
checkbox.animation.addByPrefix("checked", "Check Box Selected Static", 24);
|
||||
checkbox.animation.addByPrefix("unchecked", "Check Box unselected", 24);
|
||||
checkbox.animation.addByPrefix("checking", "Check Box selecting animation", 24, false);
|
||||
|
||||
@@ -317,5 +317,7 @@ class CoolUtil
|
||||
spr.animation.add("idle", [for(i in 0...spr.frames.frames.length) i], 24, true);
|
||||
spr.animation.play("idle");
|
||||
}
|
||||
|
||||
return spr;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ class AlphaCharacter extends FlxSprite
|
||||
width = 40;
|
||||
return;
|
||||
}
|
||||
frames = Paths.getSparrowAtlas(boldAlphabetPath);
|
||||
frames = Paths.getFrames(boldAlphabetPath);
|
||||
animation.addByPrefix(letter, boldAnims[letter], 24);
|
||||
animation.play(letter);
|
||||
updateHitbox();
|
||||
@@ -267,7 +267,7 @@ class AlphaCharacter extends FlxSprite
|
||||
width = 40;
|
||||
return;
|
||||
}
|
||||
frames = Paths.getSparrowAtlas(letterAlphabetPath);
|
||||
frames = Paths.getFrames(letterAlphabetPath);
|
||||
animation.addByPrefix(letter, letterAnims[letter], 24);
|
||||
animation.play(letter);
|
||||
updateHitbox();
|
||||
|
||||
Reference in New Issue
Block a user