Java Game Development TUTORIAL - Episode #02 - IMAGES

preview_player
Показать описание
#gamedev #java #images

Time Stamps:
00:00 Intro
00:30 Grid start
02:17 Random class and custom color
07:08 Nested Loop
08:45 Res folder
09:25 InputStream, ImageIO, BufferedImage
12:40 Image to GameScreen
14:28 Drawing the Image
16:18 First Sprite
18:17 Sprite array
22:25 Crash!
23:29 A Grid of sprites
26:00 Next Episode and outro

Hello guys and welcome to the second episode where we add images and make grid out of sprites.

LINKS:

-----------------------------

Wish to support me?
You can do so on:
Everything is appreciated!

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

If you get issues where you cant see anything unless u resize the window:
Fix :
setSize(640, 640);

setLocationRelativeTo(null);
gameScreen = new GameScreen(img);
add(gameScreen);
setVisible(true);

Move "setVisible(true);" to the bottom of the list. In the Game class constructor.
I adress this issue in the next vid ( Episode 03).
Cheers.

KaarinGaming
Автор

EDIT - UPDATE A link to the discord server is in the video description.

FOR PPL ON intelIJ who got issues with the res folder:

I tired inteliJ and got the res folder to work. This is how i did:
1. Add res folder like i did in eclipse, right click on the project, new->directory. Name it res.
2. Right click the res folder, mark directory as -> Resource Root
Done =)
Same code should work ofc.
InputStream is =
Make sure the "/" infront of the image file is not there.

KaarinGaming
Автор

Welcome to the Second episode. We learn how to get Sprites and draw a grid inside our window.
Don't forget to leave a like and subscribe if you enjoy this tutorial.
Take Care!

KaarinGaming
Автор

i love the fact you give timestamps they're super useful

sniffmaster
Автор

Great vid bro, these videos are helping me a lot. I'm surprised your videos don't have more viewers.

CWSCB
Автор

Hey, going to watch all these tutorials, ive just learned everything there is to know about the basics in java in college, and am planning on looking through this tutorial to extend my knowledge. Thank you for these : )

vicke
Автор

este proyecto me ayudo mucho, tenia un error en otro programa que cuando guardaba un arrayList de objetos me daba el error de que era null, ahora me doy cuenta que era por que tenia que inicializarlo en el constructor primero.... thank you!

pransful
Автор

perfeito estava com erro persistente, mais desta maneira que você fez, está ótimo, obrigad

andrefigueira
Автор

The spriteatlas in the GitHub has a width of 320 and height of 96, is the dimensions still 10x10? 20:35

carlandreicabal
Автор

Hello, I'm running into a problem 11:30
and I have the same format as you, but this is giving me an error of...

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

at

On line 17 I have...
public static void main(String[] args) {


Game game = new Game();

}

DooDlezZz-zvhk
Автор

Hey thank you so much for making these videos they are so beneficial. I had a question over the paintComponent method, where and how does paintComponet get called?

velumanohar
Автор

i cant get my sprites to load in my displayed window. i keep getting buffered image error

alexpurdysaltysage
Автор

Hey idk why but when I do the boxes they fit but the last ones get out of the screen, like half inside the view and the other half outside. Do you know why that is ?

simply_gr
Автор

Hi, if someone is struggling with
"Exception in thread" main input == null!" in INTELIJ ->
right click on res folder then "Mark Directory as" and then "Resources ROOT", it work form me

nacs
Автор

Hi man I have a problem. I set size of my window for (640, 640) and draw in dobule loop 20x20 rectangles(32pix) and I can observate that window is not big enought(in width and height) to fit them all but they should from calculations.

janx
Автор

Please Please help me,
so when I try to drag the picture if my res folder it wont do it
I also tried copying and pasting but still wont do it
is there another way I can do it??

farrahzaki
Автор

hey Kaarin Gaming,
the code doesn't load after 12:38 .
I dit everything exactly the same as you.
I am working in VScode.
What I need to do?

mikavanooteghem
Автор

Do you know how to make a resource folder on Visual Studio Code?

DaCodeFather
Автор

hey, I have a problem, whats is this error
'
Exception in thread "main" input == null!
at Source)
at
at
at main.Game.main(Game.java:62)
'

dorito
Автор

Very nice tutorial. Thanks a lot. Please, where can I get the atlas.png file?

lamprosntalkos