Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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: 19656
    
  18

Moving to Game Development.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Trying to make a Tetris game--why does my board look weird?
 
Similar Threads
any advice?
Turn Based Strategy Games
JApplet
Problem when repainting rectangles
inner class and this