Thread: Analog Clock
View Single Post
  #6  
Old 03-13-2009, 02:02 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Pretty inefficient and sore on the eyes. I use this on Maloria, perhaps any of it would make it possible for you to tweak yours?

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setImg("mal_clock.gif");
  
drawUnderPlayer();
  
setTimer(.05);
}

function 
onTimeOut()
{
  
// Hour
  
with (findImg(200)) {
    
this.angle = -pi*(serverr.time.hour/6);
    
polygon = { 1.9.3*sin(this.angle), .9 .3*cos(this.angle) };
    
red .45green .2blue .1;
    
layer 2;
  }
  
  
// Minute
  
with (findImg(201)) {
    
this.angle = -pi*(serverr.time.minute/30);
    
polygon = { 1.9.5*sin(this.angle), .9 .5*cos(this.angle) };
    
red .3green .2blue .1;
    
layer 2;
  }
  
  
// Second
  
with (findImg(202)) {
    
this.angle = -pi*(serverr.time.second/30);
    
polygon = { 1.9.35*sin(this.angle), .9 .35*cos(this.angle) };
    
red .3green .2blue .1;
    
layer 2;
  }
  
setTimer(.05);
}

function 
onActionDoubleMouse()
{
  
client.messages.add("This is a clock");
  
client.messages.add("The current time is" SPC serverr.time.hour ":" serverr.time.minute);

Attached Images
 
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote