Java 2D Game Programming Platformer Tutorial - Part 1 - The Game State Manager
Trki, Kody, Cheaty do
READ ME: I will answer all questions under two conditions. (1) You allow other people to reply to your post. If I don't see that reply button, I don't reply. (2) Your question does not imply that you are a beginner programmer. You must be comfortable with Java before watching. I will ignore all questions not following these two rules. IMPORTANT INFO: This is an extremely old tutorial, back when I was a noob at game programming. One of the most destructive parts of this crap code is the multi-threaded key input. Swing puts all KeyEvent firings in a separate thread, so I implore everyone to look at video 9 (final - Artifact game) of this tutorial to check out the Keys class in the source code so as to put all game logic on a single thread. This is a new tutorial series. The game is a tile based, side-scrolling platformer. The goal of this series is about helping you come up with ways to organize your games. About the Background, I just forgot to mod the x and y in the update() method. Just look at the setPosition() method to fix it. IDE: Eclipse http://eclipse.org/ Resources: https://dl.dropboxusercontent.com/u/59779278/Resources.rar All resources are free for any use. Giving credit isn't required, but it would be cool. Link to eclipse project (and Resources) for part 1: https://dl.dropboxusercontent.com/u/59779278/Dragon%20Tale%20Tutorial%20p01.rar Tile Map Editor: https://dl.dropboxusercontent.com/u/59779278/TileMapEditor.rar Killer Game Programming in Java sample: http://fivedots.coe.psu.ac.th/~ad/jg/ http://fivedots.coe.psu.ac.th/~ad/jg/ch02/ch2.pdf Blog: http://neetlife2.blogspot.com/ Other cool stuff: A Java version of RPG Maker in progress. http://www.gamedev.net/blog/1892-gregorys-development-journal/
Komentarze
-
Hey Mike! I keep returning to this video, because I like your voice and narrating, it's somehow very relaxing
There are couple of moments when the IDE auto fills the code, I keep losing to that everytime -
How would I get a gif to play? I'm a little confused on that
-
what do you mean "About the Background, I just forgot to mod the x and y in the update() method. Just look at the setPosition() method to fix it."
I'm not sure what i'm supposed to be looking at in the setPosition() method... -
How do you get the bg.setVector(-0.1,0); to resolve? I keep getting a warning saying that .setVector(double,int) can not be resolved.
-
why does he sound deppressed?
-
this code can be run? to game?
-
I know its 3 years ago, but one question to the Thread in GamePanel.
You subtract the elapsed value from the targetTime value, but this causes an illegalArgumentException beacause the timeout variable is negative. Does this have negative effects to the stability of the program or can i ignore it? -
it's so zoomed in!
-
Why can't i use the resources that I downloaded here, when I compiled it and dragged it into my eclipse resource package,it‘s all garbled code
-
plz help me someone eclipse wont let me run the program it says "The selection cannot be launched, and there are no recent launches"
-
I have created a C++ with SFML version of this game. Ported from your java tutorial to c++ . Here is my github repo for code if anyone wants.
https://github.com/codewithsam/DragonTale -
why is it that eclipse is telling me I need to create methods for setPrefferedSize, setFocusable, requestFocus, addNotify, addKeyListener and getGraphics, typed it all exact same as you and yet have errors, please help because I've used these before and never had a problem, I cant understand it
-
Thank you for zooming the whole video,I can almost see what you did
-
I was getting the same negative number exception. I fixed it in the same way that you did, but my game is frozen. The clouds do not move and the current menu option highlighting, does not change.
-
Have you ever considered remaking this tutorial?
-
You're tooooooo fast.
-
Hey What does the moveScale variable do?
-
The worst tutorial ever. Its not a typing race....
-
Actually, this is not a tutorial..You are just tipping as fast as you can, without any explanation.
It come out and prompted me to go collect a bag with a gun,a flight ticket to Rome and a note that says "Instructions will fallow".
Is that part of the code? cos I was just retyping this while watching Game of Thrones Episode, damn Khaleesi is hot.
look here it prompted me with a code says put this in the comment. Look I am in a rush the taxi is here... I'll just paste this in her bye.
There is a problem with fallowing queries:
g.setColor(titleColor);
g.setFont(titleFont);
g.drawString("Dragon Tale", 80, 70);
// draw menu options
g.setFont(font);
for(int i = 0; i < options.length; i++) {
if(i == currentChoice) {
g.setColor(Color.BLACK);
System.out.print("Human is Lying");
}
else {
g.setColor(Color.RED);
}
g.drawString(options[i], 145, 140 + i * 15);
}
}