Cara Membuat Tetris sederhana untuk pemula di Mit App inventor GRATIS 2024 | programmer pemula

Levzyyy
8 Nov 202319:16

Summary

TLDRThis video script offers a step-by-step tutorial on creating a Tetris game using MIT App Inventor. It guides viewers through setting up a new project, designing the user interface with buttons and layout arrangements, and implementing game logic with blocks and procedures. The tutorial also covers adding a scoring system, game over functionality, and customizing the game with images. It concludes with instructions on how to export the game as an APK for Android devices.

Takeaways

  • 😀 The tutorial is about creating a Tetris game using MIT App Inventor.
  • 👨‍🏫 The instructor is Muhammad Alfi, and the course is led by Dosen Bapak Jar Hindarto.
  • 💻 The first step is to open MIT App Inventor and start a new project by naming it.
  • 📱 The tutorial guides through the layout setup, including using vertical and horizontal arrangements.
  • 🔲 It emphasizes the importance of setting visibility and arranging UI elements like buttons and labels.
  • 🎮 The 'Start' button is a crucial UI component that initiates the game.
  • 📚 Extensions are necessary for additional functionalities and must be downloaded and imported.
  • 🔗 The tutorial covers linking blocks of code to UI elements, such as buttons, to define game actions.
  • 🖼️ The game requires uploading and integrating images for the Tetris pieces.
  • 🔄 The script mentions creating movement and rotation functionalities for the game pieces.
  • 🏁 The game includes a 'Game Over' screen, which is part of the user interface design.
  • 🔧 The tutorial also touches on debugging and checking the visibility of UI elements.

Q & A

  • What is the main topic of the video script?

    -The main topic of the video script is creating a Tetris game using MIT App Inventor.

  • Who is the speaker in the video script?

    -The speaker is Muhammad Alfi, identified by the NPM number 23706451.

  • What is the first step mentioned in the script for creating the Tetris game?

    -The first step is to open MIT App Inventor and create a new project by clicking on 'Create Apps' and then 'New Project'.

  • What is the purpose of the 'Start' button in the game interface?

    -The 'Start' button is used to initiate the game when the player is ready to play Tetris.

  • How does the script instruct to change the visibility of the vertical arrangement?

    -The script instructs to change the visibility by setting the 'Visible' property of the vertical arrangement to 'false' to hide it and 'true' to show it.

  • What is the significance of the 'Extensions' section in the script?

    -The 'Extensions' section is important for importing additional features or components that are not available by default in MIT App Inventor.

  • What is the role of the 'When Button 1 Click' event in the script?

    -The 'When Button 1 Click' event is used to trigger actions when the first button is clicked, such as starting the game.

  • How does the script describe the process of adding images to the game?

    -The script describes uploading images to the media section and then referencing them in the 'Blocks' section by matching the image names correctly.

  • What actions are associated with the 'Button 2' and 'Button 3' according to the script?

    -According to the script, 'Button 2' is associated with moving the Tetris block to the left, and 'Button 3' is associated with moving it to the right.

  • How does the script handle the game over scenario?

    -The script handles the game over scenario by changing the text and visibility of certain elements in the game interface, such as showing a 'Game Over' message.

  • What is the final step mentioned in the script for customizing the game?

    -The final step mentioned is to change the background of the 'Start' screen to an image of the user's choice.

Outlines

00:00

📝 Introduction to Tetris App Creation

This paragraph introduces the video script where Muhammad Alfi guides the audience through the process of creating a Tetris game using MIT App Inventor. The tutorial starts with opening the App Inventor and creating a new project. The user is instructed to set the layout to vertical arrangement and add a 'Start' button to the interface. The paragraph also covers the initial steps of arranging the user interface and making the 'Start' button visible.

05:01

🛠️ Setting Up the User Interface

The second paragraph delves into the detailed setup of the Tetris game's user interface. It describes how to add and arrange buttons, labels, and other elements within the vertical and horizontal arrangements. The user is guided to adjust the properties of these elements, such as visibility and text, to create the game's initial layout. Additionally, the paragraph explains the necessity of importing extensions and setting up the initial game state with blocks and procedures for starting the game.

10:02

🖼️ Adding Graphics and Media

In this paragraph, the focus shifts to incorporating graphics and media into the Tetris game. The tutorial explains how to upload images for the game's blocks and how to reference them in the code. It also covers the process of setting up buttons for game controls, such as moving blocks left, right, and rotating them. The user is instructed to ensure that the image names match those used in the code and to duplicate and adjust blocks as needed for game functionality.

15:09

🎮 Finalizing Game Elements and Exporting

The final paragraph wraps up the tutorial by detailing the addition of game-over elements and the customization of the game's appearance. It guides the user on how to create a 'Game Over' screen, adjust the visibility of game elements, and handle game restart functionality. The paragraph also touches on changing the background and finalizing the game's design. Lastly, it provides a brief overview of how to export the game as an APK file for distribution on Android devices.

Mindmap

Keywords

💡App Inventor

App Inventor is a visual programming environment that allows users to design and create Android applications using a block-based interface. In the video, App Inventor is used to create a Tetris game, demonstrating its capability to develop interactive mobile applications without writing traditional code.

💡Tetris

Tetris is a classic puzzle video game where players manipulate falling blocks to fit together and clear horizontal lines. The script describes the process of creating a Tetris game, which is the main theme of the video, using App Inventor.

💡Vertical Arrangement

Vertical Arrangement is a layout component in App Inventor that stacks elements vertically. The script mentions using Vertical Arrangement to organize the game's interface elements, such as buttons and labels, in a vertical column.

💡Horizontal Arrangement

Horizontal Arrangement is another layout component in App Inventor that aligns elements in a horizontal line. The script refers to Horizontal Arrangement when detailing how to position elements like buttons across the screen.

💡Button

A Button is a user interface element that allows users to interact with the application by clicking or tapping. The script describes creating and positioning buttons for the Tetris game, such as the 'Start' button, which initiates the game.

💡Label

A Label is a UI element used to display text in an application. In the context of the video, labels are used to show the game's score and other information, with examples like 'Score' and 'Game Over' messages.

💡Extension

In App Inventor, an Extension is a module that adds functionality to an app. The script mentions importing an extension, which is necessary for adding specific features to the Tetris game, such as game logic and rendering.

💡Block

Blocks in App Inventor represent the programming logic of the app, where users can define actions and events. The script refers to Blocks when discussing the programming aspects of the Tetris game, such as starting the game and handling user interactions.

💡Instance

An Instance in App Inventor is a specific occurrence of a component or object. The script uses the term 'destroy Instance' in the context of managing game objects, such as clearing the blocks from the game board.

💡Renderer

A Renderer in the context of the video likely refers to a component responsible for drawing or displaying the game's visuals. The script mentions creating a renderer for the Tetris game, which is crucial for rendering the game's graphics on the screen.

💡Media

Media in App Inventor refers to the images, sounds, and other multimedia elements used in an app. The script discusses uploading media files, such as images for the Tetris game's blocks, which are essential for the game's visual presentation.

Highlights

Introduction to creating a Tetris game using MIT App Inventor.

Opening MIT App Inventor and starting a new project with a custom name.

Selecting the layout for the Tetris game with a vertical arrangement.

Adding a Start button to the user interface and setting its properties.

Instructions on making the Start button visible and functional.

Customizing the Start button's label to 'Start' or 'Mulai'.

Importing necessary extensions for the Tetris game functionality.

Setting up the game's logic blocks for the Start button's event.

Creating the game's renderer and configuring the Tetris pieces.

Uploading and assigning images for different Tetris pieces.

Adding control buttons for game movements and rotations.

Configuring the game's scoring system and display.

Implementing the game over condition and the corresponding UI changes.

Instructions on creating a restart functionality for the game.

Customizing the game's background with an image.

Exporting the game as an APK file for Android devices.

Final words and encouragement for viewers to explore further.

Transcripts

play00:00

Perkenalkan nama saya Muhammad Alfi NPM

play00:05

23706451 6045 Dosen Bapak Jar Hindarto

play00:10

SK mkom dari Universitas nasionali

play00:14

Teknik Informatika di sini kita akan

play00:17

membuat e Tetris

play00:20

di website Mit app inventor di sini

play00:26

pertama kalian itu harus buka

play00:28

Mit app

play00:30

inventornya lalu habis itu

play00:34

kalian Buka website yang paling atas

play00:36

seperti

play00:38

ini lalu eh di sini buka bacaan create

play00:50

apps dan lalu habis itu klik new

play00:54

Project l itu ketik nama ketik nama

play01:05

sjuknya

play01:08

[Musik]

play01:13

kitai perlu spasiat aja

play01:19

oke nah karena kita sudah buat lalu

play01:23

habis

play01:25

itu Muncul itu di projek baru yang

play01:28

pertama itu kalian harus ke

play01:30

layout itu klik vertical

play01:34

arrangement drag ke sini lalu Kalian

play01:38

pergi

play01:39

ke

play01:41

itu oke hab lalu di situ klikent hab itu

play01:48

Oke jika sudah full screen seperti ini

play01:52

kalian tutup lagi menu layoutnya ke user

play01:56

interface seret buttonnya habis itu hab

play02:02

situ klik vertical arrangementnya lalu

play02:05

kalian ke Line horizontal terus klik

play02:08

center terus ini center lalu habis itu

play02:12

kalian

play02:13

ubah menu ininya diklik aja terus ganti

play02:19

tombol Start atau

play02:22

mulai

play02:26

mulaianti lu setelah

play02:28

itu

play02:30

kalian pencet di sebagian screen itu

play02:34

tujuannya untuk menghilangkan bacaan

play02:36

screen satunya ini unuk kalian

play02:41

visible saja itu kalian e divisibelin

play02:46

dulu sebentar

play02:48

oke

play02:54

[Musik]

play02:56

oke di sini kalian hilang-ilai dulu

play02:58

vertical arrangementnya

play03:00

nyati lalu kalian ke Layout Layout ini

play03:05

kalian pilih yang vertical arrangement

play03:09

oke lalu kalian klik yang fill

play03:15

parent fil

play03:18

parent habis itu kalian yang W juga fil

play03:28

parent

play03:30

Oke habis itu habis itu kalian pilih

play03:33

yang horizontal arrangement ya kalian di

play03:37

sini

play03:41

oke setelah itu kalian ke W

play03:45

ini

play03:56

kaliancopy setelah itualian Klik di

play03:59

tengah seperti ini terus

play04:02

equid

play04:05

[Musik]

play04:09

terus Nah setelah itu kalian pergi ke

play04:12

layout eh pergi ke user interface terus

play04:15

button kan ke bawah nah ini kalian ganti

play04:20

bacanya itu set kalian kalaunya

play04:24

ya ini winya itu

play04:28

20% Oke Luk kalian copy tiga

play04:34

kali ya Oke ini kalian ganti aja kanan

play04:40

atau n

play04:48

atau terus

play04:52

ini bawa

play04:58

ya

play05:00

Oke Lalu setelah itu kalian pergi ke

play05:03

horizontal arrangement 3 kalian ganti

play05:06

ini ke center ini ke center Nah jadi

play05:09

berubah nah Biar Ada jaraknya yaitu

play05:12

Kalian pergi ke

play05:14

e di sini ke label Kalian

play05:19

[Musik]

play05:21

dragbel terus Kalian drag sini nah ini

play05:24

di tnya itu adalah strip saja kalian

play05:31

enter di sini wi-nya itu kalian taruh 2%

play05:36

aja atau 1% nah habis itu kalian ini

play05:40

kalian copy Terus

play05:42

kalian tempel terus Kalian tempel n

play05:47

setelah

play05:49

itu L setelah itu kalian pergi ke layer

play05:53

yang atas kalian tambahin

play05:56

label di sini kalian ganti namanya

play06:03

jadi skor no

play06:08

oke di sini itu sudah berganti jadi skor

play06:12

no ini saya gu mau

play06:15

gantiadi 20

play06:20

dan kian tambah lagi

play06:24

sor kembali lagi ini kalian ganti angka

play06:29

nol lah ya no0 Itu font siz-nya 25

play06:36

aja

play06:40

kalian l setelah

play06:42

itu jika sudah

play06:45

selesaian itu harus e membuat atau pergi

play06:50

ke paling bawah itu ke menu extension

play06:54

lalu kalian import extension itu wajib

play06:57

diownload ya guys di Google juga

play07:00

bel l itu Kalian cari folder

play07:04

ax-nya Nah ini dia ix-nya kita Open lu

play07:09

kita

play07:12

impor ak klik

play07:15

ensinya kalian drag di sini

play07:18

eh

play07:20

layar Lus setelah

play07:23

itu kalian

play07:26

minimize ya nah ini Mas Kalian pergi ke

play07:32

blok terus lalu Kalian pergi ke sini

play07:36

klik butaton sat habis itu kalian pilih

play07:40

when button 1 klik lalu habis itu kalian

play07:45

ke vertical arrangement

play07:47

1 lalu Kalian cari vertical arrangement

play07:50

1 visible

play07:53

Oke ini ya ini kalian pasangkan seperti

play07:58

ini terus Kalian ketik

play08:01

false itu kalian klik lalu habis itu

play08:07

kalian copy paste ini duplikat taruh di

play08:11

sini lu Dianti ke arrangement du lalu

play08:15

kalian ini true habis itu kalian klik eh

play08:19

ini

play08:21

prosedur lalu klik

play08:24

yang

play08:26

Blue prosedur dan ini kalian

play08:30

ganti start

play08:35

game kalian Poer lagi habis itu yang

play08:38

call start game

play08:40

Oke

play08:42

selanjutnya kalian klik S habis itu

play08:47

kalian ke

play08:49

ini hab itu kalian pergi ke vertical

play08:54

arrangement 2 dan horizontal

play08:56

arrangement

play08:58

ini

play08:59

Oke habis itu lalu Kalian cari

play09:04

arrangement

play09:09

ya setelah

play09:11

itu kalian ke

play09:14

Tris lalu kalian klik

play09:19

destroy destroy

play09:27

Instance k di atas lalu hab situ Kalian

play09:32

cari lagi create

play09:36

[Musik]

play09:42

[Musik]

play09:45

rendererer lalu habis itu Kalian cari

play09:48

lagi

play09:49

Tetris Exel

play09:53

image lalu Kalian pergi ke

play09:57

web klik tambahin no0 di bagian indeks

play10:01

Nah setelah ini kalian tuh perlu

play10:05

menambahkan gambar-gambar blog untuk

play10:08

Tetris itu caranya ada di media di sini

play10:12

kan klik upload file terus choose

play10:16

file terus Kalian cari saja yang mana

play10:21

pengin di

play10:24

e gunakan

play10:28

sebentar nah ini eh gambar-gambar

play10:31

blognya yang banyak sekali bertebaran

play10:35

di Google ini kalian kalau mau boleh di

play10:41

deskripsi Piel no ini kalian harus

play10:44

upload semua ya

play10:45

oke e semua Setelah kalian upload-upload

play10:49

semua di media tersebut kalian itu harus

play10:52

Bi ke Blok lagi lalu Kalian pergi ke tek

play10:56

lalu ke ke ini

play10:59

paling atas lalu kalian ketik ini sesuai

play11:03

nama sor sesuai

play11:06

nama foto yang kan upload misalnya di

play11:10

sini

play11:12

gu0 Nah di sini k harus sama kalau misal

play11:16

di sini kalian do PNG ya kan harus P ini

play11:20

kalian ulangi cara yang sama sampai ke

play11:24

tu oke oke Lalu setelah itu kalian

play11:29

[Musik]

play11:30

eh desainer terus

play11:34

kalianatan lihat ini dia itu ada di

play11:37

button du l kalian di horizontal

play11:41

arrangement 3 lalu kalian ke Blok Kalian

play11:45

pergi

play11:46

Kean 3 ini tapi yang button duanya lalu

play11:51

kalian itu drag

play11:55

ini

play11:57

saja s

play12:08

oke dan button to

play12:12

klik itu kalian harus memanggil

play12:17

oke terus setelah itu kalian pergi ke

play12:21

Tetris Kalian cari yang War move tapi

play12:27

yang move to left ini karena tadi button

play12:31

two itu buat ke arah kiri Nah kalau buat

play12:35

yang ke arah kanan itu namanya button F

play12:39

untuk rotate button th untuk bawah

play12:42

button F lalu k ulangi cara yang sama

play12:46

seperti tadi Bua

play12:48

[Musik]

play12:50

sebentar

play12:51

[Musik]

play12:54

blok copy ini

play12:57

duplikat

play13:01

[Musik]

play13:09

Oke

play13:13

but setelah itu e kalian perlu cari tahu

play13:17

dulu e ini skor yang ini itu di label

play13:23

berapa itu ada di label 5 itu ada di

play13:27

horizontal Min sat oke nah Ini k ber

play13:32

ngapusing kalian minimiz saja

play13:34

ya kalian kita klik ke label 5 yang di

play13:38

sini

play13:39

sebentar di sini kalian Langsung cari

play13:42

label 5 tekst

play13:44

to yang seperti ini

play13:48

[Musik]

play13:54

Oke

play13:56

Nah di sini

play13:59

[Musik]

play14:03

minta ter setelah itu kalian pergi ke

play14:07

tus

play14:09

lagi Sekarang kita ganti when game over

play14:15

[Musik]

play14:20

Oke setelah itu kalian balik lagi ke

play14:24

deser ini lalu kalian buat lagi layout

play14:28

untuk buat game over itu caranya

play14:31

bagaimana di sini kan ada verticle

play14:33

arrangement 2 sama verticle arrangement

play14:36

1 Saya hanya perlu mengcopy yang

play14:40

vertical arangement S

play14:42

ini visib Oke Sin visib

play14:48

ya conttrl terus conttr

play14:53

[Musik]

play14:57

V

play15:09

Oke setelah itu Setelah kalian tambahkan

play15:11

ini yang vertical arrangement 3 itu

play15:15

kalian klik bagian mulainya itu di

play15:17

button 6 lalu kalian itu ganti teksnya

play15:24

jadi

play15:27

Sor

play15:29

[Musik]

play15:35

isnya berubah lalu kalian Tambahkan lagi

play15:38

label di atas seperti ini dan seperti

play15:40

ini itu kata-katanya sebenarnya bebas

play15:44

suka ini gua

play15:51

pakai Oke dan yang ini gu ganti lagi

play15:57

menjadi

play16:00

kamu cukung KIPS

play16:04

Oke ini sebenarnya E lagi lagi itu

play16:08

namanya selera di sini gua font yang gua

play16:11

gedein dan ini ya Sus 25

play16:19

oke nah seperti itu

play16:25

selanjutnyanya

play16:27

ini

play16:29

ang

play16:30

[Musik]

play16:35

juga

play16:37

ini kita kurang

play16:40

[Musik]

play16:42

men Lalu setelah itu kalian pergi ke

play16:46

blok

play16:47

lagi habis itu kalian pergi ke vertical

play16:52

arrangement 2 lalu Kalian cari vertical

play16:54

range 2

play16:56

visibleu kalian ke sini terus Kalian

play17:00

ketik

play17:02

[Musik]

play17:04

false lalu kalian di sini l kalian copy

play17:10

paste Ini ganti ke vertical el3 and true

play17:15

lalu Kalian pergi ke label 7 lalu Kalian

play17:19

cari label 7 Tex to

play17:24

oke di sini get

play17:26

score nah untuk eh mengulai start

play17:31

restart game-nya ini kalian harus

play17:33

mencari di button 6 di button 6 ini itu

play17:37

klik lagi button 6 terus Kalian cari

play17:40

when button 6 klik

play17:46

oke oke setelah itu oke setelah itu

play17:50

kalian pergi ke preser lagi terus call

play17:54

start

play17:56

Oke kita di sini menemukan kesalahan an

play18:00

Oke sini

play18:05

[Musik]

play18:08

oke ini kita taruh

play18:11

sinus karena tabrakan Nah sayaasnya

play18:16

sudah benar

play18:18

Oke

play18:20

Dan mungkin tutorial sampai sini aja

play18:23

bagi yang

play18:25

ingin du aja di sini jangan lupa kalian

play18:29

yang

play18:30

visible yang kalian harus dicek plus

play18:34

visibelnya itu adalah yang mulai Nah

play18:37

sekarang gua mau mengganti background

play18:40

bacaan mulai tersebut ini menjadi gambar

play18:44

yang aneh oke di sini gua mau cari

play18:49

gambar

play18:50

atlist Ya gambar mobilah atau apalah

play18:54

itulah ya Misan seperti ini oke oke

play18:59

saja nah dia berubah kan dia berubah dia

play19:05

berubah gambar diisan Oke bagi yang

play19:07

ingin mengkonpresikan ke APK dan terus

play19:11

ke androidapp.apk

play19:15

oke

Rate This

5.0 / 5 (0 votes)

Связанные теги
App InventorTetris GameGame DevelopmentMIT TutorialWebpage DesignCoding GuideMobile AppsUser InterfaceEducational ToolInteractive Tutorial
Вам нужно краткое изложение на английском?