tag:blogger.com,1999:blog-889604442512373664.post3193805918563431679..comments2023-10-31T08:28:52.391-07:00Comments on Computer Programming and Magic: The Gathering: Adventures in Programming: Double ClickingForgehttp://www.blogger.com/profile/15838286606081721333noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-889604442512373664.post-64198620600638742912008-06-07T15:41:00.000-07:002008-06-07T15:41:00.000-07:00Here's one for ya!On mouse over (hovering) a butto...Here's one for ya!<BR/>On mouse over (hovering) a button should appear on the bottom of the card with the name play card instead of double click<BR/><BR/>And one more !<BR/>If a card is played the rest of the cards should regroup! or leave an empty space and at the next draw phase put the new card there to fill<BR/>the gap!<BR/>Obviously I know nothing about programing but i've got plenty of ideas! :DAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-56565738537086863132008-06-06T11:48:00.000-07:002008-06-06T11:48:00.000-07:00Thanks for your comments. Mostly I just had to ma...Thanks for your comments. Mostly I just had to make a decision. It can be changed later. Because how the cards are drawn on the screen you WILL be moving them around, because the program doesn't put a new card into an "empty" space.<BR/><BR/>Hopefully my program will be flexible so the user can choose what they want the left or right button, or what double clicking means.Forgehttps://www.blogger.com/profile/15838286606081721333noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-56486174114406704332008-06-05T05:46:00.000-07:002008-06-05T05:46:00.000-07:00I think you should reverse the buttons. Left mouse...I think you should reverse the buttons. Left mouse button (the most common action) should be for playing the card, and right mouse button for rearranging cards (which isn't primary to the game function)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-20104771967684752992008-06-04T17:20:00.000-07:002008-06-04T17:20:00.000-07:00to do double clicks just slap in a timer.time() th...to do double clicks just slap in a timer.time() that executes different things if there is another click before the timer hits some arbiraty number...<BR/><BR/>but as a gamer...double clicks are awkward. I would much more preferable to do a right click menu or even have buttons at the bottom of the card/menu to execute different things. But that's my opinion its your game.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-35464263093545874712008-06-04T14:55:00.001-07:002008-06-04T14:55:00.001-07:00Ok. All my formatting was screwed up. But you get ...Ok. All my formatting was screwed up. But you get the idea. You only need to save one past click and check for time and distance to determine if the click is a "double"Anonymoushttps://www.blogger.com/profile/17457668532321993957noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-89358085101957031382008-06-04T14:55:00.000-07:002008-06-04T14:55:00.000-07:00Handling double clicking shouldn't be too hard.I h...Handling double clicking shouldn't be too hard.<BR/><BR/>I haven't looked at the code, but if you're grabbing input using event.get, then you should be able to assign a timestamp to each event.<BR/><BR/>Then you just need:<BR/><BR/>def handle_click(click):<BR/> if (distance_between(click, last_click) < dist_threshold) and time_between(click, last_click) < time_threshold):<BR/> handle_double_click(click)<BR/> else:<BR/> handle_single_click(click)<BR/> last_click = clickAnonymoushttps://www.blogger.com/profile/17457668532321993957noreply@blogger.com