This is my first real thyme scene. I love it, but it's useless, maybe you want to use it in a race game, for the time.. but please cred me.
Open the script menu of the hinge of the bar on the right. On the line "Motor" you type: "{scene.my.start}" (without the quotes)
Now it should work when you press start.
Controles: (everything is with the dragtool)
Drag the start down to start the stopwatch
Drag the stop to stop the stopwatch
Drag the reset to reset the stopwatch.
Warning: You can reset the stopwatch while it's started, so watch it
I used very simple coding. everyone will understand if you know a bit about scripting.
scene.my.s // the seconds variable
scene.my.m // the minute variable
scene.my.h // the hour variable
Chip This is the box on the left, I call this the chip because it does the calculations
onCollide = (e)=>{
scene.my.s == 60 ? {
scene.my.s := 0;
scene.my.m := scene.my.m + 1
} : {};
scene.my.m == 60 ? {
scene.my.m := 0;
scene.my.h := scene.my.h + 1
} : {};
scene.my.h == 24 ? {
scene.my.s := 0;
scene.my.m := 0;
scene.my.h := 0
} : {}
}
Engine This is the bar and circle on the right, that updates the seconds
onCollide = (e)=>{scene.my.s = scene.my.s + 1}
Buttons
Start
onCollide = (e)=>{
scene.my.start := true;
scene.my.aa := 0.30000001
}
Spring for that button
length = {scene.my.aa}
Stop
onCollide = (e)=>{
scene.my.start := false;
scene.my.aa := 0.60000002
}
Reset
onCollide = (e)=>{
scene.my.s := 0;
scene.my.m := 0;
scene.my.h := 0
}
Screen
Seconds
text = {" " + scene.my.s}
Minutes
text = {" " + scene.my.m}
Hours
text = {" " + scene.my.h}
Enjoy, I hope you like it