Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Arcade/FlxInvaders/Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

<set name="BUILD_DIR" value="export" />
<source path="source" />
<assets path="assets" />
<assets path="assets" exclude="*.ogg" if="flash"/>
<assets path="assets" exclude="*.mp3" unless="flash"/>
<haxedef name="FLX_DEFAULT_SOUND_EXT" />

<!-- _______________________________ Libraries ______________________________ -->

Expand Down
Binary file added Arcade/FlxInvaders/assets/theme.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions Arcade/FlxInvaders/source/PlayState.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package;

import flixel.sound.FlxSound;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.group.FlxGroup;
import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.util.FlxColor;

Expand Down Expand Up @@ -63,7 +63,7 @@ class PlayState extends FlxState
override public function create():Void
{
if (FlxG.sound.music == null)
FlxG.sound.playMusic("assets/theme.ogg");
FlxG.sound.playMusic("assets/theme");// Extension ommitted via FLX_DEFAULT_SOUND_EXT

FlxG.mouse.visible = false;

Expand Down
1 change: 1 addition & 0 deletions Arcade/FlxSnake/Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<haxedef name="FLX_NO_MOUSE" if="mobile" />
<haxedef name="FLX_NO_KEYBOARD" if="mobile" />
<haxedef name="FLX_NO_TOUCH" if="desktop" />
<haxedef name="FLX_DEFAULT_SOUND_EXT" />
<!--<haxedef name="FLX_NO_GAMEPAD" />-->

<!--Disable the Flixel core sound tray-->
Expand Down
11 changes: 4 additions & 7 deletions Arcade/FlxSnake/source/PlayState.hx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package;

import flixel.util.FlxDirection;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxPoint;
import flixel.system.FlxAssets;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.math.FlxPoint;
import flixel.util.FlxDirection;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxTimer;

Expand Down Expand Up @@ -158,11 +158,8 @@ class PlayState extends FlxState

// Our reward - a new segment! :)
addSegment();
#if flash
FlxG.sound.load("flixel/sounds/beep.mp3").play();
#else
FlxG.sound.load("flixel/sounds/beep.ogg").play();
#end
// mp3 on flash, ogg otherwise. Enabled via compile flag FLX_DEFAULT_SOUND_EXT
FlxG.sound.play("flixel/sounds/beep");

// Become faster each pickup - set a max speed though!
if (_movementInterval >= MIN_INTERVAL)
Expand Down
4 changes: 2 additions & 2 deletions Features/FlxFSM/source/Slime.hx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package;

import flixel.sound.FlxSound;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.util.FlxFSM;
import flixel.sound.FlxSound;

class Slime extends FlxSprite
{
Expand Down Expand Up @@ -100,7 +100,7 @@ class Idle extends FlxFSMState<Slime>

override function enter(owner:Slime, fsm:FlxFSM<Slime>):Void
{
walkSnd = FlxG.sound.load("assets/sounds/walk", 0.4);
walkSnd = FlxG.sound.create("assets/sounds/walk").setup(0.4);
owner.animation.play("standing");
}

Expand Down
1 change: 0 additions & 1 deletion Features/Pathfinding/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ private abstract Tilemap(FlxTilemap) from FlxTilemap to FlxTilemap
mapData,
false, // invert
1, // scale
null, // colorMap
FlxGraphic.fromClass(GraphicAutoFull),
TILE_SIZE, // tile_width
TILE_SIZE, // tile_height
Expand Down
19 changes: 7 additions & 12 deletions Other/Calculator/source/State.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.addons.ui.FlxUIButton;
import flixel.addons.ui.FlxUIInputText;
import flixel.addons.ui.FlxUIText;
import flixel.math.FlxAngle;
import flixel.math.FlxMath;
Expand All @@ -15,6 +14,7 @@ import flixel.math.FlxRandom;
import flixel.math.FlxRect;
import flixel.math.FlxVelocity;
import flixel.system.scaleModes.PixelPerfectScaleMode;
import flixel.text.FlxInputText;
import flixel.text.FlxText;
import flixel.util.FlxSpriteUtil;
import hscript.Expr;
Expand All @@ -25,7 +25,7 @@ import hscript.Parser;
class State extends FlxState
{
// Input and output texts, and the interpretor
var input:FlxUIInputText = new FlxUIInputText(); // Input text
var input:FlxInputText = new FlxInputText(); // Input text
var outputs:Array<FlxUIText> = new Array<FlxUIText>(); // Output texts
var interp:Interp = new Interp(); // Script interpretor
var graph:FlxSprite;
Expand All @@ -49,12 +49,11 @@ class State extends FlxState
add(labels);

// Input text box
input = new FlxUIInputText();
input.broadcastToFlxUI = false;
input = new FlxInputText();
input.text = "";
input.setPosition(10 + labels.width, 10);
input.setFormat("Font", 8, 0xff000000);
input.textField.width = FlxG.width - input.x - 10;
input.fieldWidth = FlxG.width - input.x - 10;
add(input);

// Output texts
Expand All @@ -81,11 +80,7 @@ class State extends FlxState
{
buttons[y].push(new FlxUIButton(10 + x * 23, FlxG.height - 26 - (btns.length - 1 - y) * 18, btns[y][x], function()
{
var start = input.text.substring(0, input.caretIndex);
var end = input.text.substring(input.caretIndex);
input.text = start + btns[y][x] + end;
input.hasFocus = true;
input.caretIndex++;
input.text += btns[y][x];
}));

buttons[y][x].label.setFormat("Font", 8, 0xff000000, CENTER);
Expand Down Expand Up @@ -131,7 +126,7 @@ class State extends FlxState
} // Next

input.text = txt[index];
input.hasFocus = true;
// input.hasFocus = true;
});

examples[i].label.setFormat("Font", 8, 0xff000000, CENTER);
Expand All @@ -145,7 +140,7 @@ class State extends FlxState
add(FlxSpriteUtil.drawRect(graph, 1, 1, graph.width - 2, graph.height - 2, 0xffffffff));

// Set focus
input.hasFocus = true;
// input.hasFocus = true;

// Bind classes. You can also bind class instances and call their public functions and use their public data
interp.variables.set("x", 0);
Expand Down
14 changes: 7 additions & 7 deletions Tutorials/TurnBasedRPG/source/CombatHUD.hx
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ class CombatHUD extends FlxTypedGroup<FlxSprite>
active = false;
visible = false;

fledSound = FlxG.sound.load(AssetPaths.fled__wav);
hurtSound = FlxG.sound.load(AssetPaths.hurt__wav);
loseSound = FlxG.sound.load(AssetPaths.lose__wav);
missSound = FlxG.sound.load(AssetPaths.miss__wav);
selectSound = FlxG.sound.load(AssetPaths.select__wav);
winSound = FlxG.sound.load(AssetPaths.win__wav);
combatSound = FlxG.sound.load(AssetPaths.combat__wav);
fledSound = FlxG.sound.create(AssetPaths.fled__wav);
hurtSound = FlxG.sound.create(AssetPaths.hurt__wav);
loseSound = FlxG.sound.create(AssetPaths.lose__wav);
missSound = FlxG.sound.create(AssetPaths.miss__wav);
selectSound = FlxG.sound.create(AssetPaths.select__wav);
winSound = FlxG.sound.create(AssetPaths.win__wav);
combatSound = FlxG.sound.create(AssetPaths.combat__wav);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/TurnBasedRPG/source/Enemy.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Enemy extends FlxSprite
seesPlayer = false;
playerPosition = FlxPoint.get();

stepSound = FlxG.sound.load(AssetPaths.step__wav, 0.4);
stepSound = FlxG.sound.create(AssetPaths.step__wav).setup(0.4);
stepSound.proximity(x, y, FlxG.camera.target, FlxG.width * 0.6);
}

Expand Down
2 changes: 1 addition & 1 deletion Tutorials/TurnBasedRPG/source/GameOverState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GameOverState extends FlxState

mainMenuButton = new FlxButton(0, FlxG.height - 32, "Main Menu", switchToMainMenu);
mainMenuButton.screenCenter(FlxAxes.X);
mainMenuButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
mainMenuButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
add(mainMenuButton);

FlxG.camera.fade(FlxColor.BLACK, 0.33, true);
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/TurnBasedRPG/source/MenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MenuState extends FlxState
add(titleText);

playButton = new FlxButton(0, 0, "Play", clickPlay);
playButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
playButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
playButton.x = (FlxG.width / 2) - 10 - playButton.width;
playButton.y = FlxG.height - playButton.height - 10;
add(playButton);
Expand Down
8 changes: 4 additions & 4 deletions Tutorials/TurnBasedRPG/source/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class OptionsState extends FlxState
volumeDownButton = new FlxButton(8, volumeText.y + volumeText.height + 2, "-",
clickVolumeDown);
volumeDownButton.loadGraphic(AssetPaths.button__png, true, 20, 20);
volumeDownButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
volumeDownButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
add(volumeDownButton);

volumeUpButton = new FlxButton(FlxG.width - 28, volumeDownButton.y, "+", clickVolumeUp);
volumeUpButton.loadGraphic(AssetPaths.button__png, true, 20, 20);
volumeUpButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
volumeUpButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
add(volumeUpButton);

volumeBar = new FlxBar(volumeDownButton.x + volumeDownButton.width + 4,
Expand All @@ -71,11 +71,11 @@ class OptionsState extends FlxState

clearDataButton = new FlxButton((FlxG.width / 2) - 90, FlxG.height - 28, "Clear Data",
clickClearData);
clearDataButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
clearDataButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
add(clearDataButton);

backButton = new FlxButton((FlxG.width / 2) + 10, FlxG.height - 28, "Back", clickBack);
backButton.onUp.sound = FlxG.sound.load(AssetPaths.select__wav);
backButton.onUp.sound = FlxG.sound.create(AssetPaths.select__wav);
add(backButton);

// update our bar to show the current volume level
Expand Down
5 changes: 3 additions & 2 deletions Tutorials/TurnBasedRPG/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.sound.FlxSound;
import flixel.tile.FlxTilemap;
import flixel.util.FlxColor;

using flixel.util.FlxSpriteUtil;
#if mobile
import flixel.ui.FlxVirtualPad;
#end

using flixel.util.FlxSpriteUtil;

class PlayState extends FlxState
{
Expand Down Expand Up @@ -68,7 +69,7 @@ class PlayState extends FlxState
combatHud = new CombatHUD();
add(combatHud);

coinSound = FlxG.sound.load(AssetPaths.coin__wav);
coinSound = FlxG.sound.create(AssetPaths.coin__wav);

#if mobile
virtualPad = new FlxVirtualPad(FULL, NONE);
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/TurnBasedRPG/source/Player.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Player extends FlxSprite
setSize(8, 8);
offset.set(4, 8);

stepSound = FlxG.sound.load(AssetPaths.step__wav);
stepSound = FlxG.sound.create(AssetPaths.step__wav);
}

override function update(elapsed:Float)
Expand Down
10 changes: 5 additions & 5 deletions UserInterface/FlxTypeText/source/MenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import flash.geom.Rectangle;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.addons.text.FlxTypeText;
import flixel.system.FlxAssets;
import flixel.ui.FlxButton;
import flixel.addons.text.FlxTypeText;

/**
* A FlxState which can be used for the game's menu.
Expand Down Expand Up @@ -45,11 +45,11 @@ class MenuState extends FlxState
_typeText.skipKeys = ["SPACE"];
_typeText.sounds = [
#if flash
FlxG.sound.load("assets/type01.mp3"),
FlxG.sound.load("assets/type02.mp3")
FlxG.sound.create("assets/type01.mp3"),
FlxG.sound.create("assets/type02.mp3")
#else
FlxG.sound.load("assets/type01.ogg"),
FlxG.sound.load("assets/type02.ogg")
FlxG.sound.create("assets/type01.ogg"),
FlxG.sound.create("assets/type02.ogg")
#end
];

Expand Down
Loading