Permalink
Browse files

Reduce volume and make player trail behind cursor.

  • Loading branch information...
1 parent 22871a3 commit 0562e2c934f930545be20fbad76c249df54972e5 @ChickenProp committed Jan 11, 2012
Showing with 16 additions and 11 deletions.
  1. +1 −3 Game.as
  2. +15 −8 Player.as
  3. BIN UnattainableLightness.swf
View
4 Game.as
@@ -29,8 +29,6 @@ public class Game extends World {
addSleeper(10, i);
for (var i:int = 10; i <= 470; i += 20)
addSleeper(i, 470);
-
- Input.mouseCursor = "hide";
}
public function addSleeper(x:Number, y:Number) : void {
@@ -79,7 +77,7 @@ public class Game extends World {
if (sleepers.length == 0)
return;
- newWaveSfx.play();
+ newWaveSfx.play(0.2);
waveStarted = frame;
var num:int = waveSizes.shift() || 5;
View
23 Player.as
@@ -38,28 +38,35 @@ public class Player extends Movable {
public var lastmousex:int = -1;
public var lastmousey:int = -1;
+ public var tx:Number;
+ public var ty:Number;
public var moved:Boolean = false;
override public function update () : void {
super.update();
if (Input.mouseX == 0 && Input.mouseY == 0 && !moved)
{
- x = 240;
- y = 240;
+ tx = 240;
+ ty = 240;
}
else if (Input.mouseX != lastmousex
|| Input.mouseY != lastmousey)
{
- x = FP.clamp(Input.mouseX, 40+radius, 440-radius);
- y = FP.clamp(Input.mouseY, 40+radius, 440-radius);
+ tx = FP.clamp(Input.mouseX, 40+radius, 440-radius);
+ ty = FP.clamp(Input.mouseY, 40+radius, 440-radius);
moved = true;
}
- else {
+
+ var target:vec = new vec(tx, ty);
+ pos = pos.add(target.sub(pos).mul(0.3));
+
+ /*else {
var dx:int = int(Input.check(Key.RIGHT)) - int(Input.check(Key.LEFT))
var dy:int = int(Input.check(Key.DOWN)) - int(Input.check(Key.UP));
accel(dx*3, dy*3);
moved = true;
- }
+ }*/
+
lastmousex = Input.mouseX;
lastmousey = Input.mouseY;
@@ -76,7 +83,7 @@ public class Player extends Movable {
var newshine:Number = FP.clamp(shine - (fear-0.5)/50, 0, 1);
if (newshine > shine || courage <= 0)
shine = newshine;
- bgSfx.volume = shine;
+ bgSfx.volume = shine/5;
if (shine == 0)
FP.world = new Game();
@@ -105,7 +112,7 @@ public class Player extends Movable {
return;
shine -= burnPower;
- burnSfx.play();
+ burnSfx.play(0.1);
courage = 15;
burner = game.add(new Burner) as Burner;
}
View
BIN UnattainableLightness.swf
Binary file not shown.

0 comments on commit 0562e2c

Please sign in to comment.