summaryrefslogtreecommitdiff
path: root/src/objects/obj_control.cpp
blob: 19b8b400d1fabbab406942135f3809f5a746ee66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
OUT #include <cstdio>
OUT #include <cstdlib>

double yd=0;

double id(double a){return a;}

EVENT(create){
	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){
	char *s;
	asprintf(&s,"controllll: x=%g y=%g",id(x),id(y));
	draw_text(x,y,s);
	free(s);
}