summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-12-01 21:29:53 +0100
committertomsmeding <hallo@tomsmeding.nl>2015-12-01 21:29:53 +0100
commitac18b3132059b5e7d5f00ccf2b56e543cf0da84b (patch)
tree490654385bf6aa87f160f79006a12289c20322e6 /src
parentdcaa318d677a1a6881ccc87640ae75c0fc578bfb (diff)
DAT GAME
Diffstat (limited to 'src')
-rw-r--r--src/objects/obj_control.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/objects/obj_control.cpp b/src/objects/obj_control.cpp
index 8c15087..473ce5f 100644
--- a/src/objects/obj_control.cpp
+++ b/src/objects/obj_control.cpp
@@ -1,12 +1,22 @@
+OUT #include <cstdio>
+OUT #include <cstdlib>
+
EVENT(create){
- x=y=10;
- draw_text(42,42,"Control object wow!");
+ x=10;
+ y=240;
+ log("Control object wow!");
}
EVENT(step){
+ static double yd=0;
x++;
+ y+=yd;
+ yd+=(double)rand()/RAND_MAX*2-y/240;
}
EVENT(draw){
- draw_text(x,y,"yay!");
+ char *s;
+ asprintf(&s,"controllll: x=%g y=%g",x,y);
+ draw_text(x,y,s);
+ free(s);
}