aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/AudioSource.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-14 11:40:33 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-14 11:40:33 +0100
commit061b2b8ab9aba67c1467cdd163fb7a04de95f4f1 (patch)
treee1960a83461e0d83a7027a88404af1a7c70f6dcd /src/crepe/api/AudioSource.cpp
parentfd2ebb54d0c2b269c15fc84a4ac77993efc917d7 (diff)
parentb9fc66f6922b1f40f2dbe14e8dfc4caa469654bc (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/collision-system
Diffstat (limited to 'src/crepe/api/AudioSource.cpp')
-rw-r--r--src/crepe/api/AudioSource.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crepe/api/AudioSource.cpp b/src/crepe/api/AudioSource.cpp
new file mode 100644
index 0000000..7b05cb1
--- /dev/null
+++ b/src/crepe/api/AudioSource.cpp
@@ -0,0 +1,15 @@
+#include "AudioSource.h"
+
+using namespace crepe;
+using namespace std;
+
+AudioSource::AudioSource(game_object_id_t id, const Asset & src)
+ : Component(id),
+ source(src) {}
+
+void AudioSource::play(bool looping) {
+ this->loop = looping;
+ this->oneshot_play = true;
+}
+
+void AudioSource::stop() { this->oneshot_stop = true; }