Permalink
Browse files

possible fix for issue #35

  • Loading branch information...
1 parent 8307d74 commit 5acf785e07651cbb10417f8de02314c41a615da0 @Beeblerox Beeblerox committed Jun 21, 2012
@@ -15,8 +15,68 @@
<haxelib name="nme" />
<haxelib name="flixel"/>
- <assets path="Assets" rename="assets" include="*" exclude="*.svg" unless="target_flash" />
- <assets path="Assets" rename="assets" include="*" exclude="*.svg|*.wav|*.ogg" if="target_flash" />
+ <assets path="Assets" rename="assets" if="android" >
+ <sound path="data/beep.wav" id="Beep" />
+ <sound path="asplode.wav" id="Asplode" />
+ <sound path="button.wav" id="Button" />
+ <sound path="countdown.wav" id="Countdown" />
+ <sound path="enemy.wav" id="Enemy" />
+ <sound path="hit.wav" id="Hit" />
+ <sound path="hurt.wav" id="Hurt" />
+ <sound path="jam.wav" id="Jam" />
+ <sound path="jet.wav" id="Jet" />
+ <sound path="jump.wav" id="Jump" />
+ <sound path="land.wav" id="Land" />
+ <sound path="menu_hit.wav" id="MenuHit" />
+ <sound path="menu_hit_2.wav" id="MenuHit2" />
+ <sound path="shoot.wav" id="Shoot" />
+ <music path="mode.mp3" id="Mode" />
+ </assets>
+
+ <assets path="Assets" rename="assets" if="desktop" >
+ <sound path="data/beep.wav" id="Beep" />
+ <sound path="asplode.wav" id="Asplode" />
+ <sound path="button.wav" id="Button" />
+ <sound path="countdown.wav" id="Countdown" />
+ <sound path="enemy.wav" id="Enemy" />
+ <sound path="hit.wav" id="Hit" />
+ <sound path="hurt.wav" id="Hurt" />
+ <sound path="jam.wav" id="Jam" />
+ <sound path="jet.wav" id="Jet" />
+ <sound path="jump.wav" id="Jump" />
+ <sound path="land.wav" id="Land" />
+ <sound path="menu_hit.wav" id="MenuHit" />
+ <sound path="menu_hit_2.wav" id="MenuHit2" />
+ <sound path="shoot.wav" id="Shoot" />
+ <music path="mode.wav" id="Mode" />
+ </assets>
+
+ <assets path="Assets" rename="assets" if="target_flash" >
+ <sound path="data/beep.mp3" id="Beep" />
+ <sound path="asplode.mp3" id="Asplode" />
+ <sound path="button.mp3" id="Button" />
+ <sound path="countdown.mp3" id="Countdown" />
+ <sound path="enemy.mp3" id="Enemy" />
+ <sound path="hit.mp3" id="Hit" />
+ <sound path="hurt.mp3" id="Hurt" />
+ <sound path="jam.mp3" id="Jam" />
+ <sound path="jet.mp3" id="Jet" />
+ <sound path="jump.mp3" id="Jump" />
+ <sound path="land.mp3" id="Land" />
+ <sound path="menu_hit.mp3" id="MenuHit" />
+ <sound path="menu_hit_2.mp3" id="MenuHit2" />
+ <sound path="shoot.mp3" id="Shoot" />
+ <music path="mode.mp3" id="Mode" />
+ </assets>
+
+ <assets path="assets/data" include="*.ttf" type="font" />
+ <assets path="assets" include="*.fgr" type="text" />
+ <assets path="assets" include="*.csv" type="text" />
+ <assets path="assets" include="*.txt" type="text" />
+ <assets path="assets" include="*.png" type="image" />
+ <assets path="assets/data" include="*.png" type="image" />
+ <assets path="assets/data/vcr" include="*.png" type="image" />
+ <assets path="assets/data/vis" include="*.png" type="image" />
<!--<icon name="Assets/nme.svg" /> -->
@@ -55,10 +55,7 @@ class Bullet extends FlxSprite
velocity.y = 0;
if(onScreen())
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/jump" + Mode.SoundExtension));
- }
+ FlxG.play("Jump");
}
alive = false;
solid = false;
@@ -67,10 +64,7 @@ class Bullet extends FlxSprite
public function shoot(Location:FlxPoint, Aim:Int):Void
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/shoot" + Mode.SoundExtension));
- }
+ FlxG.play("Shoot");
super.reset(Location.x - width / 2, Location.y - height / 2);
solid = true;
@@ -179,10 +179,7 @@ class Enemy extends FlxSprite
_jets.start(false, 0.5, 0.01);
if(onScreen())
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/jet" + Mode.SoundExtension));
- }
+ FlxG.play("Jet");
}
}
//Then, position the jets at the center of the Enemy,
@@ -212,10 +209,7 @@ class Enemy extends FlxSprite
//and damage is dealt to the Enemy.
override public function hurt(Damage:Float):Void
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/hit" + Mode.SoundExtension));
- }
+ FlxG.play("Hit");
flicker(0.2);
FlxG.score += 10;
@@ -230,10 +224,7 @@ class Enemy extends FlxSprite
{
return;
}
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/asplode" + Mode.SoundExtension));
- }
+ FlxG.play("Asplode");
super.kill();
flicker(0);
@@ -45,10 +45,7 @@ class EnemyBullet extends FlxSprite
velocity.y = 0;
if(onScreen())
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/jump" + Mode.SoundExtension));
- }
+ FlxG.play("Jump");
}
alive = false;
solid = false;
@@ -57,10 +54,7 @@ class EnemyBullet extends FlxSprite
public function shoot(Location:FlxPoint, Angle:Float):Void
{
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/enemy" + Mode.SoundExtension), 0.5);
- }
+ FlxG.play("Enemy", 0.5);
super.reset(Location.x - width / 2, Location.y - height / 2);
FlxU.rotatePoint(0, speed, 0, 0, Angle, _point);
@@ -109,10 +109,7 @@ class MenuState extends FlxState
title2.velocity.x = 0;
//Then, play a cool sound, change their color, and blow up pieces everywhere
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/menu_hit" + Mode.SoundExtension));
- }
+ FlxG.play("MenuHit");
#if neko
FlxG.flash({rgb: 0xd8eba2, a: 0xff}, 0.5);
@@ -185,10 +182,7 @@ class MenuState extends FlxState
if(!fading && ((FlxG.keys.X && FlxG.keys.C) || attractMode))
{
fading = true;
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/menu_hit_2" + Mode.SoundExtension));
- }
+ FlxG.play("MenuHit2");
#if !neko
FlxG.flash(0xffd8eba2, 0.5);
@@ -217,10 +211,7 @@ class MenuState extends FlxState
{
//playButton.exists = false;
onFade();
- if (Mode.SoundOn)
- {
- FlxG.play(Assets.getSound("assets/menu_hit_2" + Mode.SoundExtension));
- }
+ FlxG.play("MenuHit2");
}
//This function is passed to FlxG.fade() when we are ready to go to the next game state.
@@ -5,21 +5,6 @@ import org.flixel.FlxGame;
class Mode extends FlxGame
{
-
- #if flash
- public static var SoundExtension:String = ".mp3";
- #elseif neko
- public static var SoundExtension:String = ".ogg";
- #else
- public static var SoundExtension:String = ".wav";
- #end
-
- #if !neko
- public static var SoundOn:Bool = true;
- #else
- public static var SoundOn:Bool = true;
- #end
-
public function new()
{
var stageWidth:Int = Lib.current.stage.stageWidth;
@@ -32,8 +17,6 @@ class Mode extends FlxGame
#else
super(Math.floor(stageWidth / ratio), Math.floor(stageHeight / ratio), MenuState, ratio, 60, 30);
#end
- //super(320, 240, ParticleState, 2, 50, 50);
- //super(320, 240, CaveGeneratorTest, 2, 50, 50);
forceDebugger = true;
}
}
Oops, something went wrong.

0 comments on commit 5acf785

Please sign in to comment.