Implement an alphabet training program

Hi. I am a beginner in Corona SDK

I want to create a program that teaches the alphabet to children.

First, the letter A is displayed on the screen. At the same time there is a button on the screen that pronounces A.

By touching the letter A, the program shows the letter B. The button then pronounces the letter B.

The only way I can think of is to define the scene as many letters as the alphabet. But I think this is very bad and stupid.

What method do you suggest for implementing this program?

Hey!

I would add the alphabet to a table and then cycle through it, for instance:

local alphabet = {"a","b","c","d","e", ... etc }

Then, as you need to show the text, play audio or check the keyName, you could just use the current table entry. Here’s some pseudo code:

local index = 0
local letter

local function nextLetter()
    index = index+1
    letter = alphabet[index]
end
nextLetter()

-- Then have audio files with the same name and update display object's texts, etc.
audio.play( letter .. ".mp3" )
object.text = letter

For keyEvent listener, you could check if event.keyName == letter to verify if the player pressed the correct key.

1 Like

This is a great idea. Thank you for answering my question :+1: