<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>เกมส์ Archives - KarnLab</title>
	<atom:link href="https://karnlab.com/tag/%e0%b9%80%e0%b8%81%e0%b8%a1%e0%b8%aa%e0%b9%8c/feed/" rel="self" type="application/rss+xml" />
	<link>https://karnlab.com/tag/เกมส์/</link>
	<description>Blog รีวิว หนังสือ เขียนโปรแกรม นานาสาระ</description>
	<lastBuildDate>Tue, 19 Feb 2019 15:03:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://karnlab.com/wp-content/uploads/2017/12/Logo-150x150.png</url>
	<title>เกมส์ Archives - KarnLab</title>
	<link>https://karnlab.com/tag/เกมส์/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 6 เกมส์บินเก็บของ</title>
		<link>https://karnlab.com/scratch-ep6-flying/</link>
					<comments>https://karnlab.com/scratch-ep6-flying/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 19 Feb 2019 15:03:10 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Flying]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[บิน]]></category>
		<category><![CDATA[เก็บของ]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=2471</guid>

					<description><![CDATA[<p>สวัสดีครับน้องๆ หลังจากที่เราเรียนรู้พื้นฐาน สร้างเรื่องสั้น สร้างเสียงดนตรีกันมาแล้ว หลังจากนี้เราจะได้สร้างเกมส์กันสักทีครับ (เย้) และหลังจากนี้อีก 5-6 ตอน ก็จะเป็นการสร้างเกมส์ไปเรื่อยๆ ครับ เราไปลุยกับเกมส์แรกกันเลยครับ สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ https://karnlab.com/scratch-ep1-lets-start/ เลือกตัวละคร 1. [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep6-flying/">สร้างเกมส์ด้วย Scratch : ตอนที่ 6 เกมส์บินเก็บของ</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>สวัสดีครับน้องๆ หลังจากที่เราเรียนรู้พื้นฐาน
สร้างเรื่องสั้น สร้างเสียงดนตรีกันมาแล้ว
หลังจากนี้เราจะได้สร้างเกมส์กันสักทีครับ (เย้) และหลังจากนี้อีก 5-6 ตอน
ก็จะเป็นการสร้างเกมส์ไปเรื่อยๆ ครับ เราไปลุยกับเกมส์แรกกันเลยครับ</p>



<p>สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a> </p>



<h2 class="wp-block-heading">เลือกตัวละคร</h2>



<p>1. ที่แถบ Sprites ข้างขวาข้อความ
New Sprite คลิกไอคอนตัวละคร</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="492" height="180" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-1.jpg" alt="Scratch - EP6 (1)" class="wp-image-2443"/><figcaption>Scratch &#8211; EP6 (1)</figcaption></figure>



<p>จากนั้นเลือกตัวละครที่ต้องการ (เช่น Cat
Flying) – แล้วกดปุ่ม OK ครับ</p>



<figure class="wp-block-image"><img decoding="async" width="1325" height="660" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-2.jpg" alt="Scratch - EP6 (2)" class="wp-image-2444"/><figcaption>Scratch &#8211; EP6 (2)</figcaption></figure>



<figure class="wp-block-image"><img decoding="async" width="494" height="595" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-3.jpg" alt="Scratch - EP6 (3)" class="wp-image-2445"/><figcaption>Scratch &#8211; EP6 (3)</figcaption></figure>



<p>Tip: น้องสามารถลบตัวละครที่ไม่ต้องการได้โดย –
ที่แถบ Sprites คลิกขวาตัวละครที่ไม่ต้องการ – แล้วกดปุ่ม delete</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="241" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-4.jpg" alt="Scratch - EP6 (4)" class="wp-image-2446"/><figcaption>Scratch &#8211; EP6 (4)</figcaption></figure>



<h2 class="wp-block-heading">เตรียมตัวบิน</h2>



<p>2. ก่อนที่น้องแมวของเราจะบิน เราจะให้น้องๆ
แมวพูดทักทายเล็กน้อยครับ (คล้ายๆ ข้อความ START เวลาเริ่มเกมส์)
โดยเพิ่ม Script ดังต่อไปนี้</p>



<p>2.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag
clicked ] มาที่พื้นที่ว่างด้านขวา</p>



<p>2.2) ที่แถบ Scripts
ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง
[ go to front ] มาต่อข้างล่างกล่องที่แล้ว <br>
// คำสั่งนี้จะทำให้ตัวละครของเราเลื่อนมาที่ตำแหน่งด้านหน้าสุดครับ
ก่อนวัตถุอื่นๆ ทั้งหมดครับ</p>



<p>2.3) ที่แถบ Scripts
ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง
[ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – จากนั้นเปลี่ยนข้อความ จาก Hello! เป็น START</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="992" height="599" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-5.jpg" alt="Scratch - EP6 (5)" class="wp-image-2447"/><figcaption>Scratch &#8211; EP6 (5)</figcaption></figure>



<h2 class="wp-block-heading">เพิ่มวัตถุในฉาก</h2>



<p>3. ต่อไปเราจะเพิ่มวัตถุในฉากประกอบกันครับ </p>



<p>3.1) ที่แถบ Sprites ข้างขวาข้อความ
New Sprite คลิกไอคอนตัวละคร</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="180" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-6.jpg" alt="Scratch - EP6 (6)" class="wp-image-2448"/><figcaption>Scratch &#8211; EP6 (6)</figcaption></figure>



<p>จากนั้นเลือกตัวละครที่ต้องการ (เช่น Building) – แล้วกดปุ่ม OK ครับ – จากนั้นจัดตำแหน่งให้สวยงาม</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1323" height="658" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-7.jpg" alt="Scratch - EP6 (7)" class="wp-image-2449"/><figcaption>Scratch &#8211; EP6 (7)</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="495" height="602" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-8.jpg" alt="Scratch - EP6 (8)" class="wp-image-2450"/><figcaption>Scratch &#8211; EP6 (8)</figcaption></figure>



<p>Tip: เราสามารถย่อขนาดของวัตถุได้โดย –
คลิกที่แถบ Costumes (ที่อยู่ข้างๆ แถบ Scripts) – จากนั้นคลิกที่วัตถุ แล้วคลิกลากที่มุมวัตถุ เพื่อย่อ/ขยายวัตถุได้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="862" height="504" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-9.jpg" alt="Scratch - EP6 (9)" class="wp-image-2451"/><figcaption>Scratch &#8211; EP6 (9)</figcaption></figure>



<h2 class="wp-block-heading">เคลื่อนที่</h2>



<p>4. ต่อไปเราจะทำให้น้องแมวของเราบินได้ครับ
แต่เทคนิคที่เราจะใช้คือการเคลื่อนที่ฉากหลัง
เพื่อให้ดูเหมือนว่าน้องแมวของเรากำลังบินอยู่ แบบนี้ครับ
(ซึ่งในหลายเกมส์ก็ใช้เทคนิคการเคลื่อนที่ฉากหลัง แทนการเคลื่อนที่ตัวละคร)</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="291" height="166" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-10.gif" alt="Scratch - EP6 (10)" class="wp-image-2452"/><figcaption>Scratch &#8211; EP6 (10)</figcaption></figure>



<p>ให้น้องๆ เลือกวัตถุ Building แล้วเพิ่ม Script ดังนี้ครับ</p>



<p>4.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag
clicked ] มาที่พื้นที่ว่างด้านขวา</p>



<p>4.2) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ forever ] มาต่อข้างล่างกล่องที่แล้ว</p>



<p>4.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ set x to 0 ] มาต่อในกล่อง [ forever ] แล้วเปลี่ยน 0 เป็น 250</p>



<p>4.4) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ repeat 10 ] มาต่อในกล่อง [ forever ] ท้าย [ set x to
250 ] <br>
และเปลี่ยนค่า [ repeat 10 ] เป็น [
repeat 100 ]</p>



<p>4.5) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ change x by 10 ]
มาต่อในกล่อง [ repeat 100 ] แล้วเปลี่ยน 10
เป็น -5</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="971" height="597" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-11.jpg" alt="Scratch - EP6 (11)" class="wp-image-2453"/><figcaption>Scratch &#8211; EP6 (11)</figcaption></figure>



<p>น้องๆ ลองกดปุ่มธงสีเขียว แล้วสังเกตผลลัพธ์นะครับ</p>



<p>จากนั้น น้องๆ ลองเปลี่ยน [ repeat 100 ]
เป็น [ repeat 50 ] และ [ change x by
-5 ] เป็น [ change x by -10 ] แล้วสังเกตผลลัพธ์นะครับ</p>



<p>Tip: พื้นที่/ตำแหน่งของ Stage เป็นดังนี้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="220" height="141" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-12.png" alt="Scratch - EP6 (12)" class="wp-image-2454"/><figcaption>Scratch &#8211; EP6 (12)</figcaption></figure>



<h2 class="wp-block-heading">เปลี่ยนลุค</h2>



<p>5. น้องๆ จะเห็นว่าตอนนี้เรามีตึกแค่แบบเดียว
แต่เราสามารถแสดงผลตึกหลายๆ แบบได้ แบบนี้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="291" height="162" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-14.gif" alt="Scratch - EP6 (14)" class="wp-image-2455"/><figcaption>Scratch &#8211; EP6 (14)</figcaption></figure>



<p>ระหว่างกล่อง [ set x to 250
] (สีน้ำเงิน) และ [ repeat 100 ] (สีส้ม) –
ให้แทรกคำสั่ง [ next costume ] (สีม่วง / Looks) ดังนี้</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="960" height="595" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-15.jpg" alt="Scratch - EP6 (15)" class="wp-image-2456"/><figcaption>Scratch &#8211; EP6 (15)</figcaption></figure>



<p>น้องๆ ลองกดปุ่มธงสีเขียว
แล้วสังเกตผลลัพธ์นะครับ</p>



<p>Tip: น้องๆ สามารถดูว่าวัตถุที่เราเลือกมี Costumes
แบบไหนบ้าง โดยไปที่แถบ Costumes ข้าง Scripts
นะครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1339" height="670" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-16.jpg" alt="Scratch - EP6 (16)" class="wp-image-2457"/><figcaption>Scratch &#8211; EP6 (16)</figcaption></figure>



<h2 class="wp-block-heading">เพิ่มท้องฟ้า</h2>



<p>6. ที่แถบ Sprites ข้างล่างข้อความ
New Backdrop คลิกไอคอนรูปภาพ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="179" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-17.jpg" alt="Scratch - EP6 (17)" class="wp-image-2458"/><figcaption>Scratch &#8211; EP6 (17)</figcaption></figure>



<p>จากนั้นเลือกพื้นหลังที่ต้องการ (เช่น blue
sky, blue sky 2, blue sky 3) แล้วกดปุ่ม OK –
เราจะเห็นพื้นหลังที่เราเลือกปรากฏที่ Stage</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1319" height="657" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-18.jpg" alt="Scratch - EP6 (18)" class="wp-image-2459"/><figcaption>Scratch &#8211; EP6 (18)</figcaption></figure>



<p>เราจะได้ผลลัพธ์ดังนี้</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="495" height="422" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-19.jpg" alt="Scratch - EP6 (19)" class="wp-image-2460"/><figcaption>Scratch &#8211; EP6 (19)</figcaption></figure>



<p>Tip: น้องๆ
สามารถเปลี่ยนสีท้องฟ้าได้โดยคลิกที่พื้นหลัง แล้วคลิกแถบ Backdrops (ข้างๆ Scripts) – จากนั้นคลิกที่ปุ่มถังสีด้านขวา
แล้วน้องๆ เลือกสีด้านล่าง จากนั้นคลิกที่พื้นหลังครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="856" height="677" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-20.jpg" alt="Scratch - EP6 (20)" class="wp-image-2461"/><figcaption>Scratch &#8211; EP6 (20)</figcaption></figure>



<h2 class="wp-block-heading">อยากเห็นน้องแมวบินได้</h2>



<p>ต่อไปเราจะทำให้น้องแมวบินได้ละครับ
โดยถ้ากดปุ่มขึ้น/ลง จะเคลื่อนที่ตำแหน่ง Y +10/-10 (ตามลำดับ)
โดยให้น้องๆ เพิ่ม Scripts ไปที่น้องแมวดังนี้ครับ</p>



<p>7.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา – แล้วเปลี่ยน
space เป็น up arrow</p>



<p>7.2) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ change y by 10 ]
มาต่อท้ายกล่องที่แล้ว</p>



<p>7.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา – แล้วเปลี่ยน
space เป็น down arrow</p>



<p>7.4) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ change y by 10 ]
มาต่อท้ายกล่องที่แล้ว – แล้วเปลี่ยนค่า 10 เป็น
-10</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1001" height="592" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-21.jpg" alt="Scratch - EP6 (21)" class="wp-image-2462"/><figcaption>Scratch &#8211; EP6 (21)</figcaption></figure>



<p>จากนั้นน้องๆ ลองกดปุ่มขึ้น/ลงบนคีย์บอร์ด
แล้วสังเกตผลลัพธ์ครับ</p>



<p>ชวนคิด: แล้วถ้าเราอยากให้น้องแมวเคลื่อนที่ในแกน
X โดยการกดปุ่มซ้าย/ขวาบนคีย์บอร์ด – ต้องเพิ่ม
Scripts อย่างไรบ้าง?</p>



<p>.</p>



<p>.</p>



<p>.</p>



<p>7.5) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา – แล้วเปลี่ยน
space เป็น right arrow</p>



<p>7.6) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ change x by 10 ]
มาต่อท้ายกล่องที่แล้ว</p>



<p>7.7) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key pressed
] มาที่พื้นที่ว่างด้านขวา – แล้วเปลี่ยน space
เป็น left arrow</p>



<p>7.8) ที่แถบ Scripts ให้คลิกที่คำว่า
Motion (สีน้ำเงิน) – ให้ลากกล่อง [ change x by 10 ]
มาต่อท้ายกล่องที่แล้ว – แล้วเปลี่ยนค่า 10 เป็น
-10</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1007" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-22.jpg" alt="Scratch - EP6 (22)" class="wp-image-2463"/><figcaption>Scratch &#8211; EP6 (22)</figcaption></figure>



<h2 class="wp-block-heading">ให้ดวงใจลอยไปกับฟ้า</h2>



<p>ต่อไปเราจะเพิ่มหัวใจลอยบนฟ้ากันครับ</p>



<p>8. ที่แถบ Sprites ข้างขวาข้อความ
New Sprite คลิกไอคอนตัวละคร – จากนั้นเลือกวัตถุที่ต้องการ
(เช่น Cat Flying) – แล้วกดปุ่ม OK ครับ
– เสร็จแล้วย่อรูปหัวใจให้สวยงาม</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="597" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-23.jpg" alt="Scratch - EP6 (23)" class="wp-image-2464"/><figcaption>Scratch &#8211; EP6 (23)</figcaption></figure>



<p>9. เสร็จแล้ว เพิ่ม Script ดังต่อไปนี้ครับ</p>



<p>9.1) เมนู Events (สีน้ำตาล)
– ให้ลากกล่อง [ when Green Flag clicked ] มาที่พื้นที่ว่างด้านขวา</p>



<p>9.2) เมนู Control (สีส้ม)
– ให้ลากกล่อง [ forever ] มาต่อท้ายกล่องที่แล้ว</p>



<p>9.3) เมนู Motion (สีน้ำเงิน)
– ให้ลากกล่อง [ go to mouse-pointer ] มาต่อในกล่อง [
forever ] จากนั้นเปลี่ยนค่า mouse-pointer เป็น
random position</p>



<p>9.4) เมนู Motion (สีน้ำเงิน)
– ให้ลากกล่อง [ set x to 0 ] มาต่อท้ายกล่องที่แล้ว จากนั้นเปลี่ยนค่า
0 เป็น 250</p>



<p>9.5) เมนู Control (สีส้ม)
– ให้ลากกล่อง [ repeat 10 ] มาต่อท้ายกล่องที่แล้ว จากนั้นเปลี่ยนค่า
10 เป็น 50</p>



<p>9.6) เมนู Motion (สีน้ำเงิน)
– ให้ลากกล่อง [ change x by 10 ] มาต่อในกล่อง [
repeat 50 ] จากนั้นเปลี่ยนค่า 10 เป็น -10</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="973" height="600" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-24.jpg" alt="Scratch - EP6 (24)" class="wp-image-2465"/><figcaption>Scratch &#8211; EP6 (24)</figcaption></figure>



<p>จากนั้นน้องๆ ลองกดปุ่มธงสีเขียว
แล้วกดปุ่มลูกศร ขึ้น/ลง/ซ้าย/ขวา แล้วสังเกตผลลัพธ์ครับ (น้องๆ
สามารถหยุดการเล่นได้โดยกดปุ่มป้ายสีแดง ข้างธงสีเขียวนะครับ)</p>



<p>Tip: น้องๆ สามารถ Copy Scripts ได้โดยคลิกขวาที่ Scripts ที่ต้องการ แล้วเลือก duplicate</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="331" height="239" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-28.jpg" alt="Scratch - EP6 (28)" class="wp-image-2469"/><figcaption>Scratch &#8211; EP6 (28)</figcaption></figure>



<h2 class="wp-block-heading">เก็บหัวใจแล้วได้คะแนน</h2>



<p>สุดท้าย เมื่อน้องแมวเก็บหัวใจได้
ก็จะได้คะแนนครับ</p>



<p>10. ก่อนอื่นให้เราไปที่แถบ Scripts คลิกที่คำว่า Data (สีแสด) เพื่อสร้างตัวแปรไว้สำหรับเก็บคะแนนก่อนครับ
– จากนั้นกดปุ่ม Make a Variable – ตั้งชื่อตัวแปรว่า
score – แล้วกดปุ่ม OK ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1009" height="602" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-25.jpg" alt="Scratch - EP6 (25)" class="wp-image-2466"/><figcaption>Scratch &#8211; EP6 (25)</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="499" height="428" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-26.jpg" alt="Scratch - EP6 (26)" class="wp-image-2467"/><figcaption>Scratch &#8211; EP6 (26)</figcaption></figure>



<p>11. ให้น้องๆ เพิ่ม Script ไปที่น้องแมว ดังนี้ครับ</p>



<p>11.1) เมนู Events (สีน้ำตาล)
– ให้ลากกล่อง [ when Green Flag clicked ] มาที่พื้นที่ว่างด้านขวา</p>



<p>11.2) เมนู Data (สีแสด) –
ให้ลากกล่อง [ set score to 0 ] มาต่อท้ายกล่องที่แล้ว</p>



<p>11.3) เมนู Control (สีส้ม)
– ให้ลากกล่อง [ forever ] มาต่อท้ายกล่องที่แล้ว</p>



<p>11.4) เมนู Control (สีส้ม)
– ให้ลากกล่อง [ if … then ] มาต่อในกล่อง [ forever ]</p>



<p>11.5) เมนู Sensing (สีฟ้า)
– ให้ลากกล่อง [ touching ___ ] มาต่อในที่ว่างของกล่อง [
if … then ] จากนั้นเปลี่ยนค่า ___ เป็น Heart</p>



<p>11.6) เมนู Sound (สีม่วง) – ให้ลากกล่อง [ play sound pop ] มาต่อในกล่อง
[ if … then ]</p>



<p>11.7) เมนู Data (สีแสด) – ให้ลากกล่อง [ change score by 1 ] มาต่อท้ายกล่องที่แล้ว</p>



<p>11.8) เมนู Control
(สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อท้ายกล่องที่แล้ว</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1339" height="600" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-27.jpg" alt="Scratch - EP6 (27)" class="wp-image-2468"/><figcaption>Scratch &#8211; EP6 (27)</figcaption></figure>



<p>จากนั้นน้องๆ ลองกดปุ่มธงสีเขียว
แล้วกดปุ่มลูกศร ขึ้น/ลง/ซ้าย/ขวา แล้วสนุกกับเกมส์นะครับ (น้องๆ
สามารถหยุดการเล่นได้โดยกดปุ่มป้ายสีแดง ข้างธงสีเขียวนะครับ)</p>



<h2 class="wp-block-heading">บทส่งท้าย</h2>



<p>และนี่คือคลิปแสดงผลลัพธ์การเล่มเกมส์นี้บางส่วนครับ</p>



<figure class="wp-block-video"><video height="422" style="aspect-ratio: 494 / 422;" width="494" controls src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-30.mp4"></video></figure>



<p>ในตอนต่อไปเราจะมารสร้างเกมส์อะไรกันอีก น้องๆ
สามารถติดตามสร้างเกมส์ด้วย Scratch ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>



<p>สำหรับโปรเจคทั้งหมด
สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>



<p><strong>หมายเหตุ:</strong> บทเรียนนี้เขียนตอน
Scratch 2.0 นะครับ ตอนนี้เป็น Scratch 3.0 แล้ว อาจจะมีบางส่วนเปลี่ยนไปบ้าง แต่คำสั่งส่วนใหญ่ยังเหมือนเดิมครับ</p>
<p>The post <a href="https://karnlab.com/scratch-ep6-flying/">สร้างเกมส์ด้วย Scratch : ตอนที่ 6 เกมส์บินเก็บของ</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep6-flying/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP6-30.mp4" length="251691" type="video/mp4" />

			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 5 เสียงดนตรี</title>
		<link>https://karnlab.com/scratch-ep5-make-a-music/</link>
					<comments>https://karnlab.com/scratch-ep5-make-a-music/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Fri, 15 Feb 2019 05:21:41 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ดนตรี]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[เสียง]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=2436</guid>

					<description><![CDATA[<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้างเสียงดนตรีกันครับ โดยในตอนนี้เราจะเลือกเครื่องดนตรี และเมื่อคลิกจะเกิดเสียงดนตรี น้องๆ ค่อยๆ ลองทำตามกันไปพร้อมๆ กันนะครับ สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ https://karnlab.com/scratch-ep1-lets-start/ เลือกพื้นหลัง 1. ที่แถบ Sprites ข้างล่างข้อความ [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep5-make-a-music/">สร้างเกมส์ด้วย Scratch : ตอนที่ 5 เสียงดนตรี</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้างเสียงดนตรีกันครับ
โดยในตอนนี้เราจะเลือกเครื่องดนตรี และเมื่อคลิกจะเกิดเสียงดนตรี น้องๆ ค่อยๆ
ลองทำตามกันไปพร้อมๆ กันนะครับ</p>



<p>สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a> </p>



<h2 class="wp-block-heading">เลือกพื้นหลัง</h2>



<p>1. ที่แถบ Sprites ข้างล่างข้อความ
New Backdrop คลิกไอคอนรูปภาพ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="180" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-1.jpg" alt="Scratch - EP5 (1)" class="wp-image-2402"/><figcaption>Scratch &#8211; EP5 (1)</figcaption></figure>



<p>จากนั้นเลือกพื้นหลังที่ต้องการ (เช่น pathway,
slopes) แล้วกดปุ่ม OK –
เราจะเห็นพื้นหลังที่เราเลือกปรากฏที่ Stage</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1324" height="661" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-2.jpg" alt="Scratch - EP5 (2)" class="wp-image-2403"/><figcaption>Scratch &#8211; EP5 (2)</figcaption></figure>



<p>เราจะได้ผลลัพธ์ดังนี้</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="498" height="426" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-3.jpg" alt="Scratch - EP5 (3)" class="wp-image-2404"/><figcaption>Scratch &#8211; EP5 (3)</figcaption></figure>



<p>Tip 1: น้องๆ
สามารถลบตัวละครที่ไม่ต้องการได้โดย – คลิกขวาที่ตัวละครบน Stage แล้วกดเมนู delete ได้เลยครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="498" height="426" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-4.jpg" alt="Scratch - EP5 (4)" class="wp-image-2405"/><figcaption>Scratch &#8211; EP5 (4)</figcaption></figure>



<p>Tip 2: หรือ น้องๆ สามารถลบตัวละครที่ไม่ต้องการได้โดย
– ไปที่แถบ Sprites คลิกขวาที่ตัวละคร แล้วกดเมนู delete ก็ได้เหมือนกันครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="241" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-5.jpg" alt="Scratch - EP5 (5)" class="wp-image-2406"/><figcaption>Scratch &#8211; EP5 (5)</figcaption></figure>



<h2 class="wp-block-heading">เลือกกลอง</h2>



<p>2. ที่แถบ Sprites ข้างขวาข้อความ
New Sprite คลิกไอคอนตัวละคร</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="184" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-6.jpg" alt="Scratch - EP5 (6)" class="wp-image-2407"/><figcaption>Scratch &#8211; EP5 (6)</figcaption></figure>



<p>ที่เมนูด้านข้าง เลือก Theme &gt; Music
– จากนั้นเลือกกลอง (Drum-Conga) แล้วกดปุ่ม OK
ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1318" height="657" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-7.jpg" alt="Scratch - EP5 (7)" class="wp-image-2408"/><figcaption>Scratch &#8211; EP5 (7)</figcaption></figure>



<p>วางตำแหน่งกลองตามที่ต้องการ เราจะได้ผลลัพธ์ดังนี้</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="493" height="600" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-8.jpg" alt="Scratch - EP5 (8)" class="wp-image-2409"/><figcaption>Scratch &#8211; EP5 (8)</figcaption></figure>



<h2 class="wp-block-heading">ตีกลอง</h2>



<p>3. ที่แถบ Sprites คลิกเลือกกลอง
(Drum-Conga) – จากนั้นใส่ Script ดังต่อไปนี้</p>



<p>3.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา</p>



<p>3.2) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound tap conga ] มาต่อกล่องที่แล้ว</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="974" height="610" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-9.jpg" alt="Scratch - EP5 (9)" class="wp-image-2410"/><figcaption>Scratch &#8211; EP5 (9)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม spacebar ก็จะได้ยินเสียงกลองครับ (อย่าลืมเปิดลำโพงด้วยนะ)</p>



<p>น้องสามารถเปลี่ยนเสียงกลองจาก tap conga
เป็น high, low, muted conga ได้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="305" height="242" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-10.jpg" alt="Scratch - EP5 (10)" class="wp-image-2411"/><figcaption>Scratch &#8211; EP5 (10)</figcaption></figure>



<h2 class="wp-block-heading">สร้างจังหวะ</h2>



<p>ให้น้องๆ ลบ Script เดิมก่อนนะครับ
โดยคลิกขวาที่คำสั่ง แล้วคลิกเมนู delete</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="326" height="155" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-11.jpg" alt="Scratch - EP5 (11)" class="wp-image-2412"/><figcaption>Scratch &#8211; EP5 (11)</figcaption></figure>



<p>4. ที่แถบ Sprites คลิกเลือกกลอง
(Drum-Conga) – จากนั้นใส่ Script ดังต่อไปนี้</p>



<p>4.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา</p>



<p>4.2) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound tap conga ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน “tap
conga” เป็น “high conga”</p>



<p>4.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน 1 เป็น 0.125</p>



<p>4.4) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound tap conga ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน “tap
conga” เป็น “low conga”</p>



<p>4.5) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ wait 0.125 sec ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน 1 เป็น 0.125</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="995" height="595" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-12.jpg" alt="Scratch - EP5 (12)" class="wp-image-2413"/><figcaption>Scratch &#8211; EP5 (12)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม spacebar ก็จะได้ยินเสียงกลองที่เริ่มเป็นจังหวะครับ</p>



<h2 class="wp-block-heading">ทำซ้ำ</h2>



<p>5. จาก Script ในข้อที่ 4 –
ให้น้องๆ แทรกคำสั่ง [ repeat 10 ] ซึ่งอยู่ในเมนู Control
(สีส้ม) – มาครอบคำสั่ง 4.2) ถึง 4.5) ครับ </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="493" height="374" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-13.jpg" alt="Scratch - EP5 (13)" class="wp-image-2414"/><figcaption>Scratch &#8211; EP5 (13)</figcaption></figure>



<p>จากนั้นเปลี่ยน [ repeat 10 ] เป็น [ repeat 4 ] ซึ่ง Script จะมีหน้าตาแบบนี้</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1004" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-14.jpg" alt="Scratch - EP5 (14)" class="wp-image-2415"/><figcaption>Scratch &#8211; EP5 (14)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม spacebar ก็จะได้ยินเสียงกลองที่เป็นจังหวะครับ</p>



<h2 class="wp-block-heading">เอฟเฟคตีกลอง</h2>



<p>6. จากคำสั่งในข้อ 5)</p>



<p>6.1) ให้น้องๆ แทรกคำสั่ง [ next costume
] ซึ่งอยู่ในเมนู Looks (สีม่วง) –
มาต่อท้ายคำสั่ง [ play sound high conga ]</p>



<p>6.2) ให้น้องๆ แทรกคำสั่ง [
next costume ] ซึ่งอยู่ในเมนู Looks (สีม่วง)
– มาต่อท้ายคำสั่ง [ play sound low conga ]</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="997" height="595" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-15.jpg" alt="Scratch - EP5 (15)" class="wp-image-2416"/><figcaption>Scratch &#8211; EP5 (15)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม spacebar ก็จะได้ยินเสียงกลองที่เป็นจังหวะ และเห็นเอฟเฟคตีกลองครับ</p>



<h2 class="wp-block-heading">เล่นเครื่องดนตรี</h2>



<p>7. ต่อไปเราจะเพิ่มเครื่องดนตรีอีก 1 ชนิด
นั่นคือ Saxophone ครับ – ที่แถบ Sprites คลิกไอคอนตัวละคร</p>



<p>ที่เมนูด้านข้าง เลือก Theme &gt; Music
– เลือก Saxophone แล้วกดปุ่ม OK – วางตำแหน่งกลองตามที่ต้องการ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1329" height="669" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-16.jpg" alt="Scratch - EP5 (16)" class="wp-image-2417"/><figcaption>Scratch &#8211; EP5 (16)</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="492" height="427" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-17.jpg" alt="Scratch - EP5 (17)" class="wp-image-2418"/><figcaption>Scratch &#8211; EP5 (17)</figcaption></figure>



<p>Tip: เราสามารถย่อขนาดของวัตถุได้โดย –
คลิกที่แถบ Costumes (ที่อยู่ข้างๆ แถบ Scripts) – จากนั้นคลิกที่วัตถุ แล้วคลิกลากที่มุมวัตถุ
เพื่อย่อ/ขยายวัตถุได้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="862" height="504" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-18.jpg" alt="Scratch - EP5 (18)" class="wp-image-2419"/><figcaption>Scratch &#8211; EP5 (18)</figcaption></figure>



<p>8. ต่อมาเราจะเพิ่ม Scripts ให้กับ Saxophone ของเรา ดังนี้ครับ</p>



<p>8.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา แล้วเปลี่ยนจาก “space” เป็น “up arrow” (หรือปุ่มใดก็ได้ที่น้องๆ ชอบครับ)</p>



<p>8.2) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound C2 sax ] มาต่อกล่องที่แล้ว </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1012" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-19.jpg" alt="Scratch - EP5 (19)" class="wp-image-2420"/><figcaption>Scratch &#8211; EP5 (19)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม up arrow (ลูกศรขึ้น) ก็จะได้ยินเสียงโน้ตครับ</p>



<h2 class="wp-block-heading">สร้างเมโลดี้</h2>



<p>9. ต่อจากคำสั่งในข้อ 8 ให้น้องๆ เพิ่ม Scripts
ดังนี้ครับ</p>



<p>8.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน 1 เป็น 0.25</p>



<p>8.4) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound C2 sax ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน “C2 sax” เป็น “G
sax”</p>



<p>8.5) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน 1 เป็น 0.25</p>



<p>8.6) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound C2 sax ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน “C2 sax” เป็น “E
sax”</p>



<p>8.7) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อกล่องที่แล้ว จากนั้นเปลี่ยน 1 เป็น 0.25</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1000" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-20.jpg" alt="Scratch - EP5 (20)" class="wp-image-2421"/><figcaption>Scratch &#8211; EP5 (20)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม up arrow (ลูกศรขึ้น) ก็จะได้ยินเสียงเมโลดี้ครับ</p>



<h2 class="wp-block-heading">เพิ่มคอร์ด</h2>



<p>10. น้องๆ สามารถเพิ่มคอร์ดให้กับ Saxophone
โดยเพิ่ม Scripts ดังนี้ครับ</p>



<p>10.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา แล้วเปลี่ยนจาก “space” เป็น “down arrow” (หรือปุ่มใดก็ได้ที่น้องๆ
ชอบครับ)</p>



<p>10.2) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound F sax ] มาต่อกล่องที่แล้ว </p>



<p>10.3) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound A sax ] มาต่อกล่องที่แล้ว </p>



<p>10.4) ที่แถบ Scripts
ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง
[ play sound C2 sax ] มาต่อกล่องที่แล้ว </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1013" height="606" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-21.jpg" alt="Scratch - EP5 (21)" class="wp-image-2422"/><figcaption>Scratch &#8211; EP5 (21)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม down arrow (ลูกศรลง) ก็จะได้ยินเสียงคอร์ดครับ</p>



<p>น้องๆ ลองเพิ่มคอร์ดตามรูปด้านล่าง
จากนั้นลองกดปุ่ม แล้วฟังเสียงที่เกิดขึ้นครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="376" height="147" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-22.jpg" alt="Scratch - EP5 (22)" class="wp-image-2423"/><figcaption>Scratch &#8211; EP5 (22)</figcaption></figure>



<p>Tip: น้องๆ สามารถ Copy คำสั่งที่ต้องการได้โดย
คลิกขวาที่คำสั่งที่ต้องการ จากนั้นคลิก duplicate ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="326" height="145" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-23.jpg" alt="Scratch - EP5 (23)" class="wp-image-2424"/><figcaption>Scratch &#8211; EP5 (23)</figcaption></figure>



<h2 class="wp-block-heading">เล่นโน้ตแบบสุ่ม</h2>



<p>11. เราจะเพิ่มเครื่องดนตรีอีก 1 ชนิด นั่นคือ Piano
ครับ – ที่แถบ Sprites คลิกไอคอนตัวละคร</p>



<p>ที่เมนูด้านข้าง เลือก Theme &gt; Music
– เลือก Piano แล้วกดปุ่ม OK – วางตำแหน่งกลองตามที่ต้องการ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1320" height="655" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-24.jpg" alt="Scratch - EP5 (24)" class="wp-image-2425"/><figcaption>Scratch &#8211; EP5 (24)</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="495" height="427" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-25.jpg" alt="Scratch - EP5 (25)" class="wp-image-2426"/><figcaption>Scratch &#8211; EP5 (25)</figcaption></figure>



<p>Tip: เราสามารถย่อขนาดของวัตถุได้โดย –
คลิกที่แถบ Costumes (ที่อยู่ข้างๆ แถบ Scripts) – จากนั้นคลิกที่วัตถุ แล้วคลิกลากที่มุมวัตถุ
เพื่อย่อ/ขยายวัตถุได้ครับ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="856" height="509" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-26.jpg" alt="Scratch - EP5 (26)" class="wp-image-2427"/><figcaption>Scratch &#8211; EP5 (26)</figcaption></figure>



<p>12. ต่อมาเราจะเพิ่ม Scripts ให้กับ Piano ของเรา เล่นโน้ตแบบสุ่ม ดังนี้ครับ</p>



<p>12.1) ที่แถบ Scripts ให้คลิกที่คำว่า
Events (สีน้ำตาล) – ให้ลากกล่อง [ when space key
pressed ] มาที่พื้นที่ว่างด้านขวา แล้วเปลี่ยนจาก “space” เป็น “right arrow” (หรือปุ่มใดก็ได้ที่น้องๆ
ชอบครับ)</p>



<p>12.2) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound C2 Piano
] มาต่อกล่องที่แล้ว</p>



<p>12.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Operators (สีเขียว) – ให้ลากกล่อง [ pick random 1
to 10 ] มาแทนที่ “C2 Piano”</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1023" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-27.jpg" alt="Scratch - EP5 (27)" class="wp-image-2428"/><figcaption>Scratch &#8211; EP5 (27)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม right arrow (ลูกศรขวา) ก็จะได้ยินเสียงโน้ต(แบบสุ่ม)ครับ</p>



<h2 class="wp-block-heading">เพิ่มเสียงร้อง</h2>



<p>13. สุดท้ายเราจะเพิ่มให้มีนักร้อง มาร้อง Beatbox กันด้วยครับ – ที่แถบ Sprites คลิกไอคอนตัวละคร</p>



<p>ที่เมนูด้านข้าง เลือก Theme &gt; Music
– เลือก Singer1 แล้วกดปุ่ม OK – วางตำแหน่งกลองตามที่ต้องการ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1322" height="659" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-28.jpg" alt="Scratch - EP5 (28)" class="wp-image-2429"/><figcaption>Scratch &#8211; EP5 (28)</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="718" height="596" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-29.jpg" alt="Scratch - EP5 (29)" class="wp-image-2430"/><figcaption>Scratch &#8211; EP5 (29)</figcaption></figure>



<p>14. น้องๆ สามารถเพิ่มเสียงที่ต้องการได้โดย –
ไปที่แถบ Sounds (อยู่ข้างๆ แถบ Costumes) – จากนั้นกดปุ่มลำโพง</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="556" height="360" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-30.jpg" alt="Scratch - EP5 (30)" class="wp-image-2431"/><figcaption>Scratch &#8211; EP5 (30)</figcaption></figure>



<p>เลือกเสียงที่ต้องการแล้วกดปุ่ม OK</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1321" height="656" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-31.jpg" alt="Scratch - EP5 (31)" class="wp-image-2432"/><figcaption>Scratch &#8211; EP5 (31)</figcaption></figure>



<p>เราจะพบเสียงที่เราเลือกปรากฏบนหน้าจอ</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="554" height="433" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-32.jpg" alt="Scratch - EP5 (32)" class="wp-image-2433"/><figcaption>Scratch &#8211; EP5 (32)</figcaption></figure>



<p>15. จากนั้นเราจะเพิ่ม Scripts ให้กับ Singer1 ของเรา ดังนี้ครับ</p>



<p>15.1) ที่แถบ Scripts
ให้คลิกที่คำว่า Events (สีน้ำตาล) –
ให้ลากกล่อง [ when space key pressed ] มาที่พื้นที่ว่างด้านขวา
แล้วเปลี่ยนจาก “space” เป็น “left arrow” (หรือปุ่มใดก็ได้ที่น้องๆ ชอบครับ)</p>



<p>15.2) ที่แถบ Scripts ให้คลิกที่คำว่า
Control (สีส้ม) – ให้ลากกล่อง [ repeat 10 ] มาต่อกล่องที่แล้ว แล้วเปลี่ยนจาก “10” เป็น “2”</p>



<p>15.3) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound bass
beatbox ] มาต่อในช่อง repeat</p>



<p>15.4)
ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อกล่องที่แล้ว
แล้วเปลี่ยนจาก “1” เป็น “0.25”</p>



<p>15.5) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound hihat
beatbox ] มาต่อกล่องที่แล้ว</p>



<p>15.6) เหมือนข้อ 15.4)</p>



<p>15.7) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound snare
beatbox ] มาต่อกล่องที่แล้ว</p>



<p>15.8) เหมือนข้อ 15.4)</p>



<p>15.9) ที่แถบ Scripts ให้คลิกที่คำว่า
Sound (สีม่วง) – ให้ลากกล่อง [ play sound hihat
beatbox ] มาต่อกล่องที่แล้ว</p>



<p>15.10) เหมือนข้อ 15.4)</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1006" height="593" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-33.jpg" alt="Scratch - EP5 (33)" class="wp-image-2434"/><figcaption>Scratch &#8211; EP5 (33)</figcaption></figure>



<p>เมื่อน้องๆ กดปุ่ม left arrow (ลูกศรซ้าย) ก็จะได้ยินเสียง Beatbox ครับ</p>



<h2 class="wp-block-heading">บันทึกเสียง</h2>



<p>นอกจากนี้น้องๆ สามารถบันทึกเสียงของน้องๆ
ใส่เข้าไปได้ด้วยนะครับ – ไปที่แถบ Sounds (อยู่ข้างๆ แถบ Costumes)
– จากนั้นกดปุ่มไมโครโฟน เพื่อทำการบันทึกเสียง</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="556" height="359" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP5-40.jpg" alt="Scratch - EP5 (40)" class="wp-image-2435"/><figcaption>Scratch &#8211; EP5 (40)</figcaption></figure>



<h2 class="wp-block-heading">บทส่งท้าย</h2>



<p>น้องๆ สามารถติดตามสร้างเกมส์ด้วย Scratch
ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>



<p>สำหรับโปรเจคทั้งหมด
สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>



<p><strong>หมายเหตุ:</strong> บทเรียนนี้เขียนตอน
Scratch 2.0 นะครับ ตอนนี้เป็น Scratch 3.0 แล้ว อาจจะมีบางส่วนเปลี่ยนไปบ้าง แต่คำสั่งส่วนใหญ่ยังเหมือนเดิมครับ</p>
<p>The post <a href="https://karnlab.com/scratch-ep5-make-a-music/">สร้างเกมส์ด้วย Scratch : ตอนที่ 5 เสียงดนตรี</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep5-make-a-music/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 4 สร้างเรื่องสั้น</title>
		<link>https://karnlab.com/scratch-ep4-make-a-story/</link>
					<comments>https://karnlab.com/scratch-ep4-make-a-story/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 02 Feb 2019 17:03:19 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Story]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[เรื่องสั้น]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1986</guid>

					<description><![CDATA[<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้าง Animation เรื่องสั้นกันครับ 🙂 ตอนนี้อาจจะยาวไปสักหน่อย น้องๆ ค่อยๆ อ่านและลองทำตามไปเรื่อยๆ นะครับ สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ https://karnlab.com/scratch-ep1-lets-start/ เลือกพื้นหลัง ที่แถบ Sprites [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep4-make-a-story/">สร้างเกมส์ด้วย Scratch : ตอนที่ 4 สร้างเรื่องสั้น</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้าง Animation เรื่องสั้นกันครับ <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ตอนนี้อาจจะยาวไปสักหน่อย น้องๆ ค่อยๆ อ่านและลองทำตามไปเรื่อยๆ นะครับ</p>
<p>สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a></p>
<h2>เลือกพื้นหลัง</h2>
<ol>
<li>ที่แถบ Sprites ข้างล่างข้อความ New Backdrop คลิกไอคอนรูปภาพ</li>
</ol>
<p><figure id="attachment_1952" aria-describedby="caption-attachment-1952" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1952" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-1.jpg" alt="Scratch - EP4 (1)" width="492" height="179" /><figcaption id="caption-attachment-1952" class="wp-caption-text">Scratch &#8211; EP4 (1)</figcaption></figure></p>
<p>จากนั้นเลือกพื้นหลังที่ต้องการ (เช่น pathway, slopes) แล้วกดปุ่ม OK – เราจะเห็นพื้นหลังที่เราเลือกปรากฏที่ Stage</p>
<p><figure id="attachment_1953" aria-describedby="caption-attachment-1953" style="width: 1319px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1953" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-2.jpg" alt="Scratch - EP4 (2)" width="1319" height="653" /><figcaption id="caption-attachment-1953" class="wp-caption-text">Scratch &#8211; EP4 (2)</figcaption></figure></p>
<p>เราจะได้ผลลัพธ์ดังนี้</p>
<p><figure id="attachment_1954" aria-describedby="caption-attachment-1954" style="width: 494px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1954" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-3.jpg" alt="Scratch - EP4 (3)" width="494" height="425" /><figcaption id="caption-attachment-1954" class="wp-caption-text">Scratch &#8211; EP4 (3)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เลือกตัวละคร</h2>
<p>Tip: น้องสามารถลบตัวละครที่ไม่ต้องการได้โดย – ที่แถบ Sprites คลิกขวาตัวละครที่ไม่ต้องการ – แล้วกดปุ่ม delete</p>
<p><figure id="attachment_1955" aria-describedby="caption-attachment-1955" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1955" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-4.jpg" alt="Scratch - EP4 (4)" width="492" height="241" /><figcaption id="caption-attachment-1955" class="wp-caption-text">Scratch &#8211; EP4 (4)</figcaption></figure></p>
<ol start="2">
<li>ที่แถบ Sprites ข้างขวาข้อความ New Sprite คลิกไอคอนตัวละคร</li>
</ol>
<p><figure id="attachment_1956" aria-describedby="caption-attachment-1956" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1956" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-5.jpg" alt="Scratch - EP4 (5)" width="492" height="180" /><figcaption id="caption-attachment-1956" class="wp-caption-text">Scratch &#8211; EP4 (5)</figcaption></figure></p>
<p>จากนั้นเลือกตัวละครที่ต้องการ (เช่น Abby หรือ Devin) – แล้วกดปุ่ม OK ครับ</p>
<p><figure id="attachment_1957" aria-describedby="caption-attachment-1957" style="width: 1318px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1957" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-6.jpg" alt="Scratch - EP4 (6)" width="1318" height="656" /><figcaption id="caption-attachment-1957" class="wp-caption-text">Scratch &#8211; EP4 (6)</figcaption></figure></p>
<p>น้องๆ ลองเพิ่มตัวละครอีก 1 ตัว &#8211; แล้วใช้เมาส์คลิกและเลื่อนตัวละครให้อยู่ในตำแหน่งที่สวยงามนะครับ</p>
<p><figure id="attachment_1958" aria-describedby="caption-attachment-1958" style="width: 718px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1958" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-7.jpg" alt="Scratch - EP4 (7)" width="718" height="598" /><figcaption id="caption-attachment-1958" class="wp-caption-text">Scratch &#8211; EP4 (7)</figcaption></figure></p>
<p>Tip: น้องสามารถเปลี่ยนขนาดของตัวละครได้โดย – ที่แถบ Scripts / Costumes / Sounds – ให้คลิกที่แถบ Costumes – จากนั้นคลิกที่ตัวละคร – คลิกลากที่มุมขวาบนเพื่อย่อขนาด</p>
<p><figure id="attachment_1959" aria-describedby="caption-attachment-1959" style="width: 717px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1959" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-8.jpg" alt="Scratch - EP4 (8)" width="717" height="419" /><figcaption id="caption-attachment-1959" class="wp-caption-text">Scratch &#8211; EP4 (8)</figcaption></figure></p>
<p><figure id="attachment_1960" aria-describedby="caption-attachment-1960" style="width: 856px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1960" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-9.jpg" alt="Scratch - EP4 (9)" width="856" height="523" /><figcaption id="caption-attachment-1960" class="wp-caption-text">Scratch &#8211; EP4 (9)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เริ่มเรื่องสั้น</h2>
<ol start="3">
<li>คลิกเลือกตัวละครที่ต้องการ (Abby) ที่แถบ Sprites – จากนั้นสร้าง Script</li>
</ol>
<p>3.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>3.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ switch backdrop to pathway / slopes ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>3.3) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – จากนั้นเปลี่ยนข้อความ จาก Hello! เป็น I want to explore!</p>
<p><figure id="attachment_1961" aria-describedby="caption-attachment-1961" style="width: 552px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1961" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-10.jpg" alt="Scratch - EP4 (10)" width="552" height="355" /><figcaption id="caption-attachment-1961" class="wp-caption-text">Scratch &#8211; EP4 (10)</figcaption></figure></p>
<p>เมื่อคลิกที่ธงสีเขียว เราจะได้ผลลัพธ์ดังภาพครับ</p>
<p><figure id="attachment_1962" aria-describedby="caption-attachment-1962" style="width: 496px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1962" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-11.jpg" alt="Scratch - EP4 (11)" width="496" height="427" /><figcaption id="caption-attachment-1962" class="wp-caption-text">Scratch &#8211; EP4 (11)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>แสดงตัวละครใหม่</h2>
<ol start="4">
<li>เพิ่มตัวละใหม่ เช่น Dragon หรือ Unicorn (วิธีเพิ่มตัวละคร ทำตามข้อ 3 ครับ)</li>
</ol>
<p><figure id="attachment_1963" aria-describedby="caption-attachment-1963" style="width: 495px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1963" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-12.jpg" alt="Scratch - EP4 (12)" width="495" height="600" /><figcaption id="caption-attachment-1963" class="wp-caption-text">Scratch &#8211; EP4 (12)</figcaption></figure></p>
<p>Tip: สำหรับวิธีการกลับด้าน/พลิกตัวละคร น้องๆ สามารถทำได้โดย – ที่แถบ Scripts / Costumes / Sounds – ให้คลิกที่แถบ Costumes – จากนั้นคลิกที่ตัวละคร – คลิกปุ่ม flip left-right ที่มุมบนขวา</p>
<p><figure id="attachment_1964" aria-describedby="caption-attachment-1964" style="width: 855px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1964" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-13.jpg" alt="Scratch - EP4 (13)" width="855" height="549" /><figcaption id="caption-attachment-1964" class="wp-caption-text">Scratch &#8211; EP4 (13)</figcaption></figure></p>
<p>Tip: สำหรับวิธีการหมุนตัวละคร น้องๆ สามารถทำได้โดย – ที่แถบ Scripts / Costumes / Sounds – ให้คลิกที่แถบ Costumes – จากนั้นคลิกที่ตัวละคร – คลิกที่จุดวงกลมด้านบน/ล่างของรูปตัวละคร – จากนั้นหมุนเมาส์ตามที่ต้องการ</p>
<p><figure id="attachment_1965" aria-describedby="caption-attachment-1965" style="width: 857px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1965" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-14.jpg" alt="Scratch - EP4 (14)" width="857" height="552" /><figcaption id="caption-attachment-1965" class="wp-caption-text">Scratch &#8211; EP4 (14)</figcaption></figure></p>
<ol start="5">
<li>เพิ่ม Script ดังต่อไปนี้ (ให้กับตัวละครใหม่)</li>
</ol>
<p>5.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>5.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ hide ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>5.3) ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ wait 2 secs ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>5.4) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ show ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>5.5) ที่แถบ Scripts ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง [ play sound pop ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1966" aria-describedby="caption-attachment-1966" style="width: 968px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1966" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-15.jpg" alt="Scratch - EP4 (15)" width="968" height="614" /><figcaption id="caption-attachment-1966" class="wp-caption-text">Scratch &#8211; EP4 (15)</figcaption></figure></p>
<p>Tip: น้องๆ สามารถเพิ่มเสียงเอฟเฟกต์ได้โดย – ที่แถบ Scripts / Costumes / Sounds – ให้คลิกที่แถบ Sounds – คลิกปุ่มลำโพง ใต้ข้อความ New Sound: &#8211; จากนั้นเลือกเสียงที่ต้องการ แล้วกดปุ่ม OK</p>
<p><figure id="attachment_1967" aria-describedby="caption-attachment-1967" style="width: 558px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1967" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-16.jpg" alt="Scratch - EP4 (16)" width="558" height="382" /><figcaption id="caption-attachment-1967" class="wp-caption-text">Scratch &#8211; EP4 (16)</figcaption></figure></p>
<p><figure id="attachment_1968" aria-describedby="caption-attachment-1968" style="width: 1317px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1968" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-17.jpg" alt="Scratch - EP4 (17)" width="1317" height="659" /><figcaption id="caption-attachment-1968" class="wp-caption-text">Scratch &#8211; EP4 (17)</figcaption></figure></p>
<p><figure id="attachment_1969" aria-describedby="caption-attachment-1969" style="width: 551px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1969" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-18.jpg" alt="Scratch - EP4 (18)" width="551" height="368" /><figcaption id="caption-attachment-1969" class="wp-caption-text">Scratch &#8211; EP4 (18)</figcaption></figure></p>
<p>&nbsp;</p>
<p>ที่แถบ Script – คำสั่ง [ play sound ] – เราก็จะสามารถเลือกเสียงที่เราเพิ่มเข้ามาได้ครับ</p>
<p><figure id="attachment_1970" aria-describedby="caption-attachment-1970" style="width: 536px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1970" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-19.jpg" alt="Scratch - EP4 (19)" width="536" height="326" /><figcaption id="caption-attachment-1970" class="wp-caption-text">Scratch &#8211; EP4 (19)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เพิ่มฉาก (1)</h2>
<ol start="6">
<li>เพิ่มฉากหลัง เช่น woods, dessert (วิธีเพิ่มพื้นหลัง ทำตามข้อ 1 ครับ)</li>
</ol>
<p><figure id="attachment_1971" aria-describedby="caption-attachment-1971" style="width: 864px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1971" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-20.jpg" alt="Scratch - EP4 (20)" width="864" height="603" /><figcaption id="caption-attachment-1971" class="wp-caption-text">Scratch &#8211; EP4 (20)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เปลี่ยนฉาก</h2>
<p>จากนั้นเราจะให้ตัวละครพูดเล็กน้อย ก่อนที่จะเปลี่ยนฉากครับ</p>
<ol start="7">
<li>เพิ่มเติม Script ให้กับ Unicorn (ต่อจากข้อที่ 5)</li>
</ol>
<p>5.6) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – เปลี่ยนคำว่า Hello! เป็น Follow me!</p>
<p>5.7) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ switch backdrop to dessert ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1972" aria-describedby="caption-attachment-1972" style="width: 1015px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1972" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-21.jpg" alt="Scratch - EP4 (21)" width="1015" height="623" /><figcaption id="caption-attachment-1972" class="wp-caption-text">Scratch &#8211; EP4 (21)</figcaption></figure></p>
<p>ลองกดปุ่มธงสีเขียว แล้วสังเกตการเปลี่ยนแปลง</p>
<p><div style="width: 492px;" class="wp-video"><video class="wp-video-shortcode" id="video-1986-1" width="492" height="428" preload="metadata" controls="controls"><source type="video/mp4" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-1.mp4?_=1" /><a href="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-1.mp4">https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-1.mp4</a></video></div></p>
<p>&nbsp;</p>
<h2>เริ่มบทสนทนา</h2>
<ol start="8">
<li>เลือกตัวละคร (เช่น Abby) – จากนั้นเพิ่ม Script ดังต่อไปนี้</li>
</ol>
<p>8.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when backdrop switches to desert ] มาที่พื้นที่ว่างด้านขวา</p>
<p>8.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – เปลี่ยนคำว่า Hello! เป็น Where are we?</p>
<p>8.3) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ broadcast message1 ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1973" aria-describedby="caption-attachment-1973" style="width: 1026px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1973" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-22.jpg" alt="Scratch - EP4 (22)" width="1026" height="604" /><figcaption id="caption-attachment-1973" class="wp-caption-text">Scratch &#8211; EP4 (22)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>พูดคุยโต้ตอบ</h2>
<ol start="9">
<li>เลือกตัวละคร (เช่น Unicorn) – จากนั้นเพิ่ม Script ดังต่อไปนี้</li>
</ol>
<p>9.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when I receive message1 ] มาที่พื้นที่ว่างด้านขวา</p>
<p>9.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – เปลี่ยนคำว่า Hello! เป็น On our way to the castle!</p>
<p><figure id="attachment_1974" aria-describedby="caption-attachment-1974" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1974" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-23.jpg" alt="Scratch - EP4 (23)" width="1040" height="621" /><figcaption id="caption-attachment-1974" class="wp-caption-text">Scratch &#8211; EP4 (23)</figcaption></figure></p>
<p>ลองกดปุ่มธงสีเขียว แล้วสังเกตการเปลี่ยนแปลง</p>
<p><div style="width: 494px;" class="wp-video"><video class="wp-video-shortcode" id="video-1986-2" width="494" height="424" preload="metadata" controls="controls"><source type="video/mp4" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-2.mp4?_=2" /><a href="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-2.mp4">https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-2.mp4</a></video></div></p>
<p>&nbsp;</p>
<h2>เคลื่อนที่</h2>
<ol start="10">
<li>ต่อไปเราจะมาลองเคลื่อนที่ตัวละคร (เช่น Unicorn) – โดยเพิ่ม Script ดังต่อไปนี้ (ต่อจากข้อที่ 9)</li>
</ol>
<p>10.1) ให้เคลื่อนที่ตัวละครไปยังตำแหน่งที่ต้องการ จากนั้น</p>
<p>10.2) ที่แถบ Scripts ให้คลิกที่คำว่า Motions (สีน้ำเงิน) – ให้ลากกล่อง [ glide 1 secs to x: ___ y: ___ ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1975" aria-describedby="caption-attachment-1975" style="width: 1042px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1975" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-24.jpg" alt="Scratch - EP4 (24)" width="1042" height="597" /><figcaption id="caption-attachment-1975" class="wp-caption-text">Scratch &#8211; EP4 (24)</figcaption></figure></p>
<p>Tip: ถ้าต้องการให้ตัวละครอยู่ในตำแหน่งเริ่มต้นเมื่อเริ่มเรื่องราว ให้เราใส่คำสั่ง [ go to x: ___ y: ___ ] ต่อจากคำสั่ง [ when Green Flag clicked ]</p>
<p><figure id="attachment_1976" aria-describedby="caption-attachment-1976" style="width: 286px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1976" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-25.jpg" alt="Scratch - EP4 (25)" width="286" height="161" /><figcaption id="caption-attachment-1976" class="wp-caption-text">Scratch &#8211; EP4 (25)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เพิ่มฉาก (2)</h2>
<ol start="11">
<li>เพิ่มฉากหลังอีก 1 ฉากครับ (เช่น castle1, castle2, castle3) (วิธีเพิ่มพื้นหลัง ทำตามข้อ 1 ครับ)</li>
</ol>
<p><figure id="attachment_1977" aria-describedby="caption-attachment-1977" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1977" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-26.jpg" alt="Scratch - EP4 (26)" width="719" height="550" /><figcaption id="caption-attachment-1977" class="wp-caption-text">Scratch &#8211; EP4 (26)</figcaption></figure></p>
<ol start="12">
<li>คลิกที่ตัวละคร (Unicorn) แล้วเพิ่ม Script ดังต่อไปนี้ครับ (ต่อจากข้อ 10.)</li>
</ol>
<p>12.1) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ switch backdrop to castle3 ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>12.2) ที่แถบ Scripts ให้คลิกที่คำว่า Motions (สีน้ำเงิน) – ให้ลากกล่อง [ go to x: ___ y: ___ ] มาต่อข้างล่างกล่องที่แล้ว – เปลี่ยนตำแหน่ง X,Y เป็น 140,-50</p>
<p><figure id="attachment_1978" aria-describedby="caption-attachment-1978" style="width: 1039px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1978" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-27.jpg" alt="Scratch - EP4 (27)" width="1039" height="592" /><figcaption id="caption-attachment-1978" class="wp-caption-text">Scratch &#8211; EP4 (27)</figcaption></figure></p>
<p>ลองกดปุ่มธงสีเขียว แล้วสังเกตการเปลี่ยนแปลง</p>
<p><div style="width: 496px;" class="wp-video"><video class="wp-video-shortcode" id="video-1986-3" width="496" height="426" preload="metadata" controls="controls"><source type="video/mp4" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-3.mp4?_=3" /><a href="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-3.mp4">https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-3.mp4</a></video></div></p>
<p>&nbsp;</p>
<h2>ปรากฏในฉาก</h2>
<ol start="13">
<li>เพิ่มวัตถุใหม่ให้กับเรื่องราวของเรา (เช่น Key, Magic Carpet)</li>
</ol>
<p><figure id="attachment_1979" aria-describedby="caption-attachment-1979" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1979" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-28.jpg" alt="Scratch - EP4 (28)" width="492" height="551" /><figcaption id="caption-attachment-1979" class="wp-caption-text">Scratch &#8211; EP4 (28)</figcaption></figure></p>
<ol start="14">
<li>1 ถ้าเราต้องการให้วัตถุหรือตัวละครปรากฏเมื่อถึงฉากใดๆ ให้น้องเขียน Script ดังนี้ครับ</li>
</ol>
<p>14.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag clicked ] มายังพื้นที่ว่างด้านขวา</p>
<p>14.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ hide ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>14.3) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when backdrop switches to castle3 ] มายังพื้นที่ว่างด้านขวา</p>
<p>14.4) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ show ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1980" aria-describedby="caption-attachment-1980" style="width: 1022px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1980" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-29.jpg" alt="Scratch - EP4 (29)" width="1022" height="592" /><figcaption id="caption-attachment-1980" class="wp-caption-text">Scratch &#8211; EP4 (29)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>โต้ตอบผู้ชม</h2>
<ol start="15">
<li>เมื่อเราคลิกที่วัตถุ (เช่น Key) จะเปลี่ยนสีได้ครับ</li>
</ol>
<p>15.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when this sprite clicked ] มายังพื้นที่ว่างด้านขวา</p>
<p>15.2) ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ repeat 10 ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>15.3) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ change color effect by 25 ] มาต่อในกล่อง [ repeat 10 ]</p>
<p><figure id="attachment_1981" aria-describedby="caption-attachment-1981" style="width: 1015px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1981" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-EP4-30.jpg" alt="Scratch - EP4 (30)" width="1015" height="593" /><figcaption id="caption-attachment-1981" class="wp-caption-text">Scratch &#8211; EP4 (30)</figcaption></figure></p>
<p>ลองกดปุ่มธงสีเขียว แล้วสังเกตการเปลี่ยนแปลง</p>
<p><div style="width: 492px;" class="wp-video"><video class="wp-video-shortcode" id="video-1986-4" width="492" height="422" preload="metadata" controls="controls"><source type="video/mp4" src="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-4.mp4?_=4" /><a href="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-4.mp4">https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-4.mp4</a></video></div></p>
<p>&nbsp;</p>
<h2>เรื่องราวที่ไม่สิ้นสุด</h2>
<p>16.</p>
<p>17.</p>
<p>18.</p>
<p>19.</p>
<p>20.</p>
<p>…..</p>
<p>น้องๆ ลองใช้จินตนาการสร้างเรื่องราวในแบบของน้องๆ เองได้เลยครับ <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h2></h2>
<p>น้องๆ สามารถติดตามสร้างเกมส์ด้วย Scratch ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>
<p>สำหรับโปรเจคทั้งหมด สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>
<p><strong>หมายเหตุ:</strong> บทเรียนนี้เขียนตอน Scratch 2.0 นะครับ ตอนนี้เป็น Scratch 3.0 แล้ว อาจจะมีบางส่วนเปลี่ยนไปบ้าง แต่คำสั่งส่วนใหญ่ยังเหมือนเดิมครับ</p>
<p>&nbsp;</p>
<p>The post <a href="https://karnlab.com/scratch-ep4-make-a-story/">สร้างเกมส์ด้วย Scratch : ตอนที่ 4 สร้างเรื่องสั้น</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep4-make-a-story/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-1.mp4" length="76187" type="video/mp4" />
<enclosure url="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-2.mp4" length="104148" type="video/mp4" />
<enclosure url="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-3.mp4" length="181934" type="video/mp4" />
<enclosure url="https://karnlab.com/wp-content/uploads/2019/02/Scratch-Preview-EP4-4.mp4" length="249620" type="video/mp4" />

			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 3 สุขสันต์วันเกิด</title>
		<link>https://karnlab.com/scratch-ep3-happy-birthday/</link>
					<comments>https://karnlab.com/scratch-ep3-happy-birthday/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 19 Jan 2019 10:13:26 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Birthday]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Happy]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[วันเกิด]]></category>
		<category><![CDATA[สุขสันต์]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1907</guid>

					<description><![CDATA[<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้าง Happy Birthday Card แบบ interactive กันครับ 🙂 สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ https://karnlab.com/scratch-ep1-lets-start/ &#160; ใส่พื้นหลัง ที่แถบ Sprites [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep3-happy-birthday/">สร้างเกมส์ด้วย Scratch : ตอนที่ 3 สุขสันต์วันเกิด</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>สวัสดีครับน้องๆ ทุกคนครับ วันนี้เราจะมาสร้าง Happy Birthday Card แบบ interactive กันครับ <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a></p>
<p>&nbsp;</p>
<h2>ใส่พื้นหลัง</h2>
<ol>
<li>ที่แถบ Sprites ข้างล่างข้อความ New Backdrop คลิกไอคอนรูปภาพ</li>
</ol>
<p><figure id="attachment_1891" aria-describedby="caption-attachment-1891" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1891" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-1.jpg" alt="Scratch - EP3 (1)" width="492" height="183" /><figcaption id="caption-attachment-1891" class="wp-caption-text">Scratch &#8211; EP3 (1)</figcaption></figure></p>
<ol start="2">
<li>จากนั้นเลือกพื้นหลังที่ต้องการ แล้วกดปุ่ม OK – เราจะเห็นพื้นหลังที่เราเลือกปรากฏที่ Stage</li>
</ol>
<p><figure id="attachment_1892" aria-describedby="caption-attachment-1892" style="width: 1322px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1892" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-2.jpg" alt="Scratch - EP3 (2)" width="1322" height="662" /><figcaption id="caption-attachment-1892" class="wp-caption-text">Scratch &#8211; EP3 (2)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เปลี่ยนสีพื้นหลัง</h2>
<ol start="3">
<li>คลิกที่แถบ Scripts – พร้อมกับเช็คว่า Stage (ที่แถบ Sprites) กำลังถูกเลือกอยู่</li>
</ol>
<p><figure id="attachment_1893" aria-describedby="caption-attachment-1893" style="width: 721px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1893" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-3.jpg" alt="Scratch - EP3 (3)" width="721" height="595" /><figcaption id="caption-attachment-1893" class="wp-caption-text">Scratch &#8211; EP3 (3)</figcaption></figure></p>
<ol start="4">
<li>เพิ่ม Scripts เปลี่ยนสีพื้นหลัง</li>
</ol>
<p>4.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when Stage clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>4.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ change color effect by 25 ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p><figure id="attachment_1894" aria-describedby="caption-attachment-1894" style="width: 1032px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1894" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-4.jpg" alt="Scratch - EP3 (4)" width="1032" height="627" /><figcaption id="caption-attachment-1894" class="wp-caption-text">Scratch &#8211; EP3 (4)</figcaption></figure></p>
<p>เมื่อเราลองคลิกที่พื้นหลังก็จะพบว่าสีเปลี่ยนไปครับ</p>
<p><figure id="attachment_1895" aria-describedby="caption-attachment-1895" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1895" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-5.jpg" alt="Scratch - EP3 (5)" width="719" height="453" /><figcaption id="caption-attachment-1895" class="wp-caption-text">Scratch &#8211; EP3 (5)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เพิ่มตัวละคร</h2>
<ol start="5">
<li>ที่แถบ Sprites ข้างขวาข้อความ New Sprite คลิกไอคอนตัวละคร</li>
</ol>
<p><figure id="attachment_1896" aria-describedby="caption-attachment-1896" style="width: 492px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1896" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-6.jpg" alt="Scratch - EP3 (6)" width="492" height="179" /><figcaption id="caption-attachment-1896" class="wp-caption-text">Scratch &#8211; EP3 (6)</figcaption></figure></p>
<p>จากนั้นเลือกตัวละครที่ต้องการ แล้วกดปุ่ม OK ครับ</p>
<p><figure id="attachment_1897" aria-describedby="caption-attachment-1897" style="width: 1331px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1897" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-7.jpg" alt="Scratch - EP3 (7)" width="1331" height="665" /><figcaption id="caption-attachment-1897" class="wp-caption-text">Scratch &#8211; EP3 (7)</figcaption></figure></p>
<p>คลิกลากตัวละครบน Stage เพื่อปรับตำแหน่งให้สวยงามครับ</p>
<p><figure id="attachment_1898" aria-describedby="caption-attachment-1898" style="width: 718px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1898" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-8.jpg" alt="Scratch - EP3 (8)" width="718" height="627" /><figcaption id="caption-attachment-1898" class="wp-caption-text">Scratch &#8211; EP3 (8)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>พูดทักทาย</h2>
<ol start="6">
<li>คลิกเลือกตัวละครที่ต้องการ (ที่แถบ Sprites) – จากนั้นสร้าง Script</li>
</ol>
<p>6.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when Green Flag clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>6.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ say Hello! for 2 secs ] มาต่อข้างล่างกล่องที่แล้ว – จากนั้นเปลี่ยนข้อความ จาก Hello! เป็น Happy Birthday!</p>
<p><figure id="attachment_1899" aria-describedby="caption-attachment-1899" style="width: 967px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1899" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-9.jpg" alt="Scratch - EP3 (9)" width="967" height="626" /><figcaption id="caption-attachment-1899" class="wp-caption-text">Scratch &#8211; EP3 (9)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เล่นดนตรี</h2>
<ol start="7">
<li>แต่งานวันเกิดจะขาดเค้กไม่ได้ เราต้องเพิ่มเค้กก่อนครับ – ที่แถบ Sprites ข้างขวาข้อความ New Sprite คลิกไอคอนตัวละคร – จากนั้นเลือกเค้กที่ต้องการ แล้วจัดตำแหน่งให้สวยงามครับ</li>
</ol>
<p><figure id="attachment_1900" aria-describedby="caption-attachment-1900" style="width: 1321px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1900" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-10.jpg" alt="Scratch - EP3 (10)" width="1321" height="664" /><figcaption id="caption-attachment-1900" class="wp-caption-text">Scratch &#8211; EP3 (10)</figcaption></figure></p>
<p><figure id="attachment_1901" aria-describedby="caption-attachment-1901" style="width: 738px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1901" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-11.jpg" alt="Scratch - EP3 (11)" width="738" height="619" /><figcaption id="caption-attachment-1901" class="wp-caption-text">Scratch &#8211; EP3 (11)</figcaption></figure></p>
<p>&nbsp;</p>
<ol start="8">
<li>เพิ่มเสียงเพลง</li>
</ol>
<p>8.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when this Sprite clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>8.2) ที่แถบ Scripts ให้คลิกที่คำว่า Sound (สีม่วง) – ให้ลากกล่อง [ play sound birthday song ] มาต่อข้างล่างกล่องที่แล้ว – ลองคลิกที่เค้ก เราจะได้ยินเพลง Happy Birthday ครับ (อย่าลืมเปิดลำโพงด้วยนะ)</p>
<p><figure id="attachment_1902" aria-describedby="caption-attachment-1902" style="width: 963px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1902" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-12.jpg" alt="Scratch - EP3 (12)" width="963" height="633" /><figcaption id="caption-attachment-1902" class="wp-caption-text">Scratch &#8211; EP3 (12)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ใส่การเคลื่อนไหว</h2>
<ol start="9">
<li>9. คลิกเลือก Sprite ที่ต้องการ จากนั้นใส่ Script ต่อไปนี้</li>
</ol>
<p>9.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when this Sprite clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>9.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ change size by 10 ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>9.3) ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>9.4) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ให้ลากกล่อง [ change size by 10 ] มาต่อข้างล่างกล่องที่แล้ว – เปลี่ยนตัวเลข จาก 10 เป็น -10</p>
<p>9.5) ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ wait 1 sec ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>ลองคลิกที่รูปเค้ก แล้วสังเกตผลลัพธ์ครับ</p>
<p><figure id="attachment_1903" aria-describedby="caption-attachment-1903" style="width: 963px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1903" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-13.jpg" alt="Scratch - EP3 (13)" width="963" height="627" /><figcaption id="caption-attachment-1903" class="wp-caption-text">Scratch &#8211; EP3 (13)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ทำซ้ำ</h2>
<ol start="10">
<li>เพื่อที่จะทำให้เค้กของเราดุ๊กดิ๊กซ้ำๆ เราต้องเพิ่มคำสั่ง repeat ครับ – ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ repeat 10 ] มาครอบคำสั่งในข้อที่ 9 – แล้วเปลี่ยนตัวเลข จาก 10 เป็น 4 (ดังภาพด้านล่าง)</li>
</ol>
<p><figure id="attachment_1904" aria-describedby="caption-attachment-1904" style="width: 956px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1904" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-14.jpg" alt="Scratch - EP3 (14)" width="956" height="621" /><figcaption id="caption-attachment-1904" class="wp-caption-text">Scratch &#8211; EP3 (14)</figcaption></figure></p>
<p>เมื่อเราคลิกที่รูปเค้ก เค้กของเราก็จะดุ๊กดิ๊กนานขึ้นจนจบเพลงครับ</p>
<p>&nbsp;</p>
<h2>หมุนรอบๆ</h2>
<ol start="11">
<li>สุดท้ายเราจะมาทำให้ตัวละครหมุนรอบตัวเองกันครับ – เลือกตัวละคร (Sprite) ที่ต้องการ จากนั้นใส่ Script ดังนี้</li>
</ol>
<p>11.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ให้ลากกล่อง [ when this Sprite clicked ] มาที่พื้นที่ว่างด้านขวา</p>
<p>11.2) ที่แถบ Scripts ให้คลิกที่คำว่า Motion (สีน้ำเงิน) – ให้ลากกล่อง [ turn right 15 degrees ] มาต่อข้างล่างกล่องที่แล้ว</p>
<p>11.3) ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ให้ลากกล่อง [ repeat 10 ] มาครอบคำสั่ง [ turn right 15 degrees ] – แล้วเปลี่ยนตัวเลข จาก repeat 10 เป็น repeat 24 (ดังภาพด้านล่าง)</p>
<p><figure id="attachment_1905" aria-describedby="caption-attachment-1905" style="width: 958px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1905" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-15.jpg" alt="Scratch - EP3 (15)" width="958" height="619" /><figcaption id="caption-attachment-1905" class="wp-caption-text">Scratch &#8211; EP3 (15)</figcaption></figure></p>
<p>เมื่อเราคลิกที่ตัวละคร ก็จะพบว่าตัวละครหมุน 360 องศาครับ</p>
<p><figure id="attachment_1906" aria-describedby="caption-attachment-1906" style="width: 495px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1906" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP3-16.jpg" alt="Scratch - EP3 (16)" width="495" height="425" /><figcaption id="caption-attachment-1906" class="wp-caption-text">Scratch &#8211; EP3 (16)</figcaption></figure></p>
<p>&nbsp;</p>
<p>น้องๆ สามารถติดตามสร้างเกมส์ด้วย Scratch ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>
<p>สำหรับโปรเจคทั้งหมด สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>
<p><strong>หมายเหตุ:</strong> บทเรียนนี้เขียนตอน Scratch 2.0 นะครับ ตอนนี้เป็น Scratch 3.0 แล้ว อาจจะมีบางส่วนเปลี่ยนไปบ้าง แต่คำสั่งส่วนใหญ่ยังเหมือนเดิมครับ</p>
<p>The post <a href="https://karnlab.com/scratch-ep3-happy-birthday/">สร้างเกมส์ด้วย Scratch : ตอนที่ 3 สุขสันต์วันเกิด</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep3-happy-birthday/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 2 – ตัวอักษรเคลื่อนไหว</title>
		<link>https://karnlab.com/scratch-ep2-animated-text/</link>
					<comments>https://karnlab.com/scratch-ep2-animated-text/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 10 Jan 2019 11:28:26 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ตัวอักษร]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[เคลื่อนไหว]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1829</guid>

					<description><![CDATA[<p>สวัสดีครับน้องๆ วันนี้เราจะมาเขียนโปรแกรมภาษา Scratch เพื่อสร้างตัวอักษรเคลื่อนไหวกันครับ สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ https://karnlab.com/scratch-ep1-lets-start/ &#160; เลือกตัวอักษร คลิกที่ไอคอนรูปตัวละคร (อยู่ที่แถบ Sprites – สังเกตที่ข้างๆ ข้อความ New Sprite) [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep2-animated-text/">สร้างเกมส์ด้วย Scratch : ตอนที่ 2 – ตัวอักษรเคลื่อนไหว</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>สวัสดีครับน้องๆ วันนี้เราจะมาเขียนโปรแกรมภาษา Scratch เพื่อสร้างตัวอักษรเคลื่อนไหวกันครับ</p>
<p>สำหรับวิธีการใช้งานโปรแกรม Scratch – น้องๆ สามารถอ่านได้ที่ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a></p>
<p>&nbsp;</p>
<h2>เลือกตัวอักษร</h2>
<ol>
<li>คลิกที่ไอคอนรูปตัวละคร (อยู่ที่แถบ Sprites – สังเกตที่ข้างๆ ข้อความ New Sprite)</li>
</ol>
<p><figure id="attachment_1814" aria-describedby="caption-attachment-1814" style="width: 527px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1814" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-1.jpg" alt="Scratch - EP2 (1)" width="527" height="219" /><figcaption id="caption-attachment-1814" class="wp-caption-text">Scratch &#8211; EP2 (1)</figcaption></figure></p>
<ol start="2">
<li>เลือก Category: Letters – เลือกตัวอักษรที่ต้องการ (จะเป็นตัวอักษรแรกของชื่อเล่น ชื่อที่ชอบ หรือ คำศัพท์ภาษาอังกฤษอะไรก็ได้ครับ)</li>
</ol>
<p><figure id="attachment_1815" aria-describedby="caption-attachment-1815" style="width: 1318px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1815" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-2.jpg" alt="Scratch - EP2 (2)" width="1318" height="655" /><figcaption id="caption-attachment-1815" class="wp-caption-text">Scratch &#8211; EP2 (2)</figcaption></figure></p>
<ol start="3">
<li>เอารูปแมวออก – ด้วยการคลิกขวาที่รูปแมว ในแถบ Sprites – จากนั้นคลิก Delete</li>
</ol>
<p><figure id="attachment_1816" aria-describedby="caption-attachment-1816" style="width: 494px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1816" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-3.jpg" alt="Scratch - EP2 (3)" width="494" height="255" /><figcaption id="caption-attachment-1816" class="wp-caption-text">Scratch &#8211; EP2 (3)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ใส่เอฟเฟกต์</h2>
<p>ต่อไป เราจะทำให้ตัวอักษรเปลี่ยนสี เมื่อเราคลิกที่ตัวอักษรนะครับ</p>
<p>4.1) ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ลากกล่องที่เขียนว่า [ when this spike clicked ] มาวางไว้ที่พื้นที่ว่างด้านขวา</p>
<p>4.2) ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ลากกล่องที่เขียนว่า [ change color effect by 25 ] มาต่อข้างล่างกล่อง [ when this spike clicked ]</p>
<p><figure id="attachment_1817" aria-describedby="caption-attachment-1817" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1817" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-4.jpg" alt="Scratch - EP2 (4)" width="1040" height="601" /><figcaption id="caption-attachment-1817" class="wp-caption-text">Scratch &#8211; EP2 (4)</figcaption></figure></p>
<p>เมื่อเราคลิกที่ตัวอักษร จะพบว่าสีเปลี่ยนไป</p>
<p>&nbsp;</p>
<h2>ใส่เสียง</h2>
<ol start="5">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ลากกล่องที่เขียนว่า [ play sound pop ] มาต่อข้างล่างกล่อง [ change color effect by 25 ]</li>
</ol>
<p><figure id="attachment_1818" aria-describedby="caption-attachment-1818" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1818" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-5.jpg" alt="Scratch - EP2 (5)" width="1040" height="600" /><figcaption id="caption-attachment-1818" class="wp-caption-text">Scratch &#8211; EP2 (5)</figcaption></figure></p>
<p>เมื่อเราคลิกที่ตัวอักษร เราจะได้ยินเสียง (อย่าลืมเปิดลำโพงด้วยนะครับ)</p>
<p>&nbsp;</p>
<p>นอกจากนี้เราสามารถเพิ่มเสียงเอฟเฟกต์เพิ่มเติมได้โดย คลิกที่แถบ Sounds – ข้างล่างข้อความ New Sound ใหคลิกไอคอนลำโพง</p>
<p><figure id="attachment_1819" aria-describedby="caption-attachment-1819" style="width: 1033px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1819" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-5-1.jpg" alt="Scratch - EP2 (5-1)" width="1033" height="594" /><figcaption id="caption-attachment-1819" class="wp-caption-text">Scratch &#8211; EP2 (5-1)</figcaption></figure></p>
<p>เลือกเสียงที่ต้องการ แล้วกดปุ่ม OK</p>
<p><figure id="attachment_1820" aria-describedby="caption-attachment-1820" style="width: 1330px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1820" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-5-2.jpg" alt="Scratch - EP2 (5-2)" width="1330" height="663" /><figcaption id="caption-attachment-1820" class="wp-caption-text">Scratch &#8211; EP2 (5-2)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ใส่พื้นหลัง</h2>
<p>ต่อไป เราจะมาใส่พื้นหลังกันครับ</p>
<p>6.1) ที่แถบ Sprites ข้างล่างข้อความ New Backdrop คลิกไอคอนรูปภาพ</p>
<p><figure id="attachment_1821" aria-describedby="caption-attachment-1821" style="width: 491px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1821" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-6-1.jpg" alt="Scratch - EP2 (6-1)" width="491" height="189" /><figcaption id="caption-attachment-1821" class="wp-caption-text">Scratch &#8211; EP2 (6-1)</figcaption></figure></p>
<p>6.2) เลือกรูปภาพที่ต้องการ แล้วกดปุ่ม OK</p>
<p><figure id="attachment_1822" aria-describedby="caption-attachment-1822" style="width: 1320px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1822" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-6-2.jpg" alt="Scratch - EP2 (6-2)" width="1320" height="659" /><figcaption id="caption-attachment-1822" class="wp-caption-text">Scratch &#8211; EP2 (6-2)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ใส่ตัวอักษรถัดไป</h2>
<ol start="7">
<li>เพิ่มตัวอักษรถัดไปครับ (ใครลืมวิธีเพิ่มตัวอักษร ให้กลับไปอ่านข้อ 1-2 ใหม่นะครับ)</li>
</ol>
<p><figure id="attachment_1823" aria-describedby="caption-attachment-1823" style="width: 1036px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1823" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-7.jpg" alt="Scratch - EP2 (7)" width="1036" height="592" /><figcaption id="caption-attachment-1823" class="wp-caption-text">Scratch &#8211; EP2 (7)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>หมุนหมุน</h2>
<p>ต่อไป เราจะเพิ่มเอฟเฟกต์ให้ตัวอักษรหมุนได้ครับ</p>
<p>8.1) ที่แถบ Sprites คลิกที่ A-GLOW – ที่แถบ Scripts คลิกคำว่า Events (สีน้ำตาล) – ลากกล่องที่เขียนว่า [ when this spike clicked ] มาวางไว้ที่พื้นที่ว่างด้านขวา</p>
<p>8.2) ที่แถบ Scripts คลิกคำว่า Motions (สีน้ำเงิน) – ลากกล่องที่เขียนว่า [ turn &#8211;&gt; 15 15 degrees ] มาต่อข้างล่างกล่อง [ when this spike clicked ]</p>
<p><figure id="attachment_1824" aria-describedby="caption-attachment-1824" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1824" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-8-2.jpg" alt="Scratch - EP2 (8-2)" width="1040" height="593" /><figcaption id="caption-attachment-1824" class="wp-caption-text">Scratch &#8211; EP2 (8-2)</figcaption></figure></p>
<p>เมื่อเราคลิกที่ตัวอักษร ก็จะหมุนไปทางขวาครั้งละ 15 องศาครับ</p>
<p>&nbsp;</p>
<p>แล้วถ้าเราต้องการให้ตัวอักษรหมุน 360 องศา ?</p>
<p>8.3) ที่แถบ Scripts คลิกคำว่า Controls (สีส้ม) – ลากกล่องที่เขียนว่า [ repeat 10 ] มาครอบกล่อง [turn &#8211;&gt; 15 15 degrees ] – จากนั้นเปลี่ยนค่าเป็น [ repeat 24 ] – เมื่อเราคลิกที่ตัวอักษร ก็จะหมุนครบ 1 รอบพอดีครับ</p>
<p><figure id="attachment_1825" aria-describedby="caption-attachment-1825" style="width: 1030px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1825" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-8-3.jpg" alt="Scratch - EP2 (8-3)" width="1030" height="597" /><figcaption id="caption-attachment-1825" class="wp-caption-text">Scratch &#8211; EP2 (8-3)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ใส่ตัวอักษรให้ครบ</h2>
<p>สุดท้าย เพิ่มตัวอักษรให้ครบครับ</p>
<p><figure id="attachment_1826" aria-describedby="caption-attachment-1826" style="width: 1034px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1826" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-8-5.jpg" alt="Scratch - EP2 (8-5)" width="1034" height="592" /><figcaption id="caption-attachment-1826" class="wp-caption-text">Scratch &#8211; EP2 (8-5)</figcaption></figure></p>
<p>&nbsp;</p>
<p>ก่อนจากกัน เราจะเพิ่มเทคนิค/เอฟเฟกต์กันอีกนิดครับ</p>
<ol start="9">
<li>เปลี่ยนขนาดตัวอักษร – ให้น้องๆ ลองลากกล่องคำสั่งตามรูปภาพข้างล่างนะครับ แล้วลองสังเกตผลลัพธ์</li>
</ol>
<p><figure id="attachment_1827" aria-describedby="caption-attachment-1827" style="width: 1034px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1827" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-9.jpg" alt="Scratch - EP2 (9)" width="1034" height="597" /><figcaption id="caption-attachment-1827" class="wp-caption-text">Scratch &#8211; EP2 (9)</figcaption></figure></p>
<p>&nbsp;</p>
<ol start="10">
<li>ตัวอักษรเคลื่อนที่ &#8211; ให้น้องๆ ลองลากกล่องคำสั่งตามรูปภาพข้างล่างนะครับ แล้วลองสังเกตผลลัพธ์</li>
</ol>
<p><figure id="attachment_1828" aria-describedby="caption-attachment-1828" style="width: 1035px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1828" src="https://karnlab.com/wp-content/uploads/2019/01/Scratch-EP2-10.jpg" alt="Scratch - EP2 (10)" width="1035" height="593" /><figcaption id="caption-attachment-1828" class="wp-caption-text">Scratch &#8211; EP2 (10)</figcaption></figure></p>
<p>&nbsp;</p>
<p>น้องๆ สามารถติดตามสร้างเกมส์ด้วย Scratch ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>
<p>สำหรับโปรเจคทั้งหมด สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>
<p><strong>หมายเหตุ:</strong> บทเรียนนี้เขียนตอน Scratch 2.0 นะครับ ตอนนี้เป็น Scratch 3.0 แล้ว อาจจะมีบางส่วนเปลี่ยนไปบ้าง แต่คำสั่งส่วนใหญ่ยังเหมือนเดิมครับ</p>
<p>&nbsp;</p>
<p>The post <a href="https://karnlab.com/scratch-ep2-animated-text/">สร้างเกมส์ด้วย Scratch : ตอนที่ 2 – ตัวอักษรเคลื่อนไหว</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep2-animated-text/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 1 &#8211; เริ่มต้นเขียนโปรแกรมภาษา Scratch</title>
		<link>https://karnlab.com/scratch-ep1-lets-start/</link>
					<comments>https://karnlab.com/scratch-ep1-lets-start/#comments</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 24 Dec 2018 12:05:46 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[เริ่มต้น]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1640</guid>

					<description><![CDATA[<p>วิธีใช้งานโปรแกรม [สำหรับ Scratch 3.0] &#8211; น้องๆ สามารถเขียนโปรแกรม โดยเข้าไปที่เว็บไซต์ https://scratch.mit.edu/create ได้เลย หรือ ถ้าต้องการลงโปรแกรมในคอมพิวเตอร์ของเรา สามารถดาวน์โหลดโปรแกรมเวอร์ชันล่าสุดได้ที่ https://scratch.mit.edu/download [สำหรับ Scratch 2.0] &#8211; น้องๆ ต้องดาวน์โหลดโปรแกรมเวอร์ชัน [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep1-lets-start/">สร้างเกมส์ด้วย Scratch : ตอนที่ 1 &#8211; เริ่มต้นเขียนโปรแกรมภาษา Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>วิธีใช้งานโปรแกรม</h2>
<p>[สำหรับ Scratch 3.0] &#8211; น้องๆ สามารถเขียนโปรแกรม โดยเข้าไปที่เว็บไซต์ <a href="https://scratch.mit.edu/create">https://scratch.mit.edu/create</a> ได้เลย หรือ ถ้าต้องการลงโปรแกรมในคอมพิวเตอร์ของเรา สามารถดาวน์โหลดโปรแกรมเวอร์ชันล่าสุดได้ที่ <a href="https://scratch.mit.edu/download">https://scratch.mit.edu/download</a></p>
<p>[สำหรับ Scratch 2.0] &#8211; น้องๆ ต้องดาวน์โหลดโปรแกรมเวอร์ชัน 2.0 จากที่นี่ <a href="https://scratch.mit.edu/download/scratch2">https://scratch.mit.edu/download/scratch2</a> แล้วติดตั้วลงในคอมพิวเตอร์ก่อนนะครับ</p>
<ul>
<li>วิธีติดตั้ง Scratch 2.0 ลงในคอมพิวเตอร์ &#8211; เร็วๆ นี้</li>
</ul>
<p>&nbsp;</p>
<p>กรณีใช้งานโปรแกรมผ่านเว็บไซต์ แนะนำให้สมัครสมาชิกก่อน เพราะจะสามารถบันทึกโปรแกรมไว้แก้ไขในภายหลังและแชร์โปรแกรมให้เพื่อนๆ ได้ครับ</p>
<ul>
<li><a href="https://karnlab.com/how-to-join-scratch/">วิธีสมัครสมาชิกเว็บไซต์เพื่อใช้งานโปรแกรม Scratch</a></li>
</ul>
<p>เนื่องจากบทเรียนนี้ใช้ Scratch เวอร์ชันภาษาอังกฤษ ดังนั้นหาก Web Browser ของน้องๆ แสดงผลเป็นภาษาไทย สามารถเปลี่ยนภาษาไทยเป็นภาษาอังกฤษได้ดังนี้ครับ</p>
<ul>
<li><a href="https://karnlab.com/scratch-how-to-change-language/">วิธีเปลี่ยนภาษา (ไทย-อังกฤษ) บนโปรแกรม Scratch</a></li>
</ul>
<p>&nbsp;</p>
<h2>เริ่มต้นเขียนโปรแกรม</h2>
<p>เข้าไปที่ <a href="https://scratch.mit.edu/projects/editor/">https://scratch.mit.edu/projects/editor/</a> เราจะเห็นหน้าตาโปรแกรมแบบนี้ครับ</p>
<p><figure id="attachment_1615" aria-describedby="caption-attachment-1615" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1615" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-1.jpg" alt="Scratch - EP1 (1)" width="1366" height="651" /><figcaption id="caption-attachment-1615" class="wp-caption-text">Scratch &#8211; EP1 (1)</figcaption></figure></p>
<p>ไม่ต้องเสียเวลา&#8230; เรามาเริ่มเขียนโปรแกรมแรกกันเลย (จะทยอยอธิบายส่วนประกอบของโปรแกรมไปพร้อมๆ กับการเขียนโปรแกรมนะครับ)</p>
<p>&nbsp;</p>
<h2>เริ่มเคลื่อนไหว</h2>
<ol>
<li>ลากกล่องที่เขียนว่า [ move 10 steps ] มาที่พื้นที่ว่างด้านขวา</li>
</ol>
<p><figure id="attachment_1616" aria-describedby="caption-attachment-1616" style="width: 1045px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1616" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-2.jpg" alt="Scratch - EP1 (2)" width="1045" height="628" /><figcaption id="caption-attachment-1616" class="wp-caption-text">Scratch &#8211; EP1 (2)</figcaption></figure></p>
<ol start="2">
<li>เมื่อเราลองคลิกกล่องนี้ จะพบว่าน้องแมวส้มเคลื่อนที่ไปทางขวา (ทีละ 10 pixels)</li>
</ol>
<p>&nbsp;</p>
<h2>เพิ่มเสียง</h2>
<ol start="3">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Sound (สีม่วง) – ลากกล่องที่เขียนว่า [ play drum … ] นำมาต่อข้างล่างกล่อง [ move … ]</li>
</ol>
<p><figure id="attachment_1617" aria-describedby="caption-attachment-1617" style="width: 1039px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1617" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-3.jpg" alt="Scratch - EP1 (3)" width="1039" height="622" /><figcaption id="caption-attachment-1617" class="wp-caption-text">Scratch &#8211; EP1 (3)</figcaption></figure></p>
<ol start="4">
<li>ลองคลิกที่กล่อง [ play drum … ] เราจะได้ยินเสียงกลอง (อย่าลืมเปิดลำโพงก่อนนะ!)</li>
</ol>
<p><figure id="attachment_1618" aria-describedby="caption-attachment-1618" style="width: 1039px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1618" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-4.jpg" alt="Scratch - EP1 (4)" width="1039" height="626" /><figcaption id="caption-attachment-1618" class="wp-caption-text">Scratch &#8211; EP1 (4)</figcaption></figure></p>
<p>เพิ่มเติม:</p>
<ul>
<li>ภายในแถบ Scripts จะรวบรวมคำสั่งที่ใช้ในการควบคุมและแสดงผลโปรแกรมทั้งหมด แบ่งได้เป็น 10 ประเภท</li>
<li>คำสั่งประเภท Motion ทำหน้าที่แสดงผลการเคลื่อนที่และการหมุนของตัวละคร/วัตถุ</li>
<li>คำสั่งประเภท Looks ทำหน้าที่แสดงผลตัวละคร/วัตถุ แสดงคำพูด เปลี่ยนสี เปลี่ยนขนาด</li>
<li>คำสั่งประเภท Sounds ทำหน้าที่แสดงผลด้านเสียง</li>
</ul>
<p>&nbsp;</p>
<h2>เต้น เต้น</h2>
<ol start="5">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Motion (สีน้ำเงิน) – ลากกล่องที่เขียนว่า [ move … ] นำมาต่อข้างล่างกล่อง [ play drum … ] – จากนั้นเปลี่ยนตัวเลข 10 เป็น -10 (โดยการ double-click แล้วพิมพ์ค่าใหม่)</li>
</ol>
<p><figure id="attachment_1619" aria-describedby="caption-attachment-1619" style="width: 1042px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1619" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-5.jpg" alt="Scratch - EP1 (5)" width="1042" height="627" /><figcaption id="caption-attachment-1619" class="wp-caption-text">Scratch &#8211; EP1 (5)</figcaption></figure></p>
<p>&nbsp;</p>
<ol start="6">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Sounds (สีม่วง) – ลากกล่องที่เขียนว่า [ play drum … ] นำมาต่อข้างล่างกล่อง [ move … ] – จากนั้นลองเปลี่ยนรูปแบบเสียงกลอง โดยคลิกที่เลข 1 แล้วเลือกเสียงที่ชอบ</li>
</ol>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1620" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-6.jpg" alt="Scratch - EP1 (6)" width="1039" height="625" /></p>
<p>&nbsp;</p>
<ol start="7">
<li>ลองคลิกที่กล่องคำสั่ง เราจะพบว่าน้องแมวส้มของเราเริ่มเต้นพร้อมกับเสียงกลองแล้ว</li>
</ol>
<p><figure id="attachment_1621" aria-describedby="caption-attachment-1621" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1621" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-7.jpg" alt="Scratch - EP1 (7)" width="1040" height="624" /><figcaption id="caption-attachment-1621" class="wp-caption-text">Scratch &#8211; EP1 (7)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เต้นอีก เต้นอีก</h2>
<ol start="8">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Control (สีส้ม) – ลากกล่องที่เขียนว่า [ repeat 10 ] นำมาครอบกล่องคำสั่งเดิมของเราครับ – จากนั้นลองคลิกที่กล่อง จะพบว่าน้องแมวเต้นซ้ำกัน 10 ครั้งครับ</li>
</ol>
<p><figure id="attachment_1622" aria-describedby="caption-attachment-1622" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1622" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-8.jpg" alt="Scratch - EP1 (8)" width="1040" height="625" /><figcaption id="caption-attachment-1622" class="wp-caption-text">Scratch &#8211; EP1 (8)</figcaption></figure></p>
<p>เพิ่มเติม:</p>
<ul>
<li>ภายในแถบ Scripts จะรวบรวมคำสั่งที่ใช้ในการควบคุมและแสดงผลโปรแกรมทั้งหมด แบ่งได้เป็น 10 ประเภท</li>
<li>คำสั่งประเภท Control ทำหน้าที่ควบคุมขั้นตอนการทำงานของโปรแกรม (เช่น เงื่อนไข ทำซ้ำ เป็นต้น)</li>
<li>คำสั่งประเภท Events ทำหน้าที่ดูแลเหตุการณ์ต่างๆ ที่เกิดขึ้นกับโปรแกรม (เช่น เมื่อมีการกดปุ่มธงสีเขียว เมื่อมีการกดแป้นพิมพ์ เมื่อได้รับข้อความ เป็นต้น)</li>
</ul>
<p>&nbsp;</p>
<h2>พูดอะไรสักหน่อย</h2>
<ol start="9">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ลากกล่องที่เขียนว่า [ Say Hello! for 2 secs ] นำมาต่อบนกล่อง [ repeat 10 ] – จากนั้นลองคลิกที่กล่อง จะพบว่าน้องแมวของเราพูดคำว่า Hello! เป็นเวลา 2 วินาที ก่อนที่จะเต้นครับ</li>
</ol>
<p><figure id="attachment_1623" aria-describedby="caption-attachment-1623" style="width: 1044px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1623" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-9.jpg" alt="Scratch - EP1 (9)" width="1044" height="623" /><figcaption id="caption-attachment-1623" class="wp-caption-text">Scratch &#8211; EP1 (9)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>ธงสีเขียว</h2>
<ol start="10">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – ลากกล่องที่เขียนว่า [ when _ clicked ] นำมาต่อบนกล่อง [ Say Hello … ] – จากนั้นให้คลิกปุ่มธงสีเขียว (ข้างๆ ปุ่มแปดเหลี่ยมสีแดง) – จะพบว่าน้องแมวของเราพูดคำว่า Hello! เป็นเวลา 2 วินาที ก่อนที่จะเต้น (เหมือนในข้อ 9)</li>
</ol>
<p><figure id="attachment_1624" aria-describedby="caption-attachment-1624" style="width: 1040px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1624" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-10.jpg" alt="Scratch - EP1 (10)" width="1040" height="623" /><figcaption id="caption-attachment-1624" class="wp-caption-text">Scratch &#8211; EP1 (10)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เปลี่ยนสี</h2>
<ol start="11">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Looks (สีม่วง) – ลากกล่องที่เขียนว่า [ change color effect by 25 ] นำมาวางไว้ที่พื้นที่ว่าง – ลองกดที่กล่องดังกล่าว จะพบว่าน้องแมวสีส้มเปลี่ยนเป็นสีเขียว</li>
</ol>
<p><figure id="attachment_1625" aria-describedby="caption-attachment-1625" style="width: 1042px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1625" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-11.jpg" alt="Scratch - EP1 (11)" width="1042" height="625" /><figcaption id="caption-attachment-1625" class="wp-caption-text">Scratch &#8211; EP1 (11)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>กดปุ่มบนคีย์บอร์ด</h2>
<ol start="12">
<li>ที่แถบ Scripts ให้คลิกที่คำว่า Events (สีน้ำตาล) – จากนั้นลากกล่องที่เขียนว่า [ when space key pressed ] นำมาวางบนกล่อง [ change color effect by 25 ] – ลองกดปุ่ม spacebar บนคีย์บอร์ด จะพบว่าน้องแมวเปลี่ยนสี</li>
</ol>
<p><figure id="attachment_1626" aria-describedby="caption-attachment-1626" style="width: 1042px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1626" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-12.jpg" alt="Scratch - EP1 (12)" width="1042" height="619" /><figcaption id="caption-attachment-1626" class="wp-caption-text">Scratch &#8211; EP1 (12)</figcaption></figure></p>
<p>เราสามารถเปลี่ยนจากปุ่ม spacebar เป็นปุ่มอื่นๆ ก็ได้ครับ (โดยการคลิกที่คำว่า space ที่กล่อง when ___ key pressed )</p>
<p><figure id="attachment_1627" aria-describedby="caption-attachment-1627" style="width: 1039px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1627" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-13.jpg" alt="Scratch - EP1 (13)" width="1039" height="625" /><figcaption id="caption-attachment-1627" class="wp-caption-text">Scratch &#8211; EP1 (13)</figcaption></figure></p>
<p>เพิ่มเติม:</p>
<ul>
<li>การเริ่มต้นทำงานของโปรแกรมมักจะเกิดจากเหตุการณ์ต่างๆ เช่น เมื่อกดปุ่มธงสีเขียว หรือ กดปุ่ม spacebar เป็นต้น</li>
<li>ลำดับการทำงานของโปรแกรมจะเป็นแบบบนลงล่าง คือ ทำงานคำสั่งที่อยู่ข้างบนก่อน แล้วทำงานตามลำดับลงมาข้างล่างเรื่อยๆ</li>
</ul>
<p>แต่ถ้ามีการใส่ตัวควบคุมการทำงานซ้ำ หรือ การทำงานตามเงื่อนไข ลำดับการทำงานของโปรแกรมก็จะเปลี่ยนไปตามที่กำหนด</p>
<p>&nbsp;</p>
<h2>เปลี่ยนพื้นหลัง</h2>
<ol start="14">
<li>เราสามารถเปลี่ยนรูปภาพพื้นหลังได้โดย – ไปที่แถบ Sprites สังเกตที่ข้างล่างข้อความ New Backdrop กดปุ่มรูปภาพ</li>
</ol>
<p><figure id="attachment_1628" aria-describedby="caption-attachment-1628" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1628" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-14.jpg" alt="Scratch - EP1 (14)" width="1366" height="651" /><figcaption id="caption-attachment-1628" class="wp-caption-text">Scratch &#8211; EP1 (14)</figcaption></figure></p>
<ol start="15">
<li>จะปรากฏหน้าต่างให้เราเลือกรูปภาพที่ต้องการ</li>
</ol>
<p><figure id="attachment_1629" aria-describedby="caption-attachment-1629" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1629" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-15.jpg" alt="Scratch - EP1 (15)" width="1366" height="647" /><figcaption id="caption-attachment-1629" class="wp-caption-text">Scratch &#8211; EP1 (15)</figcaption></figure></p>
<ol start="16">
<li>เมื่อเลือกรูปภาพแล้วกดปุ่ม OK – จากพื้นหลังสีขาวจะเปลี่ยนเป็นพื้นหลังที่เราต้องการ</li>
</ol>
<p><figure id="attachment_1630" aria-describedby="caption-attachment-1630" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1630" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-16.jpg" alt="Scratch - EP1 (16)" width="1366" height="599" /><figcaption id="caption-attachment-1630" class="wp-caption-text">Scratch &#8211; EP1 (16)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>เพิ่มตัวละคร</h2>
<ol start="17">
<li>เราสามารถเพิ่มตัวละครได้โดย – ไปที่แถบ Sprites สังเกตที่ข้างๆ ข้อความ New Sprite กดปุ่ม รูปตัวละคร</li>
</ol>
<p><figure id="attachment_1631" aria-describedby="caption-attachment-1631" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1631" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-17.jpg" alt="Scratch - EP1 (17)" width="1366" height="651" /><figcaption id="caption-attachment-1631" class="wp-caption-text">Scratch &#8211; EP1 (17)</figcaption></figure></p>
<ol start="18">
<li>จะปรากฏหน้าต่างให้เราเลือกรูปตัวละครที่ต้องการ</li>
</ol>
<p><figure id="attachment_1632" aria-describedby="caption-attachment-1632" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1632" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-18.jpg" alt="Scratch - EP1 (18)" width="1366" height="647" /><figcaption id="caption-attachment-1632" class="wp-caption-text">Scratch &#8211; EP1 (18)</figcaption></figure></p>
<ol start="19">
<li>เมื่อเลือกรูปตัวละครแล้วกดปุ่ม OK – จะปรากฏตัวละครใหม่</li>
</ol>
<p><figure id="attachment_1633" aria-describedby="caption-attachment-1633" style="width: 1042px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1633" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-19.jpg" alt="Scratch - EP1 (19)" width="1042" height="629" /><figcaption id="caption-attachment-1633" class="wp-caption-text">Scratch &#8211; EP1 (19)</figcaption></figure></p>
<ol start="20">
<li>น้องๆ ลองเพิ่มคำสั่งดังต่อไปนี้ให้กับตัวละครใหม่ – ลองกดปุ่มธงสีเขียวแล้วสังเกตการทำงานของโปรแกรมนะครับ</li>
</ol>
<p><figure id="attachment_1634" aria-describedby="caption-attachment-1634" style="width: 1039px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1634" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-20.jpg" alt="Scratch - EP1 (20)" width="1039" height="626" /><figcaption id="caption-attachment-1634" class="wp-caption-text">Scratch &#8211; EP1 (20)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>วิธีการบันทึกโปรเจค (สำหรับเว็บไซต์)</h2>
<p>น้องๆ สามารถตั้งชื่อโปรเจคได้โดยเปลี่ยนชื่อที่กล่องข้อความ (แถวๆ ปุ่มธงสีเขียว)</p>
<p><figure id="attachment_1635" aria-describedby="caption-attachment-1635" style="width: 1036px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1635" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-21.jpg" alt="Scratch - EP1 (21)" width="1036" height="626" /><figcaption id="caption-attachment-1635" class="wp-caption-text">Scratch &#8211; EP1 (21)</figcaption></figure></p>
<p>น้องๆ สามารถบันทึกโปรเจคได้โดยกดปุ่ม File ที่เมนูด้านบน จากนั้นกดปุ่ม Save Now</p>
<p><figure id="attachment_1636" aria-describedby="caption-attachment-1636" style="width: 1029px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1636" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-22.jpg" alt="Scratch - EP1 (22)" width="1029" height="620" /><figcaption id="caption-attachment-1636" class="wp-caption-text">Scratch &#8211; EP1 (22)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>วิธีการบันทึกโปรเจค (สำหรับโปรแกรม)</h2>
<p>(เร็วๆ นี้)</p>
<p>&nbsp;</p>
<h2>วิธีการแชร์โปรเจค</h2>
<p>น้องๆ สามารถแชร์โปรเจคได้โดยกดปุ่ม Share ที่มุมบนขวาบน</p>
<p><figure id="attachment_1637" aria-describedby="caption-attachment-1637" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1637" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-23.jpg" alt="Scratch - EP1 (23)" width="1366" height="624" /><figcaption id="caption-attachment-1637" class="wp-caption-text">Scratch &#8211; EP1 (23)</figcaption></figure></p>
<p>&nbsp;</p>
<h2>วิธีดูโปรเจคของเรา</h2>
<p>น้องๆ สามารถเข้าไปดู Project ของเราทั้งหมดได้โดยเข้าไปที่นี่ครับ <a href="https://scratch.mit.edu/mystuff">https://scratch.mit.edu/mystuff</a></p>
<p><figure id="attachment_1638" aria-describedby="caption-attachment-1638" style="width: 976px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1638" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-24.jpg" alt="Scratch - EP1 (24)" width="976" height="651" /><figcaption id="caption-attachment-1638" class="wp-caption-text">Scratch &#8211; EP1 (24)</figcaption></figure></p>
<p>เมื่อน้องๆ คลิกเข้าไปดูโปรเจคที่ต้องการ สามารถกดปุ่ม See Inside เพื่อเข้าไปแก้ไขโปรแกรมได้ครับ หรือกดปุ่ม Share ให้เพื่อนๆ เห็นโปรเจคของเราก็ได้ครับ</p>
<p><figure id="attachment_1639" aria-describedby="caption-attachment-1639" style="width: 973px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1639" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP1-25.jpg" alt="Scratch - EP1 (25)" width="973" height="644" /><figcaption id="caption-attachment-1639" class="wp-caption-text">Scratch &#8211; EP1 (25)</figcaption></figure></p>
<p>น้องๆ สามารถติดตามบทเรียน Scratch ตอนต่อไปได้ที่นี่ครับ <a href="https://karnlab.com/tag/scratch/">https://karnlab.com/tag/scratch/</a></p>
<p>สำหรับโปรเจคทั้งหมด สามารถเข้าไปเยี่ยมชมได้ที่นี่ครับ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>
<p>The post <a href="https://karnlab.com/scratch-ep1-lets-start/">สร้างเกมส์ด้วย Scratch : ตอนที่ 1 &#8211; เริ่มต้นเขียนโปรแกรมภาษา Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep1-lets-start/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>วิธีเปลี่ยนภาษา (ไทย-อังกฤษ) บนโปรแกรม Scratch</title>
		<link>https://karnlab.com/scratch-how-to-change-language/</link>
					<comments>https://karnlab.com/scratch-how-to-change-language/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 24 Dec 2018 08:35:48 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[เปลี่ยนภาษา]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1609</guid>

					<description><![CDATA[<p>ถ้าเปิดโปรแกรม Scratch แล้วพบว่าภาษาตั้งต้นไม่ใช่ภาษาที่เราต้องการ (เช่น ต้องการใช้ภาษาอังกฤษ แต่ Web Browser แสดงผลภาษาไทย) ไม่ต้องตกใจครับ เราสามารถเปลี่ยนภาษาแสดงผลของ Scratch ได้ดังนี้ ขั้นตอนที่ 1 – ในหน้าเว็บไซต์ Scratch (หน้าไหนก็ได้) เลื่อนหน้าจอลงมาด้านล่างสุด [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-how-to-change-language/">วิธีเปลี่ยนภาษา (ไทย-อังกฤษ) บนโปรแกรม Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>ถ้าเปิดโปรแกรม Scratch แล้วพบว่าภาษาตั้งต้นไม่ใช่ภาษาที่เราต้องการ (เช่น ต้องการใช้ภาษาอังกฤษ แต่ Web Browser แสดงผลภาษาไทย)</p>
<p><figure id="attachment_1605" aria-describedby="caption-attachment-1605" style="width: 984px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1605" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-How-to-Change-Language-1.jpg" alt="Scratch - How to Change Language (1)" width="984" height="592" /><figcaption id="caption-attachment-1605" class="wp-caption-text">Scratch &#8211; How to Change Language (1)</figcaption></figure></p>
<p>ไม่ต้องตกใจครับ เราสามารถเปลี่ยนภาษาแสดงผลของ Scratch ได้ดังนี้</p>
<p>ขั้นตอนที่ 1 – ในหน้าเว็บไซต์ Scratch (หน้าไหนก็ได้) เลื่อนหน้าจอลงมาด้านล่างสุด – เราจะพบกล่องข้อความภาษา</p>
<p><figure id="attachment_1606" aria-describedby="caption-attachment-1606" style="width: 987px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1606" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-How-to-Change-Language-2.jpg" alt="Scratch - How to Change Language (2)" width="987" height="612" /><figcaption id="caption-attachment-1606" class="wp-caption-text">Scratch &#8211; How to Change Language (2)</figcaption></figure></p>
<p>ขั้นตอนที่ 2 – คลิกที่กล่องแสดงผลภาษา – เลือกภาษาที่ต้องการ</p>
<p><figure id="attachment_1607" aria-describedby="caption-attachment-1607" style="width: 976px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1607" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-How-to-Change-Language-3.jpg" alt="Scratch - How to Change Language (3)" width="976" height="616" /><figcaption id="caption-attachment-1607" class="wp-caption-text">Scratch &#8211; How to Change Language (3)</figcaption></figure></p>
<p>เพียงเท่านี้ Scratch ก็จะแสดงผลในภาษาที่เราต้องการแล้วครับ</p>
<p><figure id="attachment_1608" aria-describedby="caption-attachment-1608" style="width: 970px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1608" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-How-to-Change-Language-4.jpg" alt="Scratch - How to Change Language (4)" width="970" height="593" /><figcaption id="caption-attachment-1608" class="wp-caption-text">Scratch &#8211; How to Change Language (4)</figcaption></figure></p>
<p>The post <a href="https://karnlab.com/scratch-how-to-change-language/">วิธีเปลี่ยนภาษา (ไทย-อังกฤษ) บนโปรแกรม Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-how-to-change-language/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>วิธีสมัครสมาชิกเว็บไซต์เพื่อใช้งานโปรแกรม Scratch</title>
		<link>https://karnlab.com/how-to-join-scratch/</link>
					<comments>https://karnlab.com/how-to-join-scratch/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 24 Dec 2018 07:42:10 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Join]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Register]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[สมัครสมาชิก]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1601</guid>

					<description><![CDATA[<p>การสมัครสมาชิกเว็บไซต์ Scratch จะทำให้เราสามารถบันทึกโปรเจค (Save Project) เพื่อแก้ไขโปรแกรมในภายหลังหรือแชร์ต่อให้เพื่อนๆ ได้ครับ โดยมีวิธีง่ายๆ ดังนี้ ขั้นตอนที่ 1 – เข้าไปที่เว็บไซต์ https://scratch.mit.edu/ &#8211; จากนั้นกดปุ่ม Join Scratch ขั้นตอนที่ 2 [&#8230;]</p>
<p>The post <a href="https://karnlab.com/how-to-join-scratch/">วิธีสมัครสมาชิกเว็บไซต์เพื่อใช้งานโปรแกรม Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>การสมัครสมาชิกเว็บไซต์ Scratch จะทำให้เราสามารถบันทึกโปรเจค (Save Project) เพื่อแก้ไขโปรแกรมในภายหลังหรือแชร์ต่อให้เพื่อนๆ ได้ครับ โดยมีวิธีง่ายๆ ดังนี้</p>
<p>ขั้นตอนที่ 1 – เข้าไปที่เว็บไซต์ <a href="https://scratch.mit.edu/">https://scratch.mit.edu/</a> &#8211; จากนั้นกดปุ่ม Join Scratch</p>
<p><figure id="attachment_1591" aria-describedby="caption-attachment-1591" style="width: 976px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1591" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-1.jpg" alt="How to Join Scratch (1)" width="976" height="635" /><figcaption id="caption-attachment-1591" class="wp-caption-text">How to Join Scratch (1)</figcaption></figure></p>
<p>ขั้นตอนที่ 2 – กรอกข้อมูล Username (เป็นภาษาอังกฤษ) และ Password – จากนั้นกดปุ่ม Next</p>
<p><figure id="attachment_1592" aria-describedby="caption-attachment-1592" style="width: 965px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1592" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-2.jpg" alt="How to Join Scratch (2)" width="965" height="629" /><figcaption id="caption-attachment-1592" class="wp-caption-text">How to Join Scratch (2)</figcaption></figure></p>
<p>ขั้นตอนที่ 3 – กรอกข้อมูล เดือน/ปีเกิด เพศ และ ประเทศ – จากนั้นกดปุ่ม Next</p>
<p><figure id="attachment_1593" aria-describedby="caption-attachment-1593" style="width: 967px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1593" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-3.jpg" alt="How to Join Scratch (3)" width="967" height="625" /><figcaption id="caption-attachment-1593" class="wp-caption-text">How to Join Scratch (3)</figcaption></figure></p>
<p>ขั้นตอนที่ 4 – กรอกอีเมล (ต้องเป็นอีเมลที่มีอยู่จริง) – จากนั้นกดปุ่ม Next</p>
<p><figure id="attachment_1594" aria-describedby="caption-attachment-1594" style="width: 976px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1594" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-4.jpg" alt="How to Join Scratch (4)" width="976" height="627" /><figcaption id="caption-attachment-1594" class="wp-caption-text">How to Join Scratch (4)</figcaption></figure></p>
<p>ขั้นตอนที่ 5 – ระบบจะส่งอีเมลยืนยันไปที่อีเมลแอดเดรสที่เราระบุ – ตรวจสอบอีเมลที่ได้รับ</p>
<p><figure id="attachment_1595" aria-describedby="caption-attachment-1595" style="width: 969px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1595" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-5.jpg" alt="How to Join Scratch (5)" width="969" height="623" /><figcaption id="caption-attachment-1595" class="wp-caption-text">How to Join Scratch (5)</figcaption></figure></p>
<p>ขั้นตอนที่ 6 – ในอีเมล ให้กดปุ่มหรือลิงค์ เพื่อยืนยันตัวตน</p>
<p><figure id="attachment_1600" aria-describedby="caption-attachment-1600" style="width: 631px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1600" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-6-1.jpg" alt="How to Join Scratch (6)" width="631" height="624" /><figcaption id="caption-attachment-1600" class="wp-caption-text">How to Join Scratch (6)</figcaption></figure></p>
<p>เราก็จะสามารถใช้งาน Scartch ได้ตามปกติ และสามารถบันทึกโปรแกรมแชร์โปรแกรมได้ครับ</p>
<p><figure id="attachment_1597" aria-describedby="caption-attachment-1597" style="width: 970px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1597" src="https://karnlab.com/wp-content/uploads/2018/12/How-to-Join-Scratch-7.jpg" alt="How to Join Scratch (7)" width="970" height="487" /><figcaption id="caption-attachment-1597" class="wp-caption-text">How to Join Scratch (7)</figcaption></figure></p>
<p>The post <a href="https://karnlab.com/how-to-join-scratch/">วิธีสมัครสมาชิกเว็บไซต์เพื่อใช้งานโปรแกรม Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/how-to-join-scratch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>สร้างเกมส์ด้วย Scratch : ตอนที่ 0 &#8211; รู้จักภาษา Scratch</title>
		<link>https://karnlab.com/scratch-ep0-intro/</link>
					<comments>https://karnlab.com/scratch-ep0-intro/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 16 Dec 2018 02:52:52 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[บทเรียน]]></category>
		<category><![CDATA[เกมส์]]></category>
		<category><![CDATA[โปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1535</guid>

					<description><![CDATA[<p>Scratch (อ่านว่า สะ-แครท์ช) เป็นภาษาเขียนโปรแกรมสำหรับเด็ก ซึ่งเด็กๆ สามารถสร้างโปรแกรมได้ง่ายๆ ด้วยการเลือกคำสั่งที่ต้องการและเรียงลำดับการทำงานให้ถูกต้องผ่านทางหน้าจอ (โดยไม่ต้องเขียนโค้ด) ภาษา Scratch มุ่งเน้นไปที่การสอนให้เด็กๆ และบุคคลทั่วไปเข้าใจการเขียนโปรแกรมให้มากขึ้น ผ่านการเขียนโปรแกรมแบบง่ายๆ ดังนั้น ภาษา Scratch จึงได้รับความนิยมในการนำมาใช้ประกอบการเรียนการสอนในโรงเรียนและวิทยาลัยต่างๆ (แต่ภาษา Scratch ไม่สามารถนำมาใช้เขียนโปรแกรมใช้ในชีวิตจริงได้) [&#8230;]</p>
<p>The post <a href="https://karnlab.com/scratch-ep0-intro/">สร้างเกมส์ด้วย Scratch : ตอนที่ 0 &#8211; รู้จักภาษา Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Scratch (อ่านว่า สะ-แครท์ช) เป็นภาษาเขียนโปรแกรมสำหรับเด็ก ซึ่งเด็กๆ สามารถสร้างโปรแกรมได้ง่ายๆ ด้วยการเลือกคำสั่งที่ต้องการและเรียงลำดับการทำงานให้ถูกต้องผ่านทางหน้าจอ (โดยไม่ต้องเขียนโค้ด)</p>
<p>ภาษา Scratch มุ่งเน้นไปที่การสอนให้เด็กๆ และบุคคลทั่วไปเข้าใจการเขียนโปรแกรมให้มากขึ้น ผ่านการเขียนโปรแกรมแบบง่ายๆ ดังนั้น ภาษา Scratch จึงได้รับความนิยมในการนำมาใช้ประกอบการเรียนการสอนในโรงเรียนและวิทยาลัยต่างๆ (แต่ภาษา Scratch ไม่สามารถนำมาใช้เขียนโปรแกรมใช้ในชีวิตจริงได้)</p>
<p>ภาษา Scratch ได้รับการพัฒนาโดยมหาวิทยาลัยแมสซาชูเซตส์ (MIT &#8211; Massachusetts Institute of Technology) ตั้งแต่ปี ค.ศ. 2002 เปิดให้บริการครั้งแรกในปี ค.ศ. 2007 ปัจจุบันมีโปรแกรมที่ถูกพัฒนาด้วยภาษา Scratch กว่า 40 ล้านโปรเจค</p>
<p><figure id="attachment_1530" aria-describedby="caption-attachment-1530" style="width: 1070px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1530" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Project-1.jpg" alt="Scratch EP0 - Project 1" width="1070" height="623" /><figcaption id="caption-attachment-1530" class="wp-caption-text">Scratch EP0 &#8211; Project 1</figcaption></figure></p>
<p><figure id="attachment_1531" aria-describedby="caption-attachment-1531" style="width: 1004px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1531" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Project-2.jpg" alt="Scratch EP0 - Project 2" width="1004" height="622" /><figcaption id="caption-attachment-1531" class="wp-caption-text">Scratch EP0 &#8211; Project 2</figcaption></figure></p>
<p><figure id="attachment_1532" aria-describedby="caption-attachment-1532" style="width: 1007px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1532" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Project-3.jpg" alt="Scratch EP0 - Project 3" width="1007" height="618" /><figcaption id="caption-attachment-1532" class="wp-caption-text">Scratch EP0 &#8211; Project 3</figcaption></figure></p>
<p>&nbsp;</p>
<h2>การใช้เพื่อการศึกษา</h2>
<p>ภาษา Scratch ถูกใช้เป็นภาษาเบื้องต้นในการเรียนเขียนโปรแกรม เพราะถูกออกแบบมาให้ผู้เรียนสามารถสร้างโปรแกรมได้โดยง่าย มุ่งเน้นที่การทำความเข้าใจการควบคุมและการทำงานของโปรแกรมมากกว่าการเขียนโค้ด และความเข้าใจนี้จะทำให้ผู้เรียนสามารถต่อยอดไปสู่การเขียนโปรแกรมภาษาอื่นๆ ที่ยากขึ้นต่อไปได้ เช่น C++, Java, Python เป็นต้น</p>
<p>ด้วยภาษา Scratch ผู้เรียนสามารถสร้างสื่อ แอนิเมชัน และเกมส์อย่างง่ายได้</p>
<p>&nbsp;</p>
<p><figure id="attachment_1527" aria-describedby="caption-attachment-1527" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1527" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Costumes-Tab.jpg" alt="Scratch EP0 - Costumes Tab" width="1366" height="651" /><figcaption id="caption-attachment-1527" class="wp-caption-text">Scratch EP0 &#8211; Costumes Tab</figcaption></figure></p>
<h2><span lang="TH">หน้าตาของโปรแกรม</span></h2>
<p>สำหรับการใช้งานโปรแกรม สามารถเข้าถึงง่ายๆ ผ่าน Web Browser (Chrome, Firefox, Edge, etc.) โดยเข้าไปที่  <a href="https://scratch.mit.edu/projects/editor/">https://scratch.mit.edu/projects/editor/</a></p>
<p>* Web Browser ต้องติดตั้งและเปิดใช้งาน Flash Player ก่อนนะครับ จึงจะใช้งานโปรแกรม Scratch ได้</p>
<p>จากรูปภาพ</p>
<ol>
<li>แถบบนสุดของโปรแกรมจะเป็น Menu Bar (ส่วนใหญ่จะใช้เพื่อบันทึกโปรแกรมและบันทึกวิดีโอการทำงานของโปรแกรม)</li>
<li>ชื่อของโปรแกรม ปุ่มเริ่มการทำงาน (ธงสีเขียว) และ ปุ่มหยุดการทำงาน (แปดเหลี่ยมสีแดง)</li>
<li>Stage Area</li>
<li>Sprites Area</li>
<li>Scripts Tab</li>
</ol>
<p>นอกจากนี้ยังมี Costumes Tab และ Sounds Tab</p>
<p><figure id="attachment_1527" aria-describedby="caption-attachment-1527" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1527" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Costumes-Tab.jpg" alt="Scratch EP0 - Costumes Tab" width="1366" height="651" /><figcaption id="caption-attachment-1527" class="wp-caption-text">Scratch EP0 &#8211; Costumes Tab</figcaption></figure></p>
<p><figure id="attachment_1534" aria-describedby="caption-attachment-1534" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1534" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Sounds-Tab.jpg" alt="Scratch EP0 - Sounds Tab" width="1366" height="651" /><figcaption id="caption-attachment-1534" class="wp-caption-text">Scratch EP0 &#8211; Sounds Tab</figcaption></figure></p>
<p>&nbsp;</p>
<p>Stage Area ทำหน้าที่แสดงผลลัพธ์การทำงานของโปรแกรม ใช้ระบบพิกัด X-Y ในการระบุตำแหน่งของวัตถุ โดยจุดกึ่งกลางมีค่า X=0, Y=0 พื้นที่แสดงผลลัพธ์มีความกว้าง 480 pixels ความยาว 360 pixels ด้านซ้ายสุด X = -240 ด้านขวาสุด X = 240 ด้านบนสุด Y = 180 ด้านล่างสุด Y = -180</p>
<p>Sprites Area อยู่ด้านล่าง Stage Area ทำหน้าที่แสดงตัวละคร (วัตถุ) ในโปรแกรม เราสามารถเพิ่มวัตถุหรือตัวละครได้โดย (1) เลือกจาก Library ที่เตรียมไว้ให้ (2) วาดใหม่เองผ่าน Editor (3) อัพโหลดจากคอมพิวเตอร์ของเรา (4) ถ่ายรูปจากกล้องที่เชื่อมต่อกับคอมพิวเตอร์</p>
<p>ที่ Scripts Tab แสดง Blocks ต่างๆ สำหรับเขียนโปรแกรม แบ่งเป็น 10 ประเภท ได้แก่ Motion, Looks, Sound, Pen, Data, Events, Control, Sensing, Operators, และ More Blocks</p>
<p><figure id="attachment_1528" aria-describedby="caption-attachment-1528" style="width: 1024px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1528" src="https://karnlab.com/wp-content/uploads/2018/12/Scratch-EP0-Games.png" alt="Scratch EP0 - Games" width="1024" height="580" /><figcaption id="caption-attachment-1528" class="wp-caption-text">Scratch EP0 &#8211; Games</figcaption></figure></p>
<p>(ภาพประกอบจาก: <a href="https://opensource.com/article/18/4/designing-game-scratch-open-jam)">https://opensource.com/article/18/4/designing-game-scratch-open-jam)</a></p>
<table>
<tbody>
<tr>
<td width="123">Motion</td>
<td width="575">เคลื่อนที่ตัวละคร (Sprites) เปลี่ยนองศา (การหมุน) เปลี่ยนตำแหน่ง X-Y</td>
</tr>
<tr>
<td width="123">Looks</td>
<td width="575">ควบคุมการแสดงผลตัวละคร (Sprites) ใส่กล่องคำพูด เปลี่ยนพื้นหลัง ย่อ-ขยาย เปลี่ยนสีตัวละคร</td>
</tr>
<tr>
<td width="123">Sound</td>
<td width="575">เล่นไฟล์เสียง</td>
</tr>
<tr>
<td width="123">Pen</td>
<td width="575">วาดรูปด้วยปากกา ควบคุมขนาดและสีของปากกา (คล้ายๆ เต่าโลโก้ในภาษาโลโก้)</td>
</tr>
<tr>
<td width="123">Data</td>
<td width="575">ตัวแปรสำหรับเก็บข้อมูล</td>
</tr>
<tr>
<td width="123">Events</td>
<td width="575">รวบรวมเหตุการณ์ต่างๆ ที่เกิดขึ้นในโปรแกรม</td>
</tr>
<tr>
<td width="123">Control</td>
<td width="575">ตัวควบคุมการทำงานแบบเงื่อนไข (if-else) ตัวควบคุมการทำงานแบบทำซ้ำ (forever, repeat)</td>
</tr>
<tr>
<td width="123">Sensing</td>
<td width="575">ตรวจสอบว่าตัวละคร (Sprites) มีปฏิสัมพันธ์และสิ่งแวดล้อมย่างไรบ้าง</td>
</tr>
<tr>
<td width="123">Operators</td>
<td width="575">การคำนวณทางคณิตศาสตร์ (บวก ลบ คูณ หาร) ตรรกศาสตร์ (เปรียบเทียบ มากกว่า น้อยกว่า เท่ากับ)</td>
</tr>
<tr>
<td width="123">More Blocks</td>
<td width="575">คำสั่งอื่นๆ สำหรับควบคุมอุปกรณ์ภายนอก (เช่น PicoBoard, Lego WeDo)</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>ถัดจาก Scripts tab ก็จะเป็น Costumes tab ซึ่งผู้ใช้งานสามารถเปลี่ยนหน้าตาของ Sprites เพื่อสร้างงาน Animation ได้ และแถบสุดท้ายคือ Sounds tab มีไว้สำหรับแทรกเสียงประกอบและดนตรีได้</p>
<p>สำหรับใครที่พร้อมแล้ว เราจะมาลองสร้างโปรเจคแรกกันในตอนต่อไปกันเลยครับ <a href="https://karnlab.com/scratch-ep1-lets-start/">https://karnlab.com/scratch-ep1-lets-start/</a></p>
<p>ปล. สำหรับบทเรียนนี้ ผมตั้งใจว่าจะทำออกมาทั้งหมด 12 ตอนครับ (แบบอนิเมะเลย) โปรเจคทั้งหมดสามารถเข้าไปเยี่ยมชมได้ที่ <a href="https://scratch.mit.edu/users/doctorkarn/">https://scratch.mit.edu/users/doctorkarn/</a></p>
<p>&nbsp;</p>
<h3>อ้างอิง:</h3>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Scratch_(programming_language)">https://en.wikipedia.org/wiki/Scratch_(programming_language)</a></li>
<li><a href="https://scratch.mit.edu/">https://scratch.mit.edu/</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://karnlab.com/scratch-ep0-intro/">สร้างเกมส์ด้วย Scratch : ตอนที่ 0 &#8211; รู้จักภาษา Scratch</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/scratch-ep0-intro/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: karnlab.com @ 2026-06-02 02:27:36 by W3 Total Cache
-->