Java Game Development TUTORIAL - Episode #08 - LOAD, SAVE and CREATE files - PART 2 / 2

preview_player
Показать описание
#gamedev #java #loadsave
00:00 Intro
00:26 Where we left off
00:37 Get level data
03:45 Utilz class
06:34 Back to GetLevelData
09:33 Save Button
12:22 Save Level
14:55 Utilz Again
17:02 Back to SaveLevel
17:20 Final Testing
17:50 Summary
18:17 Outro and next Episode

Hello, welcome to the second part of this episode.
Last one we learned the basics, now we tie it together with our level data. Can we load and save our level after this?

LINKS:

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

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

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

I was really struggling in my course with the load and save system, but after watching your tutorial I was able to make my own system in my game rpg game, the way that you explains what you are doing it's amazing, thanks a lot

italogercino
Автор

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

Heya. Hope all is well!
Here the second and last part of how to save and load levels.
Hope you enjoy it!
Cheers

KaarinGaming
Автор

Hi, for the first, i rly enjoy your videos.
I have one advice or problem solving for everyone who has different/similar grid like me(I have 1280*800 so my grid is 40x25 tiles).
When you write "ArrayListTo2Dint" don't forget that your int index will be j*xSize+i (becouse it's rectangle so you need width) and similarly in "TwoDto1DintArr" j*twoArr[0].length+i (or j*twoArr[j].length+i)
I believe it will help someone ;)

dominikkosut
Автор

giving your youtube algorithm a boost :)
I didn't like how if you move even a little by mistake the button "fails"
so on release, I made it call clicked again before it resets values to false, and click checks is pressed on top of in bounds...
now they act more like modern buttons where you can click it "down", move away, change your mind, come back and release the mouse button... and that will trigger it :)
off to the next vid :)

PROdotes
Автор

Thank you for these tutorials! I am learning a lot about java and concepts as a whole and I look forward to continuing this series!

One question that I was curious about, would it be possible to just parse the 2D array in LoadSave.writeToFile instead of a 1D array, and therefore not have to use the Utils.twoDto1DIntArr method? Perhaps it has more functionality later on in the series, but at this point in the code, would that be doable?

EDIT: Also realized this would require changing the LoadSave.createLevel() method as well

TatexRedding
Автор

ive watched this video like 5 times yet when i save the tiles it decides not to do work properlly. I would look at your code on your website but the file for the episode is incorrect.

Boomwhat-stjw
Автор

this is nice, i'm learning java so i can make a plants vs zombies clone in the future, also to have a job.. what do you think of it?

vindirect
Автор

Index 40 out of bounds for length 40. I assume it has to do with the for loops in Utilz, but I don't get why the length is 40 if I initialized it to 20 in a different class?

crimdoesstuff
Автор

hi, thank you so much for your videos!
however, I've encountered an issue that you didn't seem to have, and since I'm a newbie in Java, idk how to solve it

in ReadFromFile says: "Unhandled exception type NumberFormatException".
surrounding with try/catch doesn't work when done automatically, and when done manually, it says "No exception of type NumberFormatException can be thrown; an exception type must be a subclass of Throwable"

mrseemsgd