summaryrefslogtreecommitdiff
path: root/src/effectvideo.cpp
diff options
context:
space:
mode:
authorStephen Simpson <megazig@gmail.com>2011-10-14 00:35:57 -0500
committerStephen Simpson <megazig@gmail.com>2011-10-14 00:35:57 -0500
commitdd010814367f49a742bca1d5ef3b23765240b373 (patch)
tree0aae2fdbd14ecd5f1f95e81d0eceac8ab1f4ec59 /src/effectvideo.cpp
parent1897a8a60cec5bf43bf5cf04cc6b188138aed3ee (diff)
parent68d90d197b750695d59e4c0c6224614bb29aef2b (diff)
downloadkamek-dd010814367f49a742bca1d5ef3b23765240b373.tar.gz
kamek-dd010814367f49a742bca1d5ef3b23765240b373.zip
Merge branch 'level-select' of ssh://treeki.shacknet.nu:30000/Kamek into level-select
Diffstat (limited to 'src/effectvideo.cpp')
-rw-r--r--src/effectvideo.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/effectvideo.cpp b/src/effectvideo.cpp
index ec23158..cacc22d 100644
--- a/src/effectvideo.cpp
+++ b/src/effectvideo.cpp
@@ -3,11 +3,16 @@
#include <g3dhax.h>
#include "player.h"
#include "effects.h"
+#include <sfx.h>
+
+
+extern "C" void *PlaySound(dEn_c *, int soundID);
class EffectVideo : public dEn_c {
int onCreate();
int onExecute();
+ int onDelete();
s32 timer;
u32 effect;
@@ -26,23 +31,33 @@ EffectVideo *EffectVideo::build() {
int EffectVideo::onCreate() {
this->timer = -60;
- this->effect = 0;
+ this->effect = 900;
this->onExecute();
return true;
}
+
+int EffectVideo::onDelete() {
+ return true;
+}
+
+
int EffectVideo::onExecute() {
- if (this->effect > 1000) { return true; }
+ if (this->effect >= 1001) { return true; }
- if (this->timer == 30) {
+ if (this->timer > 60) {
CreateEffect(this, this->effect);
+ PlaySound(this, this->effect);
+ this->pos.x += 16.0;
+
+ this->effect += 1;
+ this->timer = 0;
}
- this->effect += 1;
this->timer += 1;
return true;
}