
-----------------------------------
namby_trojan
Tue May 20, 2008 5:48 pm

Key Jamming speeds up the program, this is a problem........
-----------------------------------
Hi, I've been working on this typing program (started off today) and I've ran into a problem.

I move the text down using pixels and I use getch command to get the character. But the more characters you type, the faster the program becomes. Being said, it also becomes very flickery. The fastest way to see it if you jam the keys. I've been checking all of the variables and i cannot find what's responsible for this. Help? pl0x ? Here's the code.


setscreen ("graphics:600;600,nobuttonbar")


var pic : int
var ch : string (1)
var num : int := 11 %equals to number of words
var num1 : int := 11
var dic : array 1 .. 11 of string
dic (1) := "John"
dic (2) := "Johny"
dic (3) := "Somethingdiffarat"
dic (4) := "Fatt"
dic (5) := "Bobby"
dic (6) := "Car"
dic (7) := "Blank"
dic (8) := "Wank"
dic (9) := "Crap"
dic (10) := "Imagination"
dic (11) := "nithing"
var long, m, another, o : int := 1
var check : string
var font1 := Font.New ("arial:20:bold,italic")
var n : int := 2

process shoot
    Music.PlayFile ("MetalBang.wav")
end shoot



randint (num, 1, 11) %Randomizes the number
process text

    loop



        Draw.Text (dic (num), maxx div 2, maxy - m, font1, gray) %draws text
        delay (100)
        Draw.Text (dic (num), maxx div 2, maxy - m, font1, white) %erases text
    
        if m = 350 then
            m := 0         %