This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Game Development and the fly likes Trying to make a Tetris game--why does my board look weird? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Trying to make a Tetris game--why does my board look weird?" Watch "Trying to make a Tetris game--why does my board look weird?" New topic
Author

Trying to make a Tetris game--why does my board look weird?

jdawg mcgee
Greenhorn

Joined: Dec 14, 2009
Posts: 1
Hi all. For the final project in my introductory comp sci course, I've been instructed to recreate Tetris in java. I have been having some difficulties getting the board to display properly--the board that shows up on the screen has too many cells (in the paintComponent method of GameBoardPanel, change fillRect to drawRect and you'll see what I mean), and when I add blocks onto the board, the display sometimes shows additional unintended colored cells. Also, my canItFall method doesn't seem to be working properly, and I get the feeling that this might be a related problem issuing from the same cause.

I have posted my code thus far below (I've attached most of the code including one of the specific Tetromino block classes, though I'm fairly certain the problem is in GameBoardPanel). I tend to write/debug my codes as I go, hence the "under construction" appearance. I hugely appreciate any help you guys have to offer, as well as additional comments or suggestions on how I can improve my code/where I should go from here. Thanks!












Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Moving to Game Development.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to make a Tetris game--why does my board look weird?
 
Similar Threads
JApplet
Problem when repainting rectangles
any advice?
Turn Based Strategy Games
inner class and this