summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/widget2.kvs
blob: 8c9b5b7ae61bd4dd373fbe6dfc91282c8783dfc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# a stupid game :) (version 2)

class(mystupidgame,widget)
{
	constructor
	{
		srand $unixTime;
		$$->$setCaption(":)");
		$$->$setGeometry($rand(770),$rand(570),30,30);
	}
	mouseEnterEvent
	{
		$$->$move($rand(770),$rand(570));
	}
	mousePressEvent
	{
		echo "You got me!"
		delete $$
	}
}

%w = $new(mystupidgame,0)
%w->$show()