Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / Java - Unable to keep moving object from going out of bounds

Author
Message
Riz
16
Years of Service
User Offline
Joined: 7th Dec 2008
Location:
Posted: 22nd Sep 2009 00:17
Hey guys i need some help im currently creating a tetris game using JAVA and so far ive been able to have my blocks stop when they reach the bottom of the JFrame and not go out of bounds. My problem is how exactly would i implement the same thing on the sides of my JFrame so when i move my block side to side it will not go off the sides of the screen and stay in bounds i appreciate any help on the matter. Thanks in advance here is my code.


Riz
16
Years of Service
User Offline
Joined: 7th Dec 2008
Location:
Posted: 22nd Sep 2009 00:20 Edited at: 22nd Sep 2009 00:21
This is supposed to be for java i have no idea why it went into ASP/ASP.NET im not sure how to change the category so sorry if there is any confusion
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Sep 2009 13:32
Pseudocode:


BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 4th Dec 2009 08:21
Is PuyoAnimation supposed to be another class that you've written?

And, what are the dimensions of your tetris_<color>.png images? I'd like to get it running so I can get a better understanding of what's going on.

Login to post a reply

Server time is: 2025-05-20 07:36:10
Your offset time is: 2025-05-20 07:36:10