diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/objects/obj_control.cpp | 16 |
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); } |