<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=How_to_Create_a_Clock</id>
	<title>How to Create a Clock - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=How_to_Create_a_Clock"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=How_to_Create_a_Clock&amp;action=history"/>
	<updated>2026-05-20T07:21:07Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=How_to_Create_a_Clock&amp;diff=1694&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=How_to_Create_a_Clock&amp;diff=1694&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:14Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 11:33, 21 июля 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key digida:diff:1.41:old-1693:rev-1694 --&gt;
&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=How_to_Create_a_Clock&amp;diff=1693&amp;oldid=prev</id>
		<title>scratch&gt;CrazyBoy826: see also</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=How_to_Create_a_Clock&amp;diff=1693&amp;oldid=prev"/>
		<updated>2022-05-20T00:09:03Z</updated>

		<summary type="html">&lt;p&gt;see also&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{see also|Setting the Time}}&lt;br /&gt;
This is a tutorial on &amp;#039;&amp;#039;&amp;#039;how to create a clock&amp;#039;&amp;#039;&amp;#039;. This clock returns the player&amp;#039;s time because this tutorial uses the [[Current () (block)|&amp;lt;sb&amp;gt;current [ v]&amp;lt;/sb&amp;gt; block]], which is local.&lt;br /&gt;
&lt;br /&gt;
==Analogue Clock==&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
To start, create three [[Sprite]]s: one for the hour hand, one for the minute hand, and one for the second hand.&lt;br /&gt;
&lt;br /&gt;
{{warning|Set the costume center to any end of the lines otherwise the project will not work.}}&lt;br /&gt;
&lt;br /&gt;
===Coding===&lt;br /&gt;
&amp;lt;!-- please add more comments to the scripts to make this informative, guys --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Second Hand====&lt;br /&gt;
This is the script for the second hand:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
point in direction ((0) + ((current [second v]) * (6))) // x6 because 360/60=6.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Minute Hand====&lt;br /&gt;
This is the script for the minute hand:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
point in direction ((0) + ((current [minute v]) * (6)))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Hour Hand====&lt;br /&gt;
This is the script for the hour hand:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
point in direction (0)&lt;br /&gt;
turn cw (((current [hour v]) * (30)) + ((current [minute v]) / (2))) degrees // Calculations: 360/12=30 and 1/2=0.5;0.5*60=30.&lt;br /&gt;
forever&lt;br /&gt;
wait until &amp;lt;([direction v] of (minute hand v)) = (([direction v] of (minute hand v)) + (6))&lt;br /&gt;
turn cw (0.5) degrees&lt;br /&gt;
wait (2) secs // This is so it would not turn 15 degrees.&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digital Clock==&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
Create only one variable named &amp;quot;Digital Time&amp;quot; or &amp;quot;Time&amp;quot; to start.&lt;br /&gt;
&lt;br /&gt;
===Coding===&lt;br /&gt;
&lt;br /&gt;
====24 Hour====&lt;br /&gt;
This is the script on how to make a 24 hour digital clock:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
set [Time v] to (join (current [hour v]) (join [ : ] (join (current [minute v]) (join [ : ] (current [second v])))))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====12 Hour====&lt;br /&gt;
This is the script for a 12 hour clock:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when gf clicked&lt;br /&gt;
forever&lt;br /&gt;
if &amp;lt;(current [hour v]) = [0]&amp;gt; then&lt;br /&gt;
set [Time v] to (join ((current [hour v]) + (12)) (join [ : ] (join (current [minute v]) (join [ : ] (join (current [second v]) [.am]))))&lt;br /&gt;
else&lt;br /&gt;
if &amp;lt;&amp;lt;(current [hour v]) &amp;gt; [0]&amp;gt; and &amp;lt;(current [hour v]) &amp;lt; [12]&amp;gt;&amp;gt; then&lt;br /&gt;
set [Time v] to (join (current [hour v]) (join [ : ] (join (current [minute v]) (join [ : ] (join (current [second v]) [.am]))))&lt;br /&gt;
else&lt;br /&gt;
if &amp;lt;(current [hour v]) = [12]&amp;gt; then&lt;br /&gt;
set [Time v] to (join (current [hour v]) (join [ : ] (join (current [minute v]) (join [ : ] (join (current [second v]) [.pm]))))&lt;br /&gt;
else&lt;br /&gt;
if &amp;lt;&amp;lt;(current [hour v]) &amp;gt; [12]&amp;gt; and &amp;lt;(current [hour v]) &amp;lt; [24]&amp;gt;&amp;gt; then&lt;br /&gt;
set [time v] to (join ((current [hour v]) - (12)) (join [ : ] (join (current [minute v]) (join [ : ] (join (current [second v]) [.am]))))&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
* An Analogue Clock: [[projects:164347518|Clock Example]] by jakel181&lt;br /&gt;
* A 24 hour Digital Clock: [[projects:236402902|24 Hour Clock Example]] by jakel181&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Current () (block)]]&lt;br /&gt;
* [[Setting the Time]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;br /&gt;
[[nl:Klok]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;CrazyBoy826</name></author>
	</entry>
</feed>