The Fun with Flags sample app is designed to give us a basic introduction to functions, parallel lists, string matching, APIs and incrementers in Thunkable X.
The UI consists of:
- A row for the scoreboard at the top of the screen
- A column in the middle of the page for the quiz question
- A row at the bottom of the screen for user input
In this app we will need four variables:
When Screen1 starts we’ll add data to our lists like this:
showRandomFlag function is described in the next section:
APIs & Functions
One of the easiest APIs that you can use is provided by countryflags.io. You simply tell it the country code, size and style of flag that you want and it returns a .png image that you can use in your app.
Incrementers & Functions
If the user gets an answer correct we can update the
currentScore variable by one point and then display the value to them like this:
With everything else completed it’s now very easy to check how well the user knows their country flags.
Don’t see your country flag here? Want to add in some extra features? Then please remix this app, I’d love to see how you expand on this basic design.