*NOTE* I added a line "setup(42, "trunk", true) at 15:05 but I did that just as a "we don't do this way" example, so make sure to delete the line (you'll get NullPointerException error if you keep the line). I've received a couple of messages from people who are getting errors because of this line and now I realized my direction was not clear enough so I apologize for that. Anyways, we handle the trunk image not as a Tile but as an InteractiveTile.
Why not use Tile array we already have? Check if Axe hitbox intersects a tree tile and if it does, replace it with cut tree? All tile entities could get 'life' parameter that would decrease if you used a specific tool and tile would be replaced, if it reached 0.
So what if i want to convert all trees to interactive trees how can i do this + i try to edit TileManager and check if tile map is 41 (Tree code on map) and make TileManager draw new InteractiveTile on each time he will have to draw tree, and it worked but with so much lag, can you make a video about this, please.
Hey, I just wanted to ask if there is any way to set a tile collision true only for NPC and not for player, so player can walk on the tile but the NPC cannot
Would it be possible to basically carry on levelling up until exp is less than the required amount to level up? For instance, if I was on level 1, and I killed a monster for 100 Exp, and the required amount to level up was only 5. How would I make so it would keep on levelling me up until the exp is less than the required exp?
Hey, having a bit of trouble - I made my breakable object tall grass which is 2 tiles tall and and 1 tile wide. It functions perfectly fine, the only problem is that whenever I move far enough down for it to be off screen, it disappears too early. I believe this is because once the top tile of it is off screen it becomes null, making the whole thing disappear. I've been trying everything to fix this but I can't seem to figure it out. Any ideas?
Remember we increased the drawing range by a tile size in the part 5 episode so the black outline won't show up? Increasing the drawing range even more (by a tile size) should fix your issue.
@RyiSnow Hi! I went back and tried doing this and discovered some very interesting things. After experimenting with the tile renderer, i found out that for whatever reason my interactive tiles seem to be completely disconnected the regular tiles rendering process. I even made the render window super small so I could see the black outlines again and the interactive tiles didn't bother disappearing when every other tile did. It seems they ONLY disappear when it goes off the window itself. I'm thinking this is more than likely something I messed up on my end but I don't really know where to look. Thank you for your help regardless!
@@RyiSnow This was it! My problem was that I had not watched episode 33 yet where in which we override the draw method used in episode 32. Thank you so much for your help, them disappearing early was driving me insane and I couldn't figure it out at all.
how do you make it so that when you cut a tree and after a certain time it respawns back? ive added apple trees and i want them to respawn after cutting in like 5 mins
@@RyiSnow ooh thanks! youve actually answered a lot of my questions on twitter and youve really helped a lot, it always makes my day! but the only thing that wasnt solved until now was the monster damage msg wont show up above them
Thank you for this awesome video! That was Definitely one of the extremely useful category! Ps. But what if it's the other way around and it's not predetermined tiles that you can change, but tiles that you want to change yourself, such as making your own path or placing your own barriers? If you want, it would be awesome if you could cover this topic as well. 🙂
For some reason, there are some spots on my map that prevents me from cutting down the trees. I have tested them in other areas, and they work fine. I am also not getting any errors. Edit: It actually does work in those spots, apparently they stop working after cutting down two of them
hey man idk if you worked with multiplayer support but there only few java game tutorials that show how to add multiplayer to the game but even they are super old 8 - 4 years ago. So i wondered if you could make a video on the multiplayer system it does have to for this series but maybe a another series with 4 to 5 videos. But still thanks for the amazing content
Something that has bothered me for a while is that entities will display on top of tiles like the trees or walls. If we convert a tile with collision to an entity and add that to the entityList during the paintcomponent method in GamePanel, then they should render in front/behind entities. I'm trying to solve this on my own, but it's a little tricky. Would you be able to solve this problem in an extra video?
Not literally. You can use the concept and transfer it to Android if you have enough knowledge of Android though. Android uses different classes to handle graphics for example so the syntax will be quite different.
So, I am working on my own project and I wanted to ask something. I have it to adapt to size of the screen (full-screen) I have class which handles that so it scales all values for rendering, but I have this problem, on large screens, the fps drops, whats weird is that fps counter still says its 60, but its surely lower, is there something I could do, other than making players reduce their resolution? Or making the game change resolution of screen by itself?
I know this comment is old, but... "naming conventions" are GUIDELINES... not mandatory. That being said, if you work for a company, or are coding as a team, you should probably follow those guidelines. If you are the solo developer, you should feel free to do as you want. I am sure RyiSnow learned the guidelines and your comment is disrespectful. If you already know java so well... why are you here, learning from a tutorial on RUclips? And, yes... he is here, showing his code to others, using it to help other people, but, you should have a basic to moderate grasp on Java before doing these tutorials, so, you should be able to understand and change the code on your own, after the tutorials are complete... feel free to do that and make your own variable, class and package names. You should really not criticize others when your comment doesn't even use proper capitalization or punctuation... it's basic english, but you're worried about his code?
Thanks for the videos!!! My trees lose damage when I walk on them is there something wrong with my code? public void damageInteractiveTile(int i) { // when damage is given to Tree or others if (i != 999 && gp.iTile[gp.currentMap][i].destructible == true && gp.iTile[gp.currentMap][i].isCorrectItem(this) == true && gp.iTile[gp.currentMap][i].invincible == false) { gp.iTile[gp.currentMap][i].playSE(); gp.iTile[gp.currentMap][i].life--; gp.iTile[gp.currentMap][i].invincible = true; // GENERATES PARTICLE generateParticle(gp.iTile[gp.currentMap][i], gp.iTile[gp.currentMap][i]); if (gp.iTile[gp.currentMap][i].life == 0) { gp.iTile[gp.currentMap][i] = gp.iTile[gp.currentMap][i].getDestroyedForm(); } } }
*NOTE*
I added a line "setup(42, "trunk", true) at 15:05 but I did that just as a "we don't do this way" example, so make sure to delete the line (you'll get NullPointerException error if you keep the line).
I've received a couple of messages from people who are getting errors because of this line and now I realized my direction was not clear enough so I apologize for that. Anyways, we handle the trunk image not as a Tile but as an InteractiveTile.
The best Java game tutorials on youtube 👏👏👏
one of the most essential videos in this playlist so far
The game have a nice oldschool feeling to it. Keep it up =)
@Prabin I agree
@Kaarin Gaming Thank you Kaarin! And yes I'm a very old school guy :P
@@RyiSnow That's great man :)
Thank you very much! You are offering overwhelming knowledge , in very simple words!
Thank you for these videos Ryi! You are an amazing teacher! I hope you will continue this series for a long time
Nice new video! THIS IS BEST SERIES ON YT!!!!
Well done!
Why not use Tile array we already have? Check if Axe hitbox intersects a tree tile and if it does, replace it with cut tree?
All tile entities could get 'life' parameter that would decrease if you used a specific tool and tile would be replaced, if it reached 0.
Thank you!!! This was one my favorite tutorials!!!
Thank you Ryi. Perfect vid.
Hello can I use projectile to clear the InteractiveTile not by axe or attack. Using fireball to burn the tree thanks
None of the trees are appearing when I try it, the physics work like collisions but the images for the trees and trunk won't load.
So what if i want to convert all trees to interactive trees how can i do this + i try to edit TileManager and check if tile map is 41 (Tree code on map) and make TileManager draw new InteractiveTile on each time he will have to draw tree, and it worked but with so much lag, can you make a video about this, please.
I will do that if I make a sandbox game tutorial in the future!
hey did you ever figure this out?
Continue the great work!
Hey, I just wanted to ask if there is any way to set a tile collision true only for NPC and not for player, so player can walk on the tile but the NPC cannot
You just need to disable player's collision check. Then collision won't happen for player.
If you want to have more img?
You hit 1 time one img , 2 time one img . How to do it, I've been trying for a while now
You can change the tile's buffered image based on its life value.
@@RyiSnow so can i do, thanks
Thanks bro.
Awsome as ever!!!
How can I set the monsters to chase the player, please help
We'll handle that eventually.
Would it be possible to basically carry on levelling up until exp is less than the required amount to level up? For instance, if I was on level 1, and I killed a monster for 100 Exp, and the required amount to level up was only 5. How would I make so it would keep on levelling me up until the exp is less than the required exp?
Any github links ??
Hey, having a bit of trouble - I made my breakable object tall grass which is 2 tiles tall and and 1 tile wide. It functions perfectly fine, the only problem is that whenever I move far enough down for it to be off screen, it disappears too early. I believe this is because once the top tile of it is off screen it becomes null, making the whole thing disappear. I've been trying everything to fix this but I can't seem to figure it out. Any ideas?
Remember we increased the drawing range by a tile size in the part 5 episode so the black outline won't show up? Increasing the drawing range even more (by a tile size) should fix your issue.
@RyiSnow Hi! I went back and tried doing this and discovered some very interesting things. After experimenting with the tile renderer, i found out that for whatever reason my interactive tiles seem to be completely disconnected the regular tiles rendering process. I even made the render window super small so I could see the black outlines again and the interactive tiles didn't bother disappearing when every other tile did. It seems they ONLY disappear when it goes off the window itself. I'm thinking this is more than likely something I messed up on my end but I don't really know where to look. Thank you for your help regardless!
Did you change the range in the draw method of the InteractiveTile class?
@@RyiSnow This was it! My problem was that I had not watched episode 33 yet where in which we override the draw method used in episode 32. Thank you so much for your help, them disappearing early was driving me insane and I couldn't figure it out at all.
how do you make it so that when you cut a tree and after a certain time it respawns back? ive added apple trees and i want them to respawn after cutting in like 5 mins
You can use a counter (60 frames = 1 second) or System.nanoTime() to check the time
@@RyiSnow ooh thanks! youve actually answered a lot of my questions on twitter and youve really helped a lot, it always makes my day! but the only thing that wasnt solved until now was the monster damage msg wont show up above them
Thank you for this awesome video!
That was Definitely one of the extremely useful category!
Ps. But what if it's the other way around and it's not predetermined tiles that you can change, but tiles that you want to change yourself, such as making your own path or placing your own barriers?
If you want, it would be awesome if you could cover this topic as well. 🙂
For some reason, there are some spots on my map that prevents me from cutting down the trees. I have tested them in other areas, and they work fine. I am also not getting any errors.
Edit: It actually does work in those spots, apparently they stop working after cutting down two of them
hey man idk if you worked with multiplayer support but there only few java game tutorials that show how to add multiplayer to the game but even they are super old 8 - 4 years ago. So i wondered if you could make a video on the multiplayer system it does have to for this series but maybe a another series with 4 to 5 videos. But still thanks for the amazing content
Something that has bothered me for a while is that entities will display on top of tiles like the trees or walls. If we convert a tile with collision to an entity and add that to the entityList during the paintcomponent method in GamePanel, then they should render in front/behind entities.
I'm trying to solve this on my own, but it's a little tricky. Would you be able to solve this problem in an extra video?
hey did you ever figure this out?
Thanks!
Will there be a video on a map editor that converts the drawn map to a text file?
I'd love to make one but there are still a lot of videos that I have to make before that!
A little late but you can use Tiled, export as csv files, then read them into Java
Hey I have a question, do you use multithreading in this project?
no he uses only 1 thread
is it possible to do this on Android Studio ?
Not literally. You can use the concept and transfer it to Android if you have enough knowledge of Android though. Android uses different classes to handle graphics for example so the syntax will be quite different.
Another idea what about making it possible to be full screen
In the Main class just type
window.setResizable(false);
@@aarushkumar168 but does it scale well
@@aarushkumar168 that wont do anything
So, I am working on my own project and I wanted to ask something.
I have it to adapt to size of the screen (full-screen)
I have class which handles that so it scales all values for rendering,
but I have this problem, on large screens, the fps drops, whats weird is that fps counter still says its 60, but its surely lower,
is there something I could do, other than making players reduce their resolution? Or making the game change resolution of screen by itself?
How do you make it so a speed_potion has a 30 second timer?
Thanks for the video keep it up!!!
1 second means 60 frames so count 1800 frames!
@@RyiSnow oh yeah that makes sense completely forgot to count frames
Have we used frames to time something before?
Hey, after this series is finished will you also make a video on how can we convert this game into .exe file :D
Can't you just google it tho ?
Actually, I've already made a video for that!
ruclips.net/video/h68WlAn_Vfg/видео.html
thank you bro to viedo
nice work. I have done somthing like that :)
Hey its always invincible.
you should really learn how to name things according to the java naming convention
most of your class and package names are poorly named
true but he is surely good at making games!
I know this comment is old, but... "naming conventions" are GUIDELINES... not mandatory. That being said, if you work for a company, or are coding as a team, you should probably follow those guidelines. If you are the solo developer, you should feel free to do as you want. I am sure RyiSnow learned the guidelines and your comment is disrespectful. If you already know java so well... why are you here, learning from a tutorial on RUclips? And, yes... he is here, showing his code to others, using it to help other people, but, you should have a basic to moderate grasp on Java before doing these tutorials, so, you should be able to understand and change the code on your own, after the tutorials are complete... feel free to do that and make your own variable, class and package names. You should really not criticize others when your comment doesn't even use proper capitalization or punctuation... it's basic english, but you're worried about his code?
@@MorrowHopeMusic bro writed an intire paragraph about 1 sentance
@@Melvin-14 Okay?, He explained the issues with your comment and it just happened to take up 1 paragraph no problems with that.
Thanks for the videos!!! My trees lose damage when I walk on them is there something wrong with my code?
public void damageInteractiveTile(int i) { // when damage is given to Tree or others
if (i != 999 && gp.iTile[gp.currentMap][i].destructible == true
&& gp.iTile[gp.currentMap][i].isCorrectItem(this) == true
&& gp.iTile[gp.currentMap][i].invincible == false) {
gp.iTile[gp.currentMap][i].playSE();
gp.iTile[gp.currentMap][i].life--;
gp.iTile[gp.currentMap][i].invincible = true;
// GENERATES PARTICLE
generateParticle(gp.iTile[gp.currentMap][i], gp.iTile[gp.currentMap][i]);
if (gp.iTile[gp.currentMap][i].life == 0) {
gp.iTile[gp.currentMap][i] = gp.iTile[gp.currentMap][i].getDestroyedForm();
}
}
}