Membangun game klasik seperti Snake adalah uji coba paling ideal untuk membuktikan kekuatan AI koding: dalam hitungan menit, logika grid, deteksi tabrakan, dan rendering skor dapat diwujudkan hanya melalui deskripsi instruksi yang terstruktur. ๐ง Building a classic Snake game is the perfect benchmark to demonstrate AI programming power: in minutes, grid mechanics, collision detection, and score rendering come alive purely through structured natural prompts. ๐ง
Untuk bikin program pertamamu, kamu butuh AI yang bisa langsung menjalankan kode di browser (jadi kamu nggak perlu install apa pun โ santai kayak di pantai ๐๏ธ). Pilih salah satu: For your first program, you need an AI that can run code right in the browser (so no installs โ chill like you're at the beach ๐๏ธ). Pick one:
| AlatTool | Kenapa Cocok buat PemulaWhy It's Great for Beginners |
|---|---|
| Trae (trae.ai) | Dipakai di kursus asli Easy-Vibe. Mode "Builder"-nya bikin website dari obrolan.Used in the original Easy-Vibe course. Its "Builder" mode turns chat into websites. |
| ChatGPT / Gemini / Claude | Minta saja: "Buatkan kode HTML lengkap dalam satu file." Lalu simpan sebagai file .html dan buka di browser.Just ask: "Give me the complete HTML code in one file." Then save it as a .html file and open in your browser. |
| Bolt.new / Lovable / v0 | Langsung menampilkan preview aplikasimu di layar. Magic banget. Instantly show a live preview of your app. Pure magic. |
Selesai lebih penting daripada sempurna. ๐ Jangan terjebak bikin game yang sempurna. Yang penting: game-nya jalan, kamu ngerti alurnya, dan kamu seneng. Nanti kita poles bareng-bareng. Done beats perfect. ๐ Don't get stuck chasing a perfect game. What matters: it runs, you understand the flow, and you have fun. We'll polish it together later.
Ketik prompt pertamamu ke AI. Ini versinya (tiru, modif, atau bikin sendiri): Type your first prompt to the AI. Here's the version (copy it, tweak it, or write your own):
Buatkan game ular (snake) dalam SATU file HTML. Aturannya: - Ular bergerak pakai tombol panah keyboard - Ada makanan yang muncul acak - Kalau makan, ular bertambah panjang dan skor +10 - Kalau nabrak dinding atau badan sendiri, game over - Tampilkan skor di atas layar Desainnya modern dan keren, warna gelap dengan aksen hijau neon.Create a snake game in ONE HTML file. Rules: - The snake moves using arrow keys - Food appears randomly - Eating food makes the snake grow and adds 10 points - Hitting walls or its own body = game over - Show the score at the top of the screen Modern, cool design: dark background with neon green accents.
Tekan enter. Tarik napas. Dan lihat: AI bakal nulis ratusan baris kode dalam hitungan detik โ kode yang bahkan programmer butuh waktu buat nulis manual. Kamu baru aja "memprogram" tanpa mengetik satu baris kode pun. ๐คฏ Press enter. Take a breath. And watch: AI writes hundreds of lines of code in seconds โ code that would take a programmer real time to type by hand. You just "programmed" without typing a single line. ๐คฏ
Jalankan hasilnya. Kalau pakai Bolt/Lovable/Trae, preview-nya langsung muncul. Kalau pakai ChatGPT dkk: Run the result. With Bolt/Lovable/Trae the preview appears instantly. With ChatGPT and friends:
snake.html (pastikan akhirannya .html, bukan .txt โ ini jebakan klasik! ๐ณ๏ธ)Save as snake.html (make sure it ends in .html, not .txt โ a classic trap! ๐ณ๏ธ)Selamat! Kamu baru aja bertemu "bug" pertama dalam kariermu. ๐ Ini NORMAL. Semua programmer di dunia ini ngalamin ini setiap hari (serius). Solusinya gampang: copy pesan error-nya, tempel balik ke AI, bilang: "Ini error yang muncul: [tempel error]. Tolong perbaiki." AI bakal jadi detektifnya. ๐ต๏ธ Congratulations! You just met your first "bug". ๐ This is NORMAL. Every programmer on Earth hits this daily (seriously). The fix is simple: copy the error message, paste it back to AI, and say: "Here's the error: [paste it]. Please fix it." AI plays detective. ๐ต๏ธ
Nah, ini bagian paling seru: modifikasi. Pilih 2-3 ide di bawah dan minta ke AI satu per satu: Now the most fun part: modifications. Pick 2-3 ideas below and ask AI one at a time:
1. "Tambahkan tombol main lagi (restart) setelah game over." 2. "Tambahkan level kecepatan: makin lama, ular makin ngebut." 3. "Ganti makanannya jadi emoji ๐, dan ularnya bisa bunyi 'nyam' pas makan." 4. "Tambahkan high score yang tersimpan walau browser ditutup." 5. "Buat bisa dimainin di HP pakai tombol panah di layar." 6. "Kasih mode gelap/terang dengan tombol toggle." 7. "Tambahkan musik latar 8-bit yang ceria." 8. "Bikin tema game-nya jadi [tema favoritmu: luar angkasa / laut / sekolah]."1. "Add a restart button after game over." 2. "Add speed levels: the snake gets faster over time." 3. "Replace food with emoji ๐ and play a 'nom' sound when eaten." 4. "Add a high score that persists after the browser closes." 5. "Make it playable on phones with on-screen arrow buttons." 6. "Add a dark/light mode toggle." 7. "Add cheerful 8-bit background music." 8. "Reskin the game to a [your favorite theme: space / ocean / school] theme."
Lihat apa yang terjadi? Setiap kali kamu minta perubahan, AI mengubah kodenya. Kamu nggak mengubah satu baris pun sendiri, tapi game-nya terus berevolusi. Itulah vibe coding: kamu sutradaranya, AI aktornya. ๐ฌ See what's happening? Every time you ask for a change, AI rewrites the code. You didn't touch a single line yourself, yet the game keeps evolving. That's vibe coding: you're the director, AI is the actor. ๐ฌ
Setelah main-main, kamu bakal sadar: kadang hasil AI nggak sesuai harapan. Ini bukan salahmu atau salah AI โ ini soal cara komunikasi. Ini rumus ajaibnya: After playing around, you'll notice: sometimes AI's result misses the mark. It's not your fault or AI's fault โ it's about communication style. Here's the magic formula:
Goal (Tujuan): Aku mau bikin apa? โ "Game ularโฆ"
Konteks: Kondisiku gimana? โ "โฆdesain responsif, nyaman diakses di smartphoneโฆ"
Hasil yang udah ada: Sekarang sampai mana? โ "โฆularnya udah jalan tapiโฆ"
Spesifik: Maunya persis kayak gimana? โ "โฆtolong tambahkan tombol restart berwarna hijau di tengah layar." Goal: What do I want to make? โ "A snake gameโฆ"
Context: What's my situation? โ "โฆresponsive design, optimized for mobileโฆ"
Result so far: Where am I now? โ "โฆthe snake works butโฆ"
Nice and specific: What exactly do I want? โ "โฆplease add a green restart button in the center."
Setelah game ularmu jadi, pilih SALAH SATU tantangan ini (atau bikin sendiri): Once your snake game works, pick ONE of these challenges (or invent your own):
Ingat: satu prompt besar โ jalankan โ perbaiki โ ulangi. Loop ini bakal jadi sahabatmu selamanya. ๐ Remember: one big prompt โ run โ fix โ repeat. This loop will be your best friend forever. ๐
Ular di game kamu makan terus tapi nggak pernah gemuk.
Sama kayak kamu belajar vibe coding: makin banyak kamu "makan" ilmu, nggak bakal bikin kamu kekenyangan โ malah makin laper buat bikin lebih banyak! ๐๐
Sampai jumpa di pelajaran berikutnya, di mana kita bakal pindah ke markas developer sungguhan. ๐ข The snake in your game eats forever but never gets fat.
Just like you learning vibe coding: the more knowledge you "eat", you never get full โ you just get hungrier to build more! ๐๐
See you next lesson, where we move into a real developer's headquarters. ๐ข