Oh my! I only meant making an analog clock, because you could write fairly simple code for the hands. This looks really complex, how big must the code be?
Yeah, this was due to a last-minute critical bug that they had to be left out until we figure out a solution. They will make a return, hopefully very soon.
It’s probably a lot longer than it needs to be as this was a bit of a test and I’m a scrub.
Here’s the code for anyone interested or that want to mess with it.
This will display the units part of the seconds of the current time.
The code
# Keep position the same
x' = x;
y' = y;
# Define each segment of the clock face
top = (y<-80); # Top Segment
top_left = (((x>80)+(y<0))>1); # Upper Left Segment
top_right = (((x<-80)+(y<0))>1); # Upper Right Segment
middle = (((y>-10)+(y<10))>1); # Middle Segment
bot_left = (((x>80)+(y>0))>1); # Bottom Left Segment
bot_right = (((x<-80)+(y>0))>1); # Bottom Right Segment
bot = (y>80); # Bottom Segment
# Define each number using the segments
m0 = top + top_left + top_right + bot_left + bot_right + bot; # Number 0
m1 = top_left + bot_left; # Number 1
m2 = top + top_right + middle + bot_left + bot; # Number 2
m3 = top + top_right + middle + bot_right + bot; # Number 3
m4 = top_left + top_right + middle + bot_right; # Number 4
m5 = top + top_left + middle + bot_right + bot; # Number 5
m6 = top + top_left + middle + bot_left + bot_right + bot; # Number 6
m7 = top + top_right + bot_right; # Number 7
m8 = top + top_left + top_right + middle + bot_left + bot_right + bot; # Number 8
m9 = top + top_left + top_right + middle + bot_right; # Number 9
# Calculate time
#hours = floor( time / 3600 );
#mins = floor( time / 60 % 60 );
secs = floor( time % 60 );
number = secs % 10;
# Work out which number should be displayed
v0 = (((number>-1)+(number<1))>1)*m0;
v1 = (((number>0)+(number<2))>1)*m1;
v2 = (((number>1)+(number<3))>1)*m2;
v3 = (((number>2)+(number<4))>1)*m3;
v4 = (((number>3)+(number<5))>1)*m4;
v5 = (((number>4)+(number<6))>1)*m5;
v6 = (((number>5)+(number<7))>1)*m6;
v7 = (((number>6)+(number<8))>1)*m7;
v8 = (((number>7)+(number<9))>1)*m8;
v9 = (((number>8)+(number<10))>1)*m9;
# Display the number
v = v0 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9;
Awesome. Maybe it will make this a lot more legible.
It would also be cool to control the alpha of both the beam and decal separately, although I know this may make things unrealistic. It could help create some cool effects.
Also, you can change the brightness of the beams by using the opacity slider, which doesn’t affect the laser points… that are not there for the time being
Update to the Digital Clock. I got it working in HH:MM format in 1 Laser Projector. Now that there’s endpoints, the numbers are considerably more legible. This code was written before the new expressions and if statements were added, so it’s quite a mess.
Found this thread on Google and decided to make a 12hr format version of this clock, using two different block colors to differentiate AM/PM. By default, it’s 0 for AM and 180 for PM; if you change these, I recommend going with complementary hues.