Computer Science Canada

Fickers in the Draw.Dot part

Author:  S_Grimm [ Wed May 07, 2008 11:45 am ]
Post subject:  Fickers in the Draw.Dot part

I recently decided that i have way to much spare time on my hands, so i'll work on a Tron Speedbike like game. Exept........the dot keeps flickering.
I'll post the code, if anyone can give me a hand.

Turing:

View.Set ("offscreenonly:600;600")
var x,y : int := 1
var keys : array char of boolean
var bike : boolean := true

procedure BIKE
if bike then
        Draw.FillOval (x, y, 5, 5, green)
        delay (10)
        end if   
end BIKE
loop
Input.KeyDown (keys)
if keys (KEY_UP_ARROW)then
y := y +1
cls
end if
if keys (KEY_DOWN_ARROW)then
y := y -1
cls
end if
if keys (KEY_LEFT_ARROW)then
x := x -1
cls
end if
if keys (KEY_RIGHT_ARROW)then
x := x +1
cls
end if
if (x = 600) then
x := x-1
cls
end if
if (x = 0) then
x := x+1
end if
if y = 600 then
y:= y-1
end if
if y = 0 then
y := y+1
end if
BIKE
View.Update
end loop


Author:  Clayton [ Wed May 07, 2008 12:50 pm ]
Post subject:  RE:Fickers in the Draw.Dot part

What's wrong with your call to View.Set()?

Author:  Asherel [ Wed May 07, 2008 1:18 pm ]
Post subject:  RE:Fickers in the Draw.Dot part

Clayton is right, why are you adding a graphic range for it to check?

Get rid of it and then it should stop flickering. A common mistake that people have encountered before.


: