
-----------------------------------
Woodbridge
Tue May 20, 2003 8:50 am

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

-----------------------------------
Tony
Tue May 20, 2003 9:01 am


-----------------------------------
you set screen to graphics mode, you should have set it to offscreenonly instead

-----------------------------------
naoki
Tue May 20, 2003 4:59 pm


-----------------------------------
can anyone give me an example where input.keydown is less beneficial than hasch/getch structure?

-----------------------------------
Catalyst
Tue May 20, 2003 5:24 pm


-----------------------------------
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
Wed May 21, 2003 8:27 pm


-----------------------------------
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
Wed May 21, 2003 8:43 pm

nope
-----------------------------------
no u don't i made a pong game w. input.keydown easily!

-----------------------------------
Blade
Thu May 22, 2003 7:37 am


-----------------------------------
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
Thu May 22, 2003 4:04 pm


-----------------------------------
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
