Computer Science Canada

[HELP] create a typing program

Author:  yuhongjia [ Sun Nov 16, 2014 3:00 pm ]
Post subject:  [HELP] create a typing program

Typing Practice Game


I am trying to create a typing program that has letters falling from the top of the screen. The user has to type the letter correctly before it reaches the bottom of the screen. When the letter is typed correctly, a new letter appears at the top. The game ends when the user types the wrong letter or if the letter reaches the bottom of the screen, and it displays score at the end of the game.



I use "chr" and make the random letter appear on the screen, but I don't know how to make it fall from top of the screen.






Turing:


var letter : char
var number : int
randint (number, 97, 122)
letter := chr (number)

var points : int

var myFont := Font.New ("snas serif:22:bold")
Font.Draw (letter, 300, 300, myFont, blue)

var key : string (1)
loop
    if hasch then
        getch (key)
        if key = letter then
            Font.Draw (letter, 300, 300, myFont, blue)
        elsif key not= letter then
        end if
    end if
end loop
put "Your score:"
put "= ", points, " "



: