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

double yd=0;

EVENT(create){
	x=10;
	y=240;
	log("Control object wow!");
	instance_create<obj_hoi>(20,20);
}

EVENT(step){
	// static double yd=0;
	x++;
	y+=yd;
	yd+=(double)rand()/RAND_MAX*2-y/240;
}

EVENT(draw){
	draw_textf(x,y,"controllll: x=%g y=%g",x,y);
}