Ok this is simple game and simple question.
I have laptop and i added mousedown event that responsible for projectile to shot, BUT IT DOESNT SHOT THE PROJECTILE FOR SOME REASON, HELP ME
I attached the game
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Dec 30, 2012, 1:03 PM EST
I suspect that the MouseMove and MouseDown events are occurring too close together and the code in the latter eventhandler is getting lost.
Try handling the MouseUp event instead of MouseDown which seemed to work OK when I tried it just now.
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 26, 2012, 10:48 PM EST
Prime bRank #2,035 · 712 reputationPosted Dec 27, 2012, 8:12 AM EST
Well just download it from this link
http://www.4shared.com/rar/EPqDla1s/Canon1.html
Prime bRank #2,035 · 712 reputationPosted Dec 28, 2012, 9:56 AM EST
Prime bRank #2,035 · 712 reputationPosted Dec 30, 2012, 2:33 PM EST
You liked the way the game is made?
Any changed you would apply?
Somebody on other forum told me to use thread instead of timer
VulpesRank #55 · 29.2K reputationPosted Dec 31, 2012, 1:24 AM EST
As it seems to be working OK with MouseUp, I'd leave it as it is.
Unless a high degree of accuracy is needed, I'm a big fan of the Windows Forms timer which runs on the UI thread and so you don't need to worry about inter-thread communication which can be a headache, particularly with Windows Forms applications.