• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Thread help with a tetris game

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I am having some trouble with my code, and the main problem is that im not sure what the problem is.
I have a fairly standard game -> canvas -> layer manager setup with 2 threads, one for key checking and one for normal movement setup.
The game is tetris by the way. the problem is, it works well until i happen to be holding the down button and completing a line at the same time, i have tried to figure this out but it makes no sense, i have written synchronized in all the right places (i think) and everything like that but it still does some pretty weird stuff.

If anyone would like to look at this i would greatly appreciate it, someone with more of an understanding of threads would be awesome. and maybe even a little reward for an explaination.

the code for my game is at http://www.michaelrobinsonphotography.com/family/tmp/tetris.zip

Sweet, Thanks
Paul
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


See: Singleton class private constructor woes

Double-Checked Locking is Broken

The issues are not immediately apparent, but the overall game design makes sense except for where is your main() ?
 
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic