Java Game Programming #3 – GameObject




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

In this video we create our GameObject which is what will be the parent for every object we create in the game. That includes the player, enemies, blocks, coins, etc. 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

source

27 thoughts on “Java Game Programming #3 – GameObject”

  1. Yes, but why would someone want to implement them for every Class that extends GameObject? Wouldn't it make much more sense to just implement it directly in GameObject? They seem to be just simple setter and getter.
    It would just make sense to make them abstract if they vary strongly in each subclass, but that doesn't seem to be the case or is it?

  2. I have an error on the line this.id = id; it says the assignment to this variable id has no effect. btw I really appreciate what your doing your really good at explaining things.

  3. I'm curious as to how you set eclipse to auto generate all the method stubs for you as google isn't helping me on bit.

  4. Great tutorials, been doing Java for 2 years now and I just learned what protected actually is, and what abstract does as well. Really helps to know this stuff.

  5. Show us how to make a shop please so we can make a game where people can buy stuff and wear it and have an inventory for it and have a helmet, hands slot etc.

  6. Just a quick note, the Java standard for constants, such as in enums, is all caps, with spaces replaced with underscores. I've noticed that when you've been writing enums, such as with ObjectId, you've used varying standards.
    That said, it does work as intended and there's nothing mechanical that will prevent it from working.

  7. Another note, setters and getters can be written in the abstract class – not every method in an abstract class needs to be abstract, unlike in interfaces.

  8. After i followed everything like the tutorial said, i tried to run the game, but I got this error:
    Exception in thread "main" java.lang.NullPointerException
    at com.[mypackagename].game.main.game.<init>(game.java:23)
    at com.[mypackagename].game.main.game.main(game.java:93)
    Can someone help me?

  9. Great tutorials… is there somewhere I can get the source code for each episode? If that's already been explained, I missed it. Thanks.

  10. when i compile my game it gives me an error on the line of code:

    public abstract ObjectId getId();

    it says it cant find the symbol.

    Please Help!

Leave a Reply