Scott Miller

Appsguild - Software craftsmanship, project management, and the biz of software

  Home  |   Contact  |   Syndication    |   Login
  153 Posts | 3 Stories | 177 Comments | 72 Trackbacks

News



Article Categories

Archives

Image Galleries

Best Blogs

Podcasts

Scott's links

One week (almost to the minute) until the deadline.

I'm fixing bugs and tweaking gameplay. A few more things to fix on the AI. I am frequently losing, so the AI must be good. I hope to have most of the cards with art work finished this weekend.

I am having one persistent bug. Maybe you can give me advice.

My cards are user controls. Each card has a context menu that I pass from the main form to the card so that when you right click on the card it will play or discard the card. This event handler is in the main form game class. To communicate the current card selected, I am setting a static variable selectedCard, which is then read by the menu event on the main form.

Originally I was setting selectedCard in the OnMouseHover and setting it to null in OnMouseLeave events on the card user control. But that was causing a problem because when the menu fires it fires OnMouseLeave before it calls the menu. I can't use the menu sender object because it says that the toolbar component in the menu is the sender. So I set the selectedCard in the OnMouseUp of the card user control. This frequently gives bugs because selectedCard is not correctly set if cards are being moved or discarded.

Any ideas?

posted on Friday, June 23, 2006 9:17 PM

Feedback

# re: Pesky card bug 6/28/2006 8:32 AM Brian
Why not set the card on the mousedown event instead of mouseup!?!

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 7 and 6 and type the answer here: