Java Game Development #13 – Controlling Enemy Bounds

Complete Java Game Development Course now available at my website


In this video we learn how to control enemy bounds. 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!

Outro Song:
Name: Spitfire (Kill the Noise Remix)
Artist: Porter Robinson
Youtube channel: /user/PorterRobinsonMusic

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






33 responses to “Java Game Development #13 – Controlling Enemy Bounds”

  1. pk6 Labs Avatar

    does he get the files back by searching for them in his recycling bin?

  2. SadmanDMCX Shams Avatar

    Hello, Mr programmer,
    i find a different way to randomize the enemy plane
    if (tempEnemy.getY() >= 480-70){
    addEnemy(new Enemy(random.nextInt(Game.width * Game.SCALE – 40), 0, t));

    this is the way i return Y and from enemy class and use this if statement bellow enemy for loop in the Controller Tick method so is there any kind of problem with this, and its working fine. For this i dont need any setter method


  3. TupacDonLegend Avatar

    I tried with if statement but I couldn't figure it out the whole solution

  4. Agus Roth Avatar

    I made it πŸ˜€
    public void tick(){
    if (y >= 458){
    y = 0;
    x = r.nextInt((Game.WIDTH * Game.SCALE));
    y += 5;

    That's the tick from the enemy

  5. Jeremy Chen Avatar

    Shame on me, I sucked.

  6. Bartol J. Avatar

    shame on me πŸ˜€

  7. Spill TheCode Avatar

    I am so glad this tutorial continues!!! It's great to have someone explain why certain things are being used. I know the definitions, but it's a lot different to put it into working order. Thank you for all the tutorials! They are a lot of fun!

  8. TheUltimateGemini Avatar

    fucking hate the controller bullshit, how te fuck do i make my enemy move

  9. Yassin Philip Avatar

    Defragging? Why don't you use a real OS ( and move on? πŸ™‚

  10. PureNrGG Avatar

    I feel way to good about myself doing the random x thing before hearing about it xD it must mean your doing an awesome job teaching me!

  11. 22derekxec Avatar

    hey man just wanted to say love your tutorials! you make it very easy and fun to learn game programming…i also like the shorter tutorials that way i can practice small pieces at a time to fully understand everything. great job!

  12. sami abobaker Avatar

    i did the bottom to top a different way

  13. Owen Hines Avatar

    I feel sad now, I couldn't figure out how to make it so that the Enemy goes to the top when he said to try to figure it out. :'(

  14. Anish Shenwai Avatar

    Thanks to your amazing tutorials, i actually paused it and did it myself
    int the tick method of the enemy:
    public void tick(){

    if(y >=480)
    y = -5;

  15. Joffrey Bieber Avatar

    Thanks for these. Really awesome. I learned C++ recently and wanted to make the jump to java for this sort of thing. Thanks this has been really helpful, but very quick!

  16. RealTutsGML Avatar

    Thumbs up so people can see! the new video is here!! /watch?v=9FGR9HYh0sY

  17. Sociable Snobs Avatar

    Umm can you help me with the collison code?

  18. Markus Jakobsen Avatar

    Well, I guess I'm a little sad… These tutorials got to be some of the best i have found on youtube, and I really like the pace and how you explain things.
    I'm gonna try to stand on my own feet now, and complete this game (as far as I can).

    Just shout out if you want my copy so you can continue! xD Wouldn't mind that at all either, you know ^^

    Thanks for the fun anyways!

  19. Sociable Snobs Avatar

    Wait where is it though!?

  20. TheKodyshaw Avatar

    Thanks for the tut

  21. dmadatawiz Avatar

    No worries!

    Good stuff to date. Like the teaching style you are using.

  22. RealTutsGML Avatar

    It is a bit different from what we have been doing though.

  23. RealTutsGML Avatar

    I am going to upload another one today πŸ™‚

  24. dmadatawiz Avatar

    I hope you pick this series back up. I'd love to see the enemies blow up and also incorporate sound. If the other guy didn't get you the code you need, I just finished the entire series and have the project. πŸ˜‰

  25. dmadatawiz Avatar

    As far as rendering the 2nd, and subsequent enemies, I took the same approach as the bullets.

    //when the Enemy goes off the screen, destroy the object.
    if(TempEnemy.getY() > Game.HEIGHT * Game.SCALE) {
    addEnemy(new Enemy(r.nextInt(Game.WIDTH * Game.SCALE), 0, tex));

  26. Sasha Van de Voorde Avatar

    I send you a message with the download link

  27. RealTutsGML Avatar

    Do it! You will save the series!

Leave a Reply

Your email address will not be published. Required fields are marked *