diff --git a/Effects/Filters/source/filters/Grain.hx b/Effects/Filters/source/filters/Grain.hx
index 2aabbca9f..9008a7668 100644
--- a/Effects/Filters/source/filters/Grain.hx
+++ b/Effects/Filters/source/filters/Grain.hx
@@ -32,11 +32,10 @@ class Grain extends FlxShader
float width = openfl_TextureSize.x;
float height = openfl_TextureSize.y;
- const float grainamount = 0.05; //grain amount
+ const float grainamount = 0.1; //grain amount
bool colored = false; //colored noise?
float coloramount = 0.6;
- float grainsize = 1.6; //grain particle size (1.5 - 2.5)
- float lumamount = 1.0; //
+ float grainsize = 2.0; //grain particle size (1.5 - 2.5)
//a random texture generator, but you can also use a pre-computed perturbation texture
vec4 rnm(in vec2 tc)
@@ -130,15 +129,6 @@ class Grain extends FlxShader
}
vec3 col = texture2D(bitmap, openfl_TextureCoordv).rgb;
-
- //noisiness response curve based on scene luminance
- vec3 lumcoeff = vec3(0.299,0.587,0.114);
- float luminance = mix(0.0,dot(col, lumcoeff),lumamount);
- float lum = smoothstep(0.2,0.0,luminance);
- lum += luminance;
-
-
- noise = mix(noise,vec3(0.0),pow(lum,4.0));
col = col+noise*grainamount;
gl_FragColor = vec4(col,1.0);
diff --git a/Features/CollisionAndGrouping/Project.xml b/Features/CollisionAndGrouping/Project.xml
index e7ec8cf96..eb2099667 100644
--- a/Features/CollisionAndGrouping/Project.xml
+++ b/Features/CollisionAndGrouping/Project.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/Features/FlxFSM/assets/groundpound.ogg b/Features/FlxFSM/assets/groundpound.ogg
new file mode 100644
index 000000000..f9e1d9fba
Binary files /dev/null and b/Features/FlxFSM/assets/groundpound.ogg differ
diff --git a/Features/FlxFSM/assets/groundpoundfinish.ogg b/Features/FlxFSM/assets/groundpoundfinish.ogg
new file mode 100644
index 000000000..d5af31036
Binary files /dev/null and b/Features/FlxFSM/assets/groundpoundfinish.ogg differ
diff --git a/Features/FlxFSM/assets/happynewyear.ogg b/Features/FlxFSM/assets/happynewyear.ogg
new file mode 100644
index 000000000..df4c0dab3
Binary files /dev/null and b/Features/FlxFSM/assets/happynewyear.ogg differ
diff --git a/Features/FlxFSM/assets/jump.ogg b/Features/FlxFSM/assets/jump.ogg
new file mode 100644
index 000000000..0d63b0a21
Binary files /dev/null and b/Features/FlxFSM/assets/jump.ogg differ
diff --git a/Features/FlxFSM/assets/powerup.ogg b/Features/FlxFSM/assets/powerup.ogg
new file mode 100644
index 000000000..a6cb059be
Binary files /dev/null and b/Features/FlxFSM/assets/powerup.ogg differ
diff --git a/Features/FlxFSM/assets/superjump.ogg b/Features/FlxFSM/assets/superjump.ogg
new file mode 100644
index 000000000..cb7d70370
Binary files /dev/null and b/Features/FlxFSM/assets/superjump.ogg differ
diff --git a/Features/FlxFSM/assets/walk.ogg b/Features/FlxFSM/assets/walk.ogg
new file mode 100644
index 000000000..89bcb7244
Binary files /dev/null and b/Features/FlxFSM/assets/walk.ogg differ
diff --git a/Features/FlxFSM/source/PlayState.hx b/Features/FlxFSM/source/PlayState.hx
index f802ddce5..1c05d507e 100644
--- a/Features/FlxFSM/source/PlayState.hx
+++ b/Features/FlxFSM/source/PlayState.hx
@@ -30,6 +30,12 @@ class PlayState extends FlxState
bgColor = 0xff661166;
super.create();
+ // Music by 8-BITek
+ // Licensed under CC BY-NC-ND 3.0
+ // https://www.newgrounds.com/audio/listen/1341678
+ FlxG.sound.playMusic("assets/happynewyear.ogg", 0);
+ FlxG.sound.music.fadeIn(2, 0, 0.2);
+
final J = 99;
final G = 100;
final columns = 20;
@@ -86,12 +92,14 @@ class PlayState extends FlxState
FlxG.overlap(_slime, _superJump, function (_, _)
{
+ FlxG.sound.play("assets/powerup.ogg");
_slime.addSuperJump();
_superJump.kill();
});
FlxG.overlap(_slime, _groundPound, function (_, _)
{
+ FlxG.sound.play("assets/powerup.ogg");
_slime.addGroundPound();
_groundPound.kill();
startGroundPoundInfoTween();
diff --git a/Features/FlxFSM/source/Slime.hx b/Features/FlxFSM/source/Slime.hx
index 062f811c2..d5e38105c 100644
--- a/Features/FlxFSM/source/Slime.hx
+++ b/Features/FlxFSM/source/Slime.hx
@@ -1,5 +1,6 @@
package;
+import flixel.sound.FlxSound;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.util.FlxFSM;
@@ -95,8 +96,11 @@ class Conditions
class Idle extends FlxFSMState
{
+ var walkSnd:FlxSound;
+
override function enter(owner:Slime, fsm:FlxFSM):Void
{
+ walkSnd = FlxG.sound.load("assets/walk.ogg", 0.4);
owner.animation.play("standing");
}
@@ -105,6 +109,7 @@ class Idle extends FlxFSMState
owner.acceleration.x = 0;
if (FlxG.keys.pressed.LEFT || FlxG.keys.pressed.RIGHT)
{
+ walkSnd.play();
owner.facing = FlxG.keys.pressed.LEFT ? LEFT : RIGHT;
owner.animation.play("walking");
owner.acceleration.x = FlxG.keys.pressed.LEFT ? -300 : 300;
@@ -115,12 +120,18 @@ class Idle extends FlxFSMState
owner.velocity.x *= 0.9;
}
}
+
+ override function exit(owner:Slime) {
+ walkSnd.stop();
+ super.exit(owner);
+ }
}
class Jump extends FlxFSMState
{
override function enter(owner:Slime, fsm:FlxFSM):Void
{
+ FlxG.sound.play("assets/jump.ogg", FlxG.random.float(0.9, 1.0));
owner.animation.play("jumping");
owner.velocity.y = -200;
}
@@ -139,6 +150,7 @@ class SuperJump extends Jump
{
override function enter(owner:Slime, fsm:FlxFSM):Void
{
+ FlxG.sound.play("assets/superjump.ogg", FlxG.random.float(0.9, 1.0));
owner.animation.play("jumping");
owner.velocity.y = -300;
}
@@ -150,6 +162,7 @@ class GroundPound extends FlxFSMState
override function enter(owner:Slime, fsm:FlxFSM):Void
{
+ FlxG.sound.play("assets/groundpound.ogg");
owner.animation.play("pound");
owner.velocity.x = 0;
owner.acceleration.x = 0;
@@ -174,6 +187,7 @@ class GroundPoundFinish extends FlxFSMState
{
override function enter(owner:Slime, fsm:FlxFSM):Void
{
+ FlxG.sound.play("assets/groundpoundfinish.ogg");
owner.animation.play("landing");
FlxG.camera.shake(0.025, 0.25);
owner.velocity.x = 0;
diff --git a/Performance/PixelPerfectCollision/source/PlayState.hx b/Performance/PixelPerfectCollision/source/PlayState.hx
index e73976d8d..241c0dc7c 100644
--- a/Performance/PixelPerfectCollision/source/PlayState.hx
+++ b/Performance/PixelPerfectCollision/source/PlayState.hx
@@ -88,6 +88,9 @@ class PlayState extends FlxState
updateSpriteAngles();
updateSpriteScales();
+ FlxG.camera.update(FlxG.elapsed);
+
+
// add objects for more interstellar fun!
for (i in 1...NUM_ALIENS)
addAlien();