Java Game Development #5 - Sprite Sheets

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

In this video we learn how to create sprite sheets into our game and have multiple pictures we can use while efficiently loading them. 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!

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

For future viewers:

You do not need to create a sprite sheet. He's just using one for easy imports and so that he can invoke fewer methods. What's most important is that you use .png images with transparent backgrounds so that you don't wind up with a bunch of squares flying around on your screen.

Also, when encountering errors like you'll see below, add debug scripts to your program. So in every block you ought to keep a "System.out.prinln()" method that tells the user what functions/methods/parts of the programs are running and in what order. You'll be amazed how easy it is to troubleshoot simple errors if you add a printout to each block.

jamesmeyer
Автор

What I like most about your tutorials is that you do a good job of explaining what each part means as you code. Great job and look forward to the rest of the series.

exo
Автор

Right click on the folder, Build Path -> Configure Build Path. Next a window should pop up, click on the Libraries tab, then on the list of buttons to the right, click "Add Class Folder", then check the folder you need to add (res), press OK, then OK again to exit.

makebritaingreatagain
Автор

I enjoyed this episode the most thus far. I have never made a sprite sheet and it was a lot of fun. I used GIMP and it was very easy to do everything you did in Photoshop/Paint.net in just GIMP.

dryerflyer
Автор

How can I get the grid at 1:37 and make the brush snap to the grid? I am using Photoshop 2015 in Adobe Creative Cloud.

nanoic
Автор

Hey Guys the Null error that everyone is getting is due to not making the res folder part of the build path. Depending on the IDE you are using, it will vary how to do it. Google how to add folder to build path and your IDE name. =)

travisl
Автор

Well from episode 1 I added the res folder it was not there to begin with, and I am using the Navigator not the Explorer if that helps, One more thing is I am using eclipse juno. Looks back on episode #1 for help!

RealTutsGML
Автор

Actually never mind that, I found out that I forgot to put the init() in the run method.

Vincent
Автор

Thank you sir - you helped me greatly.
Very well explained. Though I had to alter your code in order to get it working for my platform. The fact that i understood what you did here made the alterations very easy.

balysatm
Автор

Finally! :D I finally found a good Java 2D Game tutorial series!! :D All the other ones I have watched moves WAY to fast ahead without even explaining what the code too! :( But I finally found one! :D Great job and thanks for all your help! :D

Atle
Автор

Yes that means that it is not reading the file correctly.. Make sure you have your res folder set to the build path. Go back to Tutorial 1 to see how to do that.

RealTutsGML
Автор

Maybe Im just stupid but I get this error even if I do everything right
Exception in thread "Thread-2" input == null!
at Source)
at
at main.Game.init(Game.java:30)
at main.Game.run(Game.java:66)
at java.lang.Thread.run(Unknown Source)

proassasssin
Автор

cant find where to save the image to and it is really annoying it wont show up in my computer

bendavey
Автор

Damn, spent 15 mins designing my ship!

nubbitudejack
Автор

some thing is happening to me, the black background does not appear

alexsere
Автор

im using blue jay and im not sure where to save my spiresheet and what path or w.e to use to find it. pleaase help

Theoneortheother
Автор

Hi im getting this error
Exception in thread "Thread-2" input == null!
    at
    at
    at
    at
    at

Im using NetBeans, maybe you know what is the issue ?

Thanks

mvorosila
Автор

When I run the program I just got a blank black screen

LearningFast
Автор

also in the constuctor of spritesheet a warning appears saying that this.image = image has no effect, what should i do? when i run the game dies before the black screen, looks like is not buffering the images well. please help

fma
Автор

on line 14 on the buffered image i keep getting this error come in the console
how do you fix this?

niteskyrider