Navigasi Materi

Scratch 11

Scratch Materi 11 - Variables in Interactive Projects

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.

when green flag clicked

Variable

Menyimpan informasi yang dapat berubah.
Stores information that can change.

score lives timer

Response

Program memberikan respons terhadap tindakan pemain.
The program responds to the player's action.

change score by 10

3. Three Useful Variables

Score

Menyimpan jumlah poin pemain.
Stores the player's points.

change score by 10

Lives

Menyimpan jumlah kesempatan pemain.
Stores the player's remaining lives.

change lives by -1

Timer

Menyimpan atau menunjukkan waktu permainan.
Stores or shows the game time.

change timer by -1

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.

score: 0
+10
CAT

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

Goal: CAT bergerak menuju target dan mendapatkan 10 points.
CAT moves toward the target and gets 10 points.
Block Library
when green flag clicked
move 50 steps
change score by 10
change score by 5
Script Area
Drag blocks here
score: 0
+10
CAT

Challenge 2: Lives

Goal: Jika CAT terkena obstacle, Lives berkurang 1.
If CAT hits an obstacle, Lives decreases by 1.
Block Library
when green flag clicked
move 50 steps
if
touching obstacle
change lives by -1
Script Area
Drag blocks here
lives: 3
BAD
CAT

Challenge 3: Score and Lives

Goal: Jika berhasil mendapatkan target, Score bertambah. Jika terkena obstacle, Lives berkurang.
If CAT reaches the target, Score increases. If CAT hits the obstacle, Lives decreases.
Block Library
when green flag clicked
move 50 steps
if
touching target
change score by 10
touching obstacle
change lives by -1
Script Area
Drag blocks here
score: 0
lives: 3
+10
CAT

Challenge 4: Mini Game

Goal: Buat mini-game menggunakan Event, Condition, Score, dan Lives.
Create a mini-game using Event, Condition, Score, and Lives.
Game Rule:

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.

Block Library
when green flag clicked
move 100 steps
if else
touching target
change score by 10
change lives by -1
Script Area
Drag blocks here
score: 0
lives: 3
GOAL
CAT

7. Reflection

Centang pernyataan yang sesuai dengan pemahamanmu.
Check the statements that match your understanding.

8. Quiz | Kuis

1. Mengapa variable penting dalam interactive project?
Why are variables important in an interactive project?
2. Variable apa yang biasanya digunakan untuk menyimpan poin?
Which variable is commonly used to store points?
3. Jika Lives = 3 dan program menjalankan change lives by -1, berapa Lives sekarang?
If Lives = 3 and the program runs change lives by -1, what is the new value?
4. Apa yang membuat sebuah project disebut interactive?
What makes a project interactive?
5. Dalam sebuah game, Score dan Lives dapat digunakan bersama dengan apa?
In a game, Score and Lives can be used together with what?