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
>>Logo
and change it to the image we uploaded. Optionally go toTheming
and change everything toBlack
.
- Select Screen1 and change the ScreenOrientation to landscape,
Title
toSun VS Moon
andTitleVisible
tofalse
.
// Step 2 - Start designing the app.
- Add a label and set
FontSize
to25
,Width
toFill parent
,TextAlignment
tocenter : 1
andText
toSun VS Moon
- Drag out the
CloudDB
component from theStorage
tab. Also drag out theClock
fromSensors
.
- Drag the
HorizontalArrangament
from theLayout
tab, set theBackgroundColor
toNone
and set theWidth
andHeight
to fill parent.
- Drag two
VerticalArrangament
s from theLayout
tab to theHorizontalArragement1
. Set bothWidth
andHeight
toFill parent
in bothVerticalArrangament
s. Set the first arragementBackgroundColor
toCyan
and 2nds toBlack
.
- Add
Label
s andButton
s accordingly and rename all components for easier coding:
// Step 3 - Start coding the app.
- Switch to the
Blocks
tab 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.