- 0
[JAVA]Problem with game(simple block breaker game)
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By dismuter · Posted
A 10% IPC boost is underwhelming for what is supposed to be a major generational leap. Unless it's accompanied by higher clock speeds, or the IPC boost is greater than 10% in games, I'm not sure that it will be enough to compete with Zen 5 X3D, let alone Zen 6 X3D for gaming. Single-core performance is super important and cannot be compensated with more cores, whereas the reverse is true, you can compensate for fewer cores with better single-core performance. -
By bikeman25 · Posted
Been happy with Windows 11 myself even since first release in 2021, sure it hasn't always been perfect, but nothing is per say.. Issues i did have was minor ones, which is normal with any OS really. I still use Windows 10 at times on my unsupported Gaming Laptop, and i find myself using the Windows 11 Desktop more. Eventually replacing Gaming Laptop with a Windows 11 Compatible one somehow, someway this year or possibly next year at the latest, but its gonna happen--(May save all my Bing reward points except the 1000 to have extended support for 10) then work on getting quality Replacement hard) -
By ZipZapRap · Posted
Geez, this is dumb. I use my laptop sometimes in the dark when doing astrophotography to control my astro-PC... this explains why I have to keep entering my PIN when logging back in. So stupid. I can't see the keyboard in the dark, and I can't have lights everywhere to light it up because everything is very light sensitive (including my eyes!). -
By ThaCrip · Posted
Naturally. I don't care about brand loyalty at all as it's all about price/performance/reliability etc (even what RejZoR said below is a great point to). basically bang-for-the-buck. because at the end of the day... one wants the cheapest possible price to maintain a certain minimum level of performance (or thereabouts). because generally after a certain point with CPU and GPU's the price starts to sky rocket without that much difference in performance where it really matters. p.s. historically I have bought more Intel CPU's and NVIDIA GPU's but I have had some AMD CPU's and one AMD GPU. -
By JayZJay · Posted
Both of these companies as well as Qualcomm and Apple need competition. Otherwise, they just coast. I don't prefer macOS, though I like some of Apple's hardware, but if anyone needs competition, it is Apple. Their prices are already outrageous and they need to have a reason to produce good hardware and at least keep prices remotely reasonable. (It is criminal what they charge for RAM upgrades especially.) Qualcomm needs to push AMD and Intel not to be so sloppy with the performance/efficiency aspect. Granted, AMD has been doing quite well in this respect considering they are not an ARM architecture. I personally want to have more options that truly compete with Macbook Air and Macbook Pro's on the Windows side. It is difficult to achieve what Apple does since they control the entire stack and that is fundamentally different for Windows PCs other than maybe Microsoft Surface PCs.
-
-
Recent Achievements
-
Hartej earned a badge
Week One Done
-
TsunadeMama earned a badge
One Year In
-
shaheen earned a badge
Week One Done
-
Cole Multipass earned a badge
Dedicated
-
Alexander 001 earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
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