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

Username:   Password: 
 RegisterRegister   
 solitaire help
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Naveg




PostPosted: Sun Mar 27, 2005 11:22 am   Post subject: solitaire help

ok i need some help with solitaire. I'm using pictures to do all the cards, but i dont know how to allow the user to drag a card with the mouse. I know the basic Mouse commands, but the problem is with the constantly changing screen. In a loop i'd have to keep redrawing the screen minus that card, then draw the card on top. How would i do this?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Mar 27, 2005 12:01 pm   Post subject: (No subject)

well how were you expecting to draw the screen when no cards are moving?
Naveg




PostPosted: Sun Mar 27, 2005 12:18 pm   Post subject: (No subject)

well normally when you'd move something you have like a set background, then you loop drawing the background and the piece on top. But here the background is always changing. If i take pic(0,0,maxx,maxy) then it includes the piece i'm about to move, but i want that piece to not be part of the background.
Tony




PostPosted: Sun Mar 27, 2005 12:20 pm   Post subject: (No subject)

tony wrote:
well how were you expecting to draw the screen when no cards are moving?
Naveg




PostPosted: Sun Mar 27, 2005 12:26 pm   Post subject: (No subject)

the screen starts in an initial blank state, with the back of the deck and white boxes for where the card columns will be, the cards are placed by moving with the mouse
Tony




PostPosted: Sun Mar 27, 2005 12:33 pm   Post subject: (No subject)

Great. Draw all of that minus the card to be moved
Naveg




PostPosted: Sun Mar 27, 2005 12:35 pm   Post subject: (No subject)

is there a way to do that taking pic(0,0,maxx,maxy)? cause otherwise i wouldnt know how to do it, cause as i said, whats on the screen is constantly changing.
Tony




PostPosted: Sun Mar 27, 2005 1:01 pm   Post subject: (No subject)

yes, just take a new picture every time you change something on the screen.
Sponsor
Sponsor
Sponsor
sponsor
Naveg




PostPosted: Sun Mar 27, 2005 3:39 pm   Post subject: (No subject)

then how do i capture everything except the selected card...my initial question
Tony




PostPosted: Sun Mar 27, 2005 6:31 pm   Post subject: (No subject)

don't draw the selected card when doing the screen capture.
Naveg




PostPosted: Sun Mar 27, 2005 7:16 pm   Post subject: (No subject)

ok, that makes sense
Naveg




PostPosted: Sun Mar 27, 2005 7:17 pm   Post subject: (No subject)

another question, what would be the best way to keep track of the pictures in each column? have an array for each one?

also, is there a way to lift a picture off the screen without afftecting whats under it?
jamonathin




PostPosted: Sun Mar 27, 2005 8:32 pm   Post subject: (No subject)

I would say have each colomn as a flexible array, and just assign a value to each card in that column, and when it's time to draw, it draws the appropriate amount, and the appropriate cards.
Naveg




PostPosted: Sun Mar 27, 2005 8:34 pm   Post subject: (No subject)

so like....

code:
var columns: array 1..7 of flexible array 1..1 of card


where card has been declared as a type with values suit,value,and picture
Cervantes




PostPosted: Sun Mar 27, 2005 8:46 pm   Post subject: (No subject)

No, that's not allowed!
Because Turing won't let you use a flexible array within a record, or a multidimensional array with the second dimension being flexible, I think this idea is pretty much dead. Well, you could just make 7 arrays yourself, but that's tedious.
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 2  [ 29 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: