diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-10 01:35:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-10 01:35:53 +0500 |
| commit | a76f96e6d6e5ffdfa610328cb30714caf9a453d1 (patch) | |
| tree | 609c5a40c215a296c8c40c040dab8ea4c5e436fc | |
| parent | caca95bab3021cffc7d5cfd504f03cab6a12c799 (diff) | |
feat: purr on player click
| -rwxr-xr-x | assets/sfx/player/purr.ogg | bin | 0 -> 5824 bytes | |||
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/player/DecalPlayer.java | 5 |
2 files changed, 5 insertions, 0 deletions
diff --git a/assets/sfx/player/purr.ogg b/assets/sfx/player/purr.ogg Binary files differnew file mode 100755 index 0000000..e4db8f1 --- /dev/null +++ b/assets/sfx/player/purr.ogg diff --git a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java index 60faf9b..5ce2abe 100644 --- a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java +++ b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java @@ -1,6 +1,7 @@ package kz.ilotterytea.maxon.player; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g3d.decals.Decal; @@ -8,6 +9,7 @@ import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.math.collision.Ray; +import kz.ilotterytea.maxon.MaxonGame; public class DecalPlayer { private final TextureRegion[] regions; @@ -56,6 +58,9 @@ public class DecalPlayer { if (Intersector.intersectRayBounds(ray, box, intersection)) { updateTextureRegion(); savegame.increaseMoney(1); + + Sound sound = MaxonGame.getInstance().assetManager.get("sfx/player/purr.ogg", Sound.class); + sound.play(); } } |
