ELEMENTS USED
CODE
The Fruit Ninja Game is a simple action-based mobile game developed using MIT App Inventor where players slice fruits appearing on the screen by swiping or tapping. Fruits move randomly across the canvas, and the player scores points by slicing them before they disappear.
The game uses a Canvas, ImageSprites for fruits, and Ball or Sprite movement to create animation. Each successful slice increases the score, while missing fruits may reduce chances or end the game.
This app helps beginners understand game logic, animation, collision detection, scoring, and event handling using MIT App Inventor, making learning fun and interactive.
Canvas Component
The canvas is used as the game area where fruits appear and move.
ImageSprite (Fruit Sprites)
Fruits are created using ImageSprite components that move randomly on the canvas.
Clock.Timer Block
Controls the movement speed of fruits and makes new fruits appear at regular intervals.
set Sprite.X and Sprite.Y
Randomly changes the position of fruits to simulate flying or falling motion.
Canvas.Dragged / Touched Block
Detects the player’s swipe or touch to slice the fruit.
Sprite.CollidedWith / Touch Detection
Checks if the swipe touches a fruit sprite.
Score Variable
Increases the score when a fruit is successfully sliced.
set Sprite.Visible to false
Removes the fruit from the screen after slicing.
Miss Counter / Game Over Condition
Ends the game or reduces lives if fruits are missed.
DOWNLOAD AIA FILE FOR THIS PROJECT BY CLICKING THIS LINK