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

Username:   Password: 
 RegisterRegister   
 drawing stuff
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince




PostPosted: Tue May 27, 2003 10:12 pm   Post subject: drawing stuff

anybody hav an idea how i can draw bricks onto a screen (50 of em 10x5) and then take them away wen theyre hit
Sponsor
Sponsor
Sponsor
sponsor
Prince




PostPosted: Tue May 27, 2003 10:15 pm   Post subject: (No subject)

i tried a for loop

code:

for j : 1 .. 5
    for k : 1 .. 10
        Draw.Box (a1, b1, a2, b2, black)
        a1 := b2
        a2 += 40
    end for
    a1 := 1
    a2 := 40
    b1 -= 10
    b2 -= 10
end for


but wen the whole prog loops back around they get erased
Asok




PostPosted: Tue May 27, 2003 10:29 pm   Post subject: (No subject)

if u're gonna keep it like that you'll need an array of booleans, one for each block. So if the boolean = true then it draws it, if it's false then it skips it or draws a white box or whatever.
Prince




PostPosted: Tue May 27, 2003 10:34 pm   Post subject: (No subject)

is ther a way i could do it without the array of booleans
Asok




PostPosted: Tue May 27, 2003 10:36 pm   Post subject: (No subject)

yea, have all the bricks drawn and simply draw over it with a white Draw.FillBox
the have an integer keeping track of how many blocks you have left.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: