Scratch Materi 11: Variables in Interactive Projects
Menggunakan Variable untuk Membuat Project Interaktif | Using Variables to Create Interactive Projects
1. Tujuan Pembelajaran | Learning Objectives
-
Memahami bagaimana variable membuat project menjadi interaktif.
Understand how variables make a project interactive. -
Menggunakan variable untuk menyimpan Score, Lives, dan Timer.
Use variables to store Score, Lives, and Timer. -
Menghubungkan Event, Condition, dan Variable.
Connect Events, Conditions, and Variables. -
Membuat mini-game sederhana menggunakan variable.
Create a simple mini-game using variables.
2. What Makes a Project Interactive?
Project disebut interactive ketika pengguna dapat melakukan sesuatu dan program memberikan respons terhadap tindakan tersebut.
An interactive project responds to what the user does.
Event
Menentukan kapan program mulai melakukan sesuatu.
An Event tells the program when to start an action.
Variable
Menyimpan informasi yang dapat berubah.
Stores information that can change.
Response
Program memberikan respons terhadap tindakan pemain.
The program responds to the player's action.
3. Three Useful Variables
Score
Menyimpan jumlah poin pemain.
Stores the player's points.
Lives
Menyimpan jumlah kesempatan pemain.
Stores the player's remaining lives.
Timer
Menyimpan atau menunjukkan waktu permainan.
Stores or shows the game time.
4. Vocabulary
| Scratch Term | Bahasa Indonesia | English Explanation |
|---|---|---|
| Interactive Project | Project interaktif | A project that responds to the user's actions. |
| Score | Nilai atau poin | A value that represents the player's points. |
| Lives | Kesempatan | A value that represents remaining chances. |
| Timer | Pengatur waktu | A value used to represent time. |
| Event | Kejadian pemicu | An action that starts a script. |
| Response | Respons | What the program does after an action. |
5. Practice: Interactive Score
Klik tombol untuk membantu CAT mendapatkan poin. Perhatikan perubahan Score pada Stage.
Click the buttons to help CAT collect points. Watch the Score change on the Stage.
6. Challenges
Drag blocks dari Block Library ke Script Area. Kemudian jalankan program dan perhatikan Stage.
Drag blocks from the Block Library to the Script Area. Then run the program and watch the Stage.
Challenge 1: Catch the Point
CAT moves toward the target and gets 10 points.
Challenge 2: Lives
If CAT hits an obstacle, Lives decreases by 1.
Challenge 3: Score and Lives
If CAT reaches the target, Score increases. If CAT hits the obstacle, Lives decreases.
Challenge 4: Mini Game
Create a mini-game using Event, Condition, Score, and Lives.
CAT memiliki 3 lives. Setiap berhasil mencapai target, score bertambah 10. Jika terkena obstacle, lives berkurang 1.
CAT has 3 lives. Each successful target gives 10 points. Hitting an obstacle decreases lives by 1.
7. Reflection
Centang pernyataan yang sesuai dengan pemahamanmu.
Check the statements that match your understanding.
8. Quiz | Kuis
Why are variables important in an interactive project?
Which variable is commonly used to store points?
If Lives = 3 and the program runs change lives by -1, what is the new value?
What makes a project interactive?
In a game, Score and Lives can be used together with what?
9. Next Lesson
Sekarang kita sudah dapat menggunakan Variable untuk membuat project lebih interaktif.
Now we can use Variables to make projects more interactive.
Materi berikutnya: Designing a Simple Scratch Game.