Java Game Programming #11 – Level Design

[ad_1]
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 levels with paint.net and load them into our game. Makes creating levels much much easier. 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


Posted

in

by

Tags:

Comments

36 responses to “Java Game Programming #11 – Level Design”

  1. Lurker05 Avatar

    Replace the render method in the Handler class with this code to make your game run faster:

    public void render(Graphics g, Camera cam) {
    for(int i = 0; i < object.size(); i++) {
    tempObject = object.get(i);
    if (tempObject.getX() > -cam.getX() – 32 && tempObject.getX() < -cam.getX() + 800) {
    if (tempObject.getY() > -cam.getY() – 32 && tempObject.getY() < -cam.getY() + 600) {
    tempObject.render(g);
    }
    }
    }
    }

    and also in the Game class render method under the
    g2d.translate(cam.getX(), cam.getY()); method

    change handler.render(g);
    to
    handler.render(g, cam);

  2. Emerald Gaming Avatar

    Can someone help? My level works but some of the squares gently overlap each other. Why is that?

  3. Bot Avatar

    I'm getting an out of bounds exception and my image is 512, 512. What am I doing wrong?

  4. Tul Pe Avatar

    I'm really thankful for this videos.

  5. Russell Voss Avatar

    In Eclipse.Mars, the build path doesn't give us the option to add a class folder. What do I do?

  6. Manfred Orse Avatar

    most epic shit i've ever seen
    this is some valhalla nirvana extasy for me, thanks for showing <3

  7. Alex Boreham Avatar

    My player isn't showing up

  8. ran sayada Avatar

    hello , i stuck all day on the two last seconds in this video i swear i got the same thing that he did in the video and yet i dont see any levels :O

    what should i do ????

  9. Maurice de Jong Avatar

    in the for loop, you said "xx<h" and "yy<w"
    I think you accidentally switched them, but because you had a square map,
    you didn't get any errors.

  10. DLC ENERGY Avatar

    8:22 that scream… :} (got somebody in the cellar there Tuts? jk… lol)

  11. Zuhair Mehdee Avatar

    These tutorials are amazing!! Liked and Subscribed 😀

  12. FalconAlliance1337 Avatar

    Gotta say thanks bro. This series is amazing.

  13. szczypiorofixable Avatar

    Great tutorial! It helped me a lot. Thank you! 🙂

  14. HuntedGamerFilms Avatar

    What if I want to make a level without blocks that has like hills and trees? Can you make a tutorial for that?

  15. trophus naamkrijgjeniet Avatar

    Very nice tutorials, just blasted through the first 11 and decided to throw you some likes. Which is something I rarely ever do on youtube. Cheers man.

  16. Ryan Cunningham Avatar

    If anyone has a problem with getting your Player() to show up on the screen, make sure the pixel you painted is actually 0,0,255 and not 0,38,255 or something

  17. space1188 Avatar

    Can you at least explain some of the things you are doing. you cant expect everyone who is watching to know every single thing.

  18. WitX916 Avatar

    i know this is old, but can the steps/code be used in netbeans as well?

  19. Ryan K Avatar

    At 3:20 why are you dividing by 32? why can't you use the full image

  20. Jordon~C Avatar

    soooo awesome…easy to understand too.

  21. Alfredo Eleazar Orozco Quesada Avatar

    AMAZING!!! I'm following the entire series.
    It's fantastic!

  22. Ito Manu Avatar

    When I have level with a lot of blocks inside, the FPS is drop to 4 and TICK to 5, please help!

  23. Jason Zimmerman Avatar

    also anyone using gimp, after you file, export to your res folder. make sure you right click your project and refresh, even after every update to your level.png drawing. if that doesn't work click project clean from the top menu bar. that helps when importing stuff into your project. Hope these posts help someone.

  24. Jason Zimmerman Avatar

    top to bottom. handler first,                             cam next line,                             Load next line. Damn post screwing with my spacing

  25. Jason Zimmerman Avatar

    Any one having trouble loading their level. and getting the null pointer exception in your console. it's because handler = newHandler(); was moved off camera. Happens in just about every game tutorial I watch. I think it happens because they have to prepare exactly what their gonna do before recording so their not trying to figure everything out on the fly. anyway he moved that.  You should have these 3 things in this order in Game class.    handler = newHandler();               cam = newCamera(0,0);               LoadImageLevel(level); I think as long as you create a new handler before LoadImageLevel is the important part. Took me a while to figure out. and I see there are a bunch of people that had this same issue. Didn't see them getting any help. I hate that.

  26. AdamPodGaming Avatar

    By the way, when I try to export the game, it says "JAR export finished with warnings. See details for additional information.
    Exported with compile warnings: Java Platformer/src/com/adam/java/objects/Player.java" and when I double click the jar file, it just gives me a blank frame! Do you know a way to fix it?

  27. AdamPodGaming Avatar

    WOW THIS IS SO COOL THANK YOU!!!!!!!!!!!!!!!!!!! 😀

  28. Sunday Lanre Avatar

    I like your tutorial, i cause those that dislike dis video. Great video. thank GML

  29. Mat Avatar

    If anyone else is having problems with the player moving around unexpectedly, like when jumping, the problem (at least for me) was with the collisions.

    I fixed the biggest problem by adding the following to the 'bottom' collision:
    y = tempObject.getY() – height;

    This tells the game that when the collision occurs, to set the PLAYER y position to be equal to the y position of the object it is colliding with – the height of the player.

    Seems to be that all x and y positions for objects are the top left corner of the objects, at least by default.

  30. Sam Deacon Avatar

    I wish i could give you more than 1 like dude!

    But I skipped ahead and it looks like the series ends at #17 without fully finishing the project? (or is the idea just to get us started)

  31. Jim Kryer Avatar

    +RealTutsGML 
    Just wanted to say that the reason behind the errors of a not – square level is because you have consistently mixed up your x and y dimensions in looping through the image. If you switch the two around, then it works fine with any dimensions.

  32. Adam Brodin Avatar

    This is awesome! Great job 🙂

Leave a Reply

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