Dasar Pemrograman Android || Game Pecah Balon || MIT App Inventor

3 min read 3 hours ago
Published on Apr 01, 2026 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, you will learn how to create a simple balloon-popping game using MIT App Inventor. This step-by-step guide is designed for beginners who want to understand the basics of Android programming and game development. By the end of this tutorial, you will have a fully functional game that you can play on your Android device.

Step 1: Setting Up MIT App Inventor

  1. Access MIT App Inventor

    • Go to the MIT App Inventor website: MIT App Inventor.
    • Click on "Create Apps!" to start a new project.
  2. Sign in

    • Use your Google account to sign in.
  3. Create a New Project

    • Click on "Projects" in the top menu.
    • Select "Start new project" and name your project (e.g., "BalloonPopGame").

Step 2: Designing the User Interface

  1. Add a Canvas Component

    • From the Palette, drag and drop a "Canvas" component onto the Viewer.
    • Set the width and height to match your desired game area.
  2. Add Balloons

    • Use the "ImageSprite" component to create balloon images.
    • Import your balloon images (downloadable from the provided link) by uploading them in the Media section.
  3. Configure Balloons

    • Set properties for the balloons, including their initial position on the canvas.
  4. Add a Score Label

    • Drag a "Label" component to the top of the screen.
    • Rename it to "ScoreLabel" and initialize the text to display "Score: 0".

Step 3: Adding Game Logic

  1. Create Variables

    • In the Blocks section, define a variable for the score (e.g., score).
  2. Detect Balloon Clicks

    • Add an event handler for when a balloon is clicked.
    • Increase the score variable by 1 each time a balloon is successfully clicked.
  3. Update Score Display

    • Use the Set ScoreLabel.Text block to update the score displayed on the screen.

Step 4: Adding Sound Effects

  1. Upload Sound Files

    • Import sound effects for popping balloons into the Media section.
  2. Play Sound on Click

    • In the balloon click event, add a block to play the sound effect when a balloon is popped.

Step 5: Testing the Game

  1. Connect Your Device

    • Use the MIT AI2 Companion app to test your game live on your Android device.
    • Scan the QR code generated by MIT App Inventor.
  2. Play and Debug

    • Play the game and check for any issues.
    • Make adjustments as needed to improve gameplay.

Conclusion

You have successfully created a simple balloon-popping game using MIT App Inventor. This project has introduced you to the basics of app design, game logic, and sound integration. For further learning, consider exploring more advanced features in MIT App Inventor or experimenting with different game mechanics. Happy coding!