Java Game Programming #3 - GameObject

preview_player
Показать описание

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 fun learning!

Рекомендации по теме
Комментарии
Автор

I love this more advanced coding, I've been learning java for a few months now and I think I'm getting a hang of it. Thanks Realtuts

MegaPonokio
Автор

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.

renbinden
Автор

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.

renbinden
Автор

Later on we will be adding some gravity methods that only the player would need compared to say the coin.

RealTutsGML
Автор

Why are the getters and setters of GameObject abstract?
Wouldn't it save much work if you just did that what you did in the Test class, in GameObject?
Or do the getters and setters vary so much in the different "real" objects?

Mobin
Автор

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.

SgtMajSquish
Автор

you have inspired me to start programming, i hope you keep the series up

BoaRDerLIINsaNiTy
Автор

Loving the work keep it up i am not following you with your program as i am game programmer myself but like to say i like watching you program and how clean you code is keep up the good work :)

PSTutorialGaming
Автор

why did you make the getters and setters abstract? you can just do em in the Game Object, or will something bad happen?

bastian_
Автор

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

braveecologic
Автор

Really nice, you are the best, i havent got any issues you explain this perfectly

miguelangelguerrero
Автор

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.

MachoLuke
Автор

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?

Mobin
Автор

This is a very late comment, but when I made the test.java, I ran into only ONE error. The other error which implemented the graphical stuff never showed up. Is this because I'm using a newer version?

rightyloosey
Автор

are int, double, float, etc. also enums ?

arjavgarg
Автор

Keep up the good work:D ! Learning a lot! :) Thanks for making this!

goldenflex
Автор

After i followed everything like the tutorial said, i tried to run the game, but I got this error:
Exception in thread "main"
at
at
Can someone help me?

iCryptos
Автор

KEEP THOSE OVERRIDES IN YOUR CODE THEY ARE IMPORTANT

mellow-yellow-jello
Автор

What's the point of an abstract class when you can just copy and paste?

skrey
Автор

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.

MinecraftGamer
join shbcf.ru