Java Game Programming #7 – Collision Bounds

Produce your own Java game from scratch with this very simple, yet very powerful course available right now

In this video we learn how to create collision bounds around our player. If you have any questions then be sure to leave a comment or contact me on twitter; realtutsgml. If you learned something then be sure to leave a like, comment, and favorite.

Have you ever wanted to create games? Have you ever gotten fed up with it being to difficult? Well now is the time to thank me and possibly subscribe because you have just found the channel for you! Game Maker Tutorials, Java Game Programming, Unity3D Tutorials, Batch, C++ and much much more! This is the channel for you, the one stop shop for an exploration of your hidden talent as a game developer. Unleash your potential and go wild with imagination when you finally figure out how to make any game you want!

Visit CodingMadeSimple for more exclusive tutorials and get the help you need to succeed as your very own indie game developer!

Follow me on twitter for exclusive content and interaction with me!

Game Maker Studio: Programming
Game Maker Studio: Tutorial
Java Programming
Game Programming
Game Tutorial
Programming Tutorial


27 thoughts on “Java Game Programming #7 – Collision Bounds”

  1. Hello Realtutsgml, I have been following this series for a while now and would like to give you some suggestions for your videos. First of all, your videos need more content. What I mean by this is you should either make longer videos or post more frequently. Second, you need to set up proper posting dates for each of your videos in a certain series (Ex: Monday=Java Game Programming Tutorial, Tuesday=Uplay, etc). Finally, you might want to add a suggestion poll to this series for what to do next

  2. I ran out of space in the last comment so I will continue here: That's all the suggestions I have as of today, but I just wanted to say thank you for posting great tutorials and acting like your truly into it to help the audience understand the concepts better. Keep up the good work!

  3. Theres a plugin for that.
    Google search.
    Or if you use ubuntu and compiz there is a setting that allows you to invert your screen color by pressing win+n.

  4. I think the way you set your bottom and top bounds to the horizontal middle of the sprite was pretty wonky. Instead of doing x + (width/2) – ((width/2)/2) you could have simply done x+(width/4) and gotten the exact same result.

  5. We are following this tutorial as a programming class project.  When we hit run, we get nothing–no pop-up window, player box, nothing.  All 20 of us independently have this same issue.


  6. I have a fail-safe collision detection system. It looks at where you were the frame BEFORE you collided with the object to determine which direction you came from.

  7. does anyone have a problem with FPS dropping to 1 after a few seconds of opening? the only thing I know to check is g.dispose(); in Game.render();
    I also added g2d.dispose(); at the end of the Player.render(g); and I am still wondering why its dropping until it comes to a stop

  8. new Question, I have a sprite of mario that is 16×28 and I cant get the collision quite right(his head constantly gets stuck when jumping into blocks), any advice?. Or should I stick to all sprites being 32×32 and multiplicative(ex 32×64 or 64×64)? 

  9. Why should we make four colliding detecting boxes? As I see it, we need only one that spans the whole square.

Leave a Reply