IntelliJ Java IDE
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
Register / Login
JavaRanch » Java Forums » Java » Game Development
Reply 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
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

Moving to Game Development.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
 
subject: Trying to make a Tetris game--why does my board look weird?
 
Threads others viewed
any advice?
Turn Based Strategy Games
Problem when repainting rectangles
JApplet
inner class and this
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com