Java Beginner Tutorial – Creating our Player Class

[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 our player class in Java. 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.

Last Tutorial –

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

14 responses to “Java Beginner Tutorial – Creating our Player Class”

  1. Vineeth Sai Avatar

    I don't get that part man, could you explain ?

  2. daemon Avatar

    You're the only person who's been able to properly tell me what "this.x = x; this.y = y" actually means.

    Derek Banas even couldn't and he's a god among men… Thanks. 😀

  3. BloodShot Avatar

    Just an FYI, love the tutorial, but i believe you got confused when doing the GlobalPosition constructor. When you say: this.x you are talking about the local variable you called in the constructor, not the integer called in the class. this.x = x; is where the main int variable comes in. Just an fyi for people confused! (:

  4. Gaurav Kumar Avatar

    Since we wrote out own constructor for GlobalPosition (which was a 2-arguments constructor), the GlobalPosition does NOT have the implicit no-argument constructor.
    A default no-argument constructor is provided automatically by the compiler for a class ONLY IF we haven't written down our own constructor.

    The super() method, call the constructor of it's parent. If we do not write a constructor for both parent and child classes, compiler provides an implicit constructor to both of them. So, if child makes a super() call, there is no issue.

    BUT,
    if we wrote a constructor with some arguments for the parent, and the child only has the no argument implicit constructor, the super() call will send no arguments to the parent's constructor. But the parent's constructor needs arguments.
    Hence, we need to create a constructor for the child class as well that has arguments.

    That's why in the Player class, we added a 2-argument constructor. [Since the parent also has 2 argument constructor]

    Also not, if we want a no argument constructor, we need to write it down ourselves. The compiler won't provide that if we wrote any other constructor.

  5. MrCoolkide Avatar

    does super(x, y) = all x and y's?

  6. FreddyPaperview Avatar

    Im trying to wrap my head around the variables concept you laid out here..can you please explain allittle more..Maybe it will come to me in a later video of what happened..

  7. dragonspiral11 Avatar

    When I extend my class it gives me an error. I have my 3 "main" classes in the default classes and the Player in the "object" package and it won't recognize my 3rd class (the GPS one). My class is called (the one I'm trying to extend to) is JFrame_c and Player is my other one which is where the super(x, y) is at.

  8. Omar .M abdelzaher Avatar

    what is the diferrence between Jpanel and JFrame???

  9. smash melons Avatar

    Fucking love the vids dude so great thumbs up

  10. RealTutsGML Avatar

    Watch my Java basics series to learn about Java in its simplest form. It may help.

  11. WoWAsteros Avatar

    thanks was a bit confused when it came to variables because it is fairly different to game maker 😛

  12. RealTutsGML Avatar

    Haha I am glad you are learning,

  13. RealTutsGML Avatar

    So I can extends it from any other class. You can only extends a class.

Leave a Reply

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