Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Erasing paddle using View.Update
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mike200015




PostPosted: Sun Mar 20, 2005 12:54 am   Post subject: Erasing paddle using View.Update

in my pong game, im making a new section to it.. and i made the paddle.. and the keys to move.. and im using View.Update so when the paddle moves it will show it in the new position.. but it doesnt seem to be working.

code:
var chars : array char of boolean
var ballx := maxx div 2
var bally := 15
var pos := maxx div 2
setscreen ("offscreenonly")
loop
    drawfillbox (pos - 25, 0, pos + 25, 5, blue) %user paddle
    drawfilloval (ballx, bally, 10, 10, 12)                 %ball
    Input.KeyDown (chars)
    if chars (KEY_LEFT_ARROW) and pos - 25 > 0 then  %Moves paddle left
        pos -= 1
        ballx -= 1
    elsif chars (KEY_RIGHT_ARROW) and pos + 30 < maxx then              %Moves paddle right
        pos += 1
        ballx += 1
    end if
    View.Update
end loop

Does any1 know why this doesnt work.. and how to fix it?
Sponsor
Sponsor
Sponsor
sponsor
Bacchus




PostPosted: Sun Mar 20, 2005 1:00 am   Post subject: (No subject)

your not clearing the screen, add a cls either right after the View.Update, or right at the beginning of the loop
mike200015




PostPosted: Sun Mar 20, 2005 1:06 am   Post subject: (No subject)

Idea oohh right right.. forgot about that.. thnx Bacchus!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: