summaryrefslogtreecommitdiff
path: root/src/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/obj_control.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/objects/obj_control.cpp b/src/objects/obj_control.cpp
index 66b481c..87c685d 100644
--- a/src/objects/obj_control.cpp
+++ b/src/objects/obj_control.cpp
@@ -1,12 +1,13 @@
OUT #include <cstdlib>
static double yd=0;
+static Object *hoiobj;
EVENT(create){
draw_set_font(fnt_liber);
x=10;
y=240;
- instance_create<obj_hoi>(20,20);
+ hoiobj=instance_create<obj_hoi>(20,20);
}
EVENT(step){
@@ -14,6 +15,13 @@ EVENT(step){
y+=yd;
yd+=(double)rand()/RAND_MAX*2-y/240;
yd*=0.99;
+
+ if(x==100){
+ instance_destroy(hoiobj);
+ } else if(x==200){
+ instance_destroy(this);
+ return;
+ }
}
EVENT(draw){