[TH] Unity Ep6 เขียนโค้ดเดินหน้า ถอยหลัง และกระโดด

บทความนี้เป็นตัวอย่างการเขียนโค้ด C# เพื่อขยับวัตถุวงกลมในหน้าจอให้เดินหน้า ถอยหลัง และกระโดด ตามลักษณะพื้นฐานของเกมแบบแพลตฟอร์ม ซึ่งเป็นหนึ่งในหลายตัวอย่างที่นำมาใช้ในการสอนวิชาการสื่อสารข้อมูลฯ สำหรับพัฒนาเกมแบบผู้เล่นหลายคน

Read More

[TH] Godot: C# Script Ep.1

          เกมเอนจิน Godot มี 2 ระบบ คือ ระบบที่ใช้งาน GDScript ที่มีหลักภาษาคล้ายกับภาษาไพธอนเป็นภาษาสำหรับควบคุมการทำงาน กับระบบที่ใช้ภาษา C# ในการทำงาน โดยขั้นตอนพื้นฐานในการใช้งานจะเป็นดังนี้

                    1. สร้างโครงงานใหม่ด้วยการคลิกเลือก New Project

                    2. กำหนดที่เก้บโครงงาน และตั้งชื่อโครงงาน หลังจากนั้นคลิกที่ Create Folder แล้วคลิกที่ปุ่ม Create&Edit เพื่อเข้าสู่โหมดการแก้ไขโครงงาน

                    3. เลือกการสร้าง Scene เป็น Node2D และบันทึกไฟล์ฉาก (Scene) เอาไว้

                    4. ใน Tab ชื่อ Inspector ให้เลือกสร้างสคริปต์ด้วยการคลิกที่ Script และเลือก New Script

                    5. เลือกภาษาเป็น C# และคลิก Create เพื่อสร้างไฟล์ที่มีนามสกุลเป็น .cs

                    6. โครงสร้างของไฟล์เป็นดังโปรแกรม 1-10 จะพบรายการทรัพยากรดังในภาพที่ 1-4 อันประกอบไปด้วยภาพไอคอนของโปรแกรม ไฟล์ฉากที่สร้างขึ้น (ในภาพตั้งชื่อเป็น MainScene.tscn) และไฟล์ภาษา C# (ชื่อ MainScene.cs)

Read More

[EN] Unity3D The great game maker

This article introduces Unity3D, a very popular game creation program. Because there are so many facilities needed to make a game. Called quite complete, such as the manipulation of three-dimensional objects, gravity, system movement of objects, can create games on multiple platforms for example. Controlling objects requires knowledge of a programming language which can be practiced.

Figure 1 Unity’s logo
Read More

[EN] LittleFS Filesystem

The article discusses the use of the LittleFS library and introduces a library developed for use with the esp32 microcontroller, which includes a plugin for the Arduino IDE for uploading files to the microcontroller’s ROM. Make it convenient to load data to store and run. For this reason, if programmers find it difficult to transcode HTML/CSS/JavaScript to be a string manually and switching to uploading files to esp32 and reading the web files directly to use will be something that will require training to use LittleFS as a reliable library.


Read More

[TH] การใช้ GPS ใน Unity3D

จากบทความ Unity3D ครั้งที่แล้วได้กล่าวถึงฟีเจอร์บางส่วนในโปรแกรม ในบทความนี้จึงขอกล่าวฟีเจอร์หนึ่งที่น่าสนใจ คือการใช้งาน GPS ใน Unity3D โดยเฉพาะผู้เริ่มต้นใหม่ เนื่องจากในโปรแกรมมีการใช้งาน GPS ที่ค่อนข้างง่าย

Read More

[TH] Unity3D สุดยอดโปรแกรมสร้างเกม

บทความนี้แนะนำเกี่ยวกับโปรแกรม Unity3D ซึ่งเป็นโปรแกรมสร้างเกมที่ได้รับความนิยมอย่างมาก เนื่องจากมีสิ่งอำนวยความสะดวกที่จำเป็นในการสร้างเกมอย่างมากมาย เรียกได้ว่าครบถ้วนเลยทีเดียว เช่น การจัดการวัตถุสามมิติ ระบบแรงโน้มถ่วง การเคลื่อนที่ของวัตถุ สร้างเกมได้หลายแพลตฟอร์ม เป็นต้น แต่อย่างไรก็ดี การควบคุมวัตถุต่างๆจำเป็นต้องใช้ความรู้ทางด้านภาษาโปรแกรม ซึ่งสามารถฝึกฝนได้

ภาพที่ 1 Unity
Read More

[EN] Arduino : ESP8266 GPIO

In this article, we will learn about GPIO (General Purpose I/O) or pin connect to an external device of microcontroller with C++ of Arduino using esp8266 as reference chip. This can be applied to Arduino Uno, Arduino Mega or STM32 as well. Under this article, we describe the duty of the pin,  output and the input signal.

(Figure. 1 GPIO of WeMos D1)
Read More

[EN] I2C Bus/Wire.h

This article describes the methods of Wire.h, a class for communicating with devices over an I2C bus that uses two signal wires called SDA and SCL to transmit data between them. We have quite a number of articles about this type of communication and used as the main bus to develop devices by yourself and run through the bus, for example, articles on using esp8266 to connect to Arduino Uno or using esp8266 with stm32f030f4p6, etc.

Read More

[TH] LittleFS Filesystem

บทความกล่าวถึงการใช้ไลบรารี LittleFS และแนะนำไลบรารีที่ถูกพัฒนาเพื่อใช้กับไมโครคอนโทรเลอร์ esp32 ซึ่งมีส่วนเสริม (plugin) ของ Arduino IDE สำหรับอัพโหลดไฟล์ไปเก็บในรอมของไมโครคอนโทรลเลอร์ ทำให้สะดวกต่อการโหลดข้อมูลไปเก็บและเรียกใช้งาน ด้วยเหตุนี้ถ้าผู้เขียนโปรแกรมรู้สึกยุ่งยากกับการแปลงโค้ด HTML/CSS/JavaScript ให้เป็นสตริงด้วยตนเอง และเปลี่ยนมาเป็นอัพโหลดไฟล์ไปเก็บใน esp32 แล้วอ่านไฟล์เว็บมาใช้งานโดยตรงจะเป็นสิ่งที่จะต้องฝึกฝนใช้งานเจ้า LittleFS ไว้เป็นไลบรารีคู่ใจกันเลยทีเดียว


Read More