2016-05-12 01:03:50 +00:00
|
|
|
ground dataspace G {
|
|
|
|
Syndicate.UI.spawnUIDriver();
|
|
|
|
Syndicate.Timer.spawnTimerDriver();
|
2016-05-10 19:33:53 +00:00
|
|
|
|
2016-05-12 01:03:50 +00:00
|
|
|
actor {
|
|
|
|
var ui = new Syndicate.UI.Anchor();
|
2016-08-07 19:41:10 +00:00
|
|
|
field this.angle;
|
|
|
|
field this.handX;
|
|
|
|
field this.handY;
|
|
|
|
|
2016-08-25 12:13:44 +00:00
|
|
|
assert ui.html('#clock',
|
|
|
|
'<svg width="300px" viewBox="0 0 100 100">'+
|
|
|
|
'<circle fill="#0B79CE" r=45 cx=50 cy=50 />'+
|
|
|
|
'<line stroke="#023963" x1=50 y1=50 x2='+this.handX+' y2='+this.handY+' />'+
|
|
|
|
'</svg>')
|
2016-05-12 01:03:50 +00:00
|
|
|
when (typeof this.angle === 'number');
|
2016-05-10 19:33:53 +00:00
|
|
|
|
2016-08-25 12:13:44 +00:00
|
|
|
on message Syndicate.Timer.periodicTick(1000) {
|
|
|
|
this.angle = ((((Date.now() / 1000) % 60) / 60) - 0.25) * 2 * Math.PI;
|
|
|
|
this.handX = 50 + 40 * Math.cos(this.angle);
|
|
|
|
this.handY = 50 + 40 * Math.sin(this.angle);
|
2016-05-10 19:33:53 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-12 01:03:50 +00:00
|
|
|
}
|