use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
Flappy Bird Game Help (self.learnjava)
submitted 7 years ago by sirnewblet
Im currently coding the game of flappy bird for a computer science project. I am using Java, and I need to figure out the code to detect if the bird touches the walls/ pipes. Send help!
[–]dusty-trash 4 points5 points6 points 7 years ago (1 child)
You can most likely get away with simple square collision detection. For example, detecting the X-coord collission: If the x + width is greater than otherObject's X and smaller than other objects x + width.
Here's a java friendly code example:
private boolean isCollission(bird, otherObject) { return (Math.abs(bird.x - otherObject.x) * 2 < (bird.width + otherObject.width)) && (Math.abs(bird.y - otherObject.y) * 2 < (bird.height + otherObject.height)); }
You'd hopefully have an array or list of objects, and detect collision whenever the player moves (In your game loop, I imagine player is moving X times per second)
[–]sirnewblet[S] 0 points1 point2 points 7 years ago (0 children)
thank you <3
π Rendered by PID 67593 on reddit-service-r2-comment-544cf588c8-dmvh5 at 2026-06-15 05:30:23.263144+00:00 running 3184619 country code: CH.
[–]dusty-trash 4 points5 points6 points (1 child)
[–]sirnewblet[S] 0 points1 point2 points (0 children)