How can i make this animation smooth
Author |
Message |
Woodbridge
|
Posted: Tue May 20, 2003 8:50 am Post subject: How can i make this animation smooth |
|
|
I made this program but the animation is not smooth. Can somone tell me what i did wrong.
setscreen ("graphics:450;400")
var pointx, pointy,level,difficult,psize,bouncer,bouncex,bouncey : int := 0
var centy,centx:int:=20
var mover : string (1)
var col,score,endscore: int := 0
var font1:int
process paddle
Draw.FillBox (5, col, 10, col + 100, blue)
loop
if hasch then
getch (mover)
if mover = chr (200) then
col := col + 10
elsif mover = chr (208) then
col := col - 10
end if
end if
Draw.FillBox (5, col, 10, col + 100, blue)
View.Update
delay(20)
cls
end loop
end paddle
fork paddle
thanks |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue May 20, 2003 9:01 am Post subject: (No subject) |
|
|
you set screen to graphics mode, you should have set it to offscreenonly instead |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
naoki
|
Posted: Tue May 20, 2003 4:59 pm Post subject: (No subject) |
|
|
can anyone give me an example where input.keydown is less beneficial than hasch/getch structure? |
|
|
|
|
|
Catalyst
|
Posted: Tue May 20, 2003 5:24 pm Post subject: (No subject) |
|
|
it never is
getch/hasch will always be slower and less useful
the only case that might be presented is less lines
like it would be pointless to use keydown for this:
loop
exit when hasch
end loop |
|
|
|
|
|
Woodbridge
|
Posted: Wed May 21, 2003 8:27 pm Post subject: (No subject) |
|
|
I need the getch/hasch because the program is supposed to be a paddle for the game pong. i have to make it for a school project. but if you have any suggestions on how to do it better please share them.
thanks |
|
|
|
|
|
nate
|
Posted: Wed May 21, 2003 8:43 pm Post subject: nope |
|
|
no u don't i made a pong game w. input.keydown easily! |
|
|
|
|
|
Blade
|
Posted: Thu May 22, 2003 7:37 am Post subject: (No subject) |
|
|
yeah. i prefer to use input.keydown too becuase it runs a hella lot faster. but it's only supported in turing 4.x not 3.x same with View.Set("offscreenonly")/View.Update |
|
|
|
|
|
naoki
|
Posted: Thu May 22, 2003 4:04 pm Post subject: (No subject) |
|
|
i think getch also has the unfortunate feature of needing a buffer when you press keys down too quickly
like when moving a circle, you can flood and make it move after you've stopped pressing on a key |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|