From ac18b3132059b5e7d5f00ccf2b56e543cf0da84b Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 1 Dec 2015 21:29:53 +0100 Subject: DAT GAME --- src/objects/obj_control.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/objects/obj_control.cpp') 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 +OUT #include + 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); } -- cgit v1.2.3-70-g09d2