Hey. I have a problem with my simple java game. It's a block breaking game and it's almost done. The last thing to do is make some of the detection methods perfect. The methods should detect if the ball hits one of the blocks in the air. My current code does it well if the ball hits one of the longer sides of the blocks(north and south), but if the ball hits the west or east side of the block, it starts bugging. The ball will move into the block, until one of the current if-tests detects it, and reacts by changing the y-axis direction. When it first reacts like this it may also bring some other blocks with it. This will all be fixed if I can get some rules/if-tests to detect when the ball hits the shorter sides of the block and then changes the x-axis direction. Could anyone help me, please? :)
The block to test is called b, and has the getX/Y/Width/Height methods to call. The ball has the ints ballX, ballY and ballSize. dy and dx are the directions the ball moves. So changing the direction on x-axis is of course dx = -dx;
I really hope some of you guys could help me fix this. Been struggeling all day to get it right. The y-axis test might also need to be fixed for this to work, I actually don't know anymore :s Thanks
Yeah, this was a major miss by MS. Having no way (without 3rd party software or running commands) to see the system time in seconds is just dumb. I get that is uses more battery power, so that is way it was on the notification screen instead of the taskbar itself, that screen isn't up all that often.
I totally agree. I may not love Windows 11, but I agree (and often point out) that the anti-11 hype is way over blown. I kind of suspect that as people are forced off Windows 10 onto the (likely) Windows 11 25H2 we will hear a ton of people acting like Windows 11 is finally usable for the first time. Hey, if that is their opinion, fine, but I can't help but wonder if they would have had the same option had they been forced onto version 23H2 or 24H2.
I have often thought this as well!! Why make a menu when 80% of the time Uninstall is the only option, and the other 20% of the time Repair is the only other option? That UI has plenty of room for those to appear as buttons...which would be more touch friendly too, something MS claims to care about.
People might assume I am a Win11 fan/supporter because I frequently call out what I preserve to either be exaggerations or misinformation about Windows 11. I try not to ever take sides. Just because I disagree with a statement made, doesn't mean I agree with the opposition, or even disagree with the sentiment behind the person making the statement.
I have on occasion gotten in disagreements with people making overly glossy statements about Windows 11 or Windows in general, just like I have (on other forums) gotten into political disagreements with people who are on my side (to the extent having a "side" is even a thing when it comes to complex issues).
Like any human, I am far from perfect, but I try my best to not be dogmatic with my thoughts.
Question
Graimer
Hey. I have a problem with my simple java game. It's a block breaking game and it's almost done. The last thing to do is make some of the detection methods perfect. The methods should detect if the ball hits one of the blocks in the air. My current code does it well if the ball hits one of the longer sides of the blocks(north and south), but if the ball hits the west or east side of the block, it starts bugging. The ball will move into the block, until one of the current if-tests detects it, and reacts by changing the y-axis direction. When it first reacts like this it may also bring some other blocks with it. This will all be fixed if I can get some rules/if-tests to detect when the ball hits the shorter sides of the block and then changes the x-axis direction. Could anyone help me, please? :)
The block to test is called b, and has the getX/Y/Width/Height methods to call. The ball has the ints ballX, ballY and ballSize. dy and dx are the directions the ball moves. So changing the direction on x-axis is of course dx = -dx;
Picture of the situations I need code to detect
Detection code
I really hope some of you guys could help me fix this. Been struggeling all day to get it right. The y-axis test might also need to be fixed for this to work, I actually don't know anymore :s Thanks
Link to comment
https://www.neowin.net/forum/topic/987984-javaproblem-with-gamesimple-block-breaker-game/Share on other sites
9 answers to this question
Recommended Posts