Skip to content

Commit

Permalink
Add a test for HaxeFlixel#1833
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 authored and Aurel300 committed Apr 17, 2018
1 parent 8c7c98b commit 4ab6c4e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flixel/system/FlxSound.hx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class FlxSound extends FlxBasic
*/
public var loopTime:Float;
/**
* The tween used to fade this sounds volume in and out
* The tween used to fade this sound's volume in and out (set via `fadeIn()` and `fadeOut()`)
*/
public var fadeTween:FlxTween;
/**
Expand Down Expand Up @@ -463,7 +463,7 @@ class FlxSound extends FlxBasic
{
fadeTween.cancel();
}
fadeTween = FlxTween.num(volume, To, Duration, { onComplete:onComplete }, volumeTween);
fadeTween = FlxTween.num(volume, To, Duration, { onComplete: onComplete }, volumeTween);

return this;
}
Expand All @@ -485,7 +485,7 @@ class FlxSound extends FlxBasic
{
fadeTween.cancel();
}
fadeTween = FlxTween.num(From, To, Duration, { onComplete:onComplete }, volumeTween);
fadeTween = FlxTween.num(From, To, Duration, { onComplete: onComplete }, volumeTween);
return this;
}

Expand Down
18 changes: 18 additions & 0 deletions tests/unit/src/flixel/math/FlxVelocityTest.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package flixel.math;

import flixel.FlxSprite;
import massive.munit.Assert;

class FlxVelocityTest extends FlxTest
{
@Test // #1833
function testAccelerateFromAngleNegativeMaxVelocity()
{
var sprite = new FlxSprite();
FlxVelocity.accelerateFromAngle(sprite, FlxAngle.TO_RAD * -90, 50, 100);

Assert.isTrue(sprite.velocity.equals(FlxPoint.get(0, 0)));
Assert.isTrue(sprite.maxVelocity.equals(FlxPoint.get(0, 100)));
Assert.isTrue(sprite.acceleration.equals(FlxPoint.get(0, -50)));
}
}

0 comments on commit 4ab6c4e

Please sign in to comment.