Sun VS Moon
Difficulty: ★★★☆☆ - Medium
Components used: Label, Button and CloudDB.
SunVSMoon.aia (11.6 KB)
Try the app out in online emulator.
Hello, in this tutorial you will learn how to create a simple Sun VS Moon app. Of course, you can replace both and make it for ex.: Earth VS Mars.
// Step 1 - Create a new project and change app & screen properties.
- Create a new project with the name SunVSMoon.
- Upload the Sun VS Moon logo to your project. (download the logo from the start of the tutorial).
- Go to Project Properties>>Logoand change it to the image we uploaded. Optionally go toThemingand change everything toBlack.
- Select Screen1 and change the ScreenOrientation to landscape, TitletoSun VS MoonandTitleVisibletofalse.
// Step 2 - Start designing the app.
- Add a label and set FontSizeto25,WidthtoFill parent,TextAlignmenttocenter : 1andTexttoSun VS Moon
- Drag out the CloudDBcomponent from theStoragetab. Also drag out theClockfromSensors.
- Drag the HorizontalArrangamentfrom theLayouttab, set theBackgroundColortoNoneand set theWidthandHeightto fill parent.
- Drag two VerticalArrangaments from theLayouttab to theHorizontalArragement1. Set bothWidthandHeighttoFill parentin bothVerticalArrangaments. Set the first arragementBackgroundColortoCyanand 2nds toBlack.
- Add Labels andButtons accordingly and rename all components for easier coding:
// Step 3 - Start coding the app.
- Switch to the Blockstab and code this:
My App Inventor looks different!
Heres how to fix it:
Ideas to make the app better.
- Make the side with more points cover more screen.
- Leaderboard which will display top 100 and total clicks, clicks for sun and clicks for moon.
When publishing, credit is not required but always appreciated.







