Hey RyiSnow, Your channel and tutorials have been a great help for me to learn java. Thank you very much for your kind efforts. I have also edited the Title Screen a bit where instead of displaying the player image, i show the player moving from left to right until it hits the screen. I am further going to edit it more to make it more catchy and beautiful, but all of this has only been possible because of your tutorials. Thank you very much!!
Best tuts I've seen on youtube in years! I've encountered a fairly inconsequential UI bug... when I'm in Character Select and go Back to Title screen the small > (greater than) sign we use to highlight menu items doesn't appear until you press S or W again. I'm sure if I put some thought into it I could figure it out, and I'm sure I wrote this bug myself somewhere and it's not your fault at all. I had to fix a few Null pointer exceptions throughout this video which taught me a lot too.
It's not your fault that the UI was bugged, that's how it was programmed. If you set gp.ui.commandNum = 0; when you hit the back button then it goes back automatically.
I often forget to like the videos. But for your videos I try to like them again and again after forgetting I already did. You're doing a great job, keep going :)
First of all, thank you for making this series RyiSnow, I cannot express how much it has helped me! I have a question in regard to audio. I'd like for the title screen to have it's own audio and then go to the play audio when the player gets past the title screen. The problem is that the audio from the title screen continues to play after the player gets to the play screen. Then, both the title screen music and play music play at the same time. Almost like the music.stop() method is not working. I even set it to stop the music when the player hits pause, but nothing. Could you check to see if it is an error on my end? For reference, I called the music methods in the KeyHandler class. Also, if i call the music.stop() method right after music.play() method it works, but obviously the music never gets played because it was stopped right after it was started.
You need to call the stopMusic() before calling the playMusic(index). I tested in my environment and it worked fine. When I pressed the start button, the title screen music stopped and the play music started.
Tip: add gamePanel.stopMusic(); to the back button on character selection screen. As to avoid multiple instances of music starting and playing over each other.
Hi, I have one question, its possible to do all about map, npcs with your method and screens like title screen or another screen with JavaFX in a .xml, I was working with that for a problem and I don't know how to merge all. Thank you so much for this content!
Hi RyiSnow, love the videos, thank you I wanted to add to my main menu a video on the background, representing the game, makes it feel better than just a simple color, but it seems I can't find a way to implement that, is there any way you could help me with that? Thank you!
Is there a reason you copy and paste things into the } as opposed to just move the }? other than that great vid! I just have been deleting the bracket and placing it where it should go, thugh I can see it would be different when moving it to a totally different place
can anyone help me, i dunno why this happened, but my keyHandler seems kinda a bit bug. "W" and "S" button for title screen works totally fine, but the "Enter" button didnt work at all. And also when i change to playState, all of the button didnt work at all, so the character just stands there, anyone have idea?
Dude, you are amazing.^^ Your series was really helpful so far and there are a lot of vids to go.^^ I guess when we are trough with it, we are selling AAA-Games like no other.^^ 🤣🤣🤣🤣🤣
Those videos are literally my brain savior, thank you so much. But, maybe its in the next episodes (forgive me if it is). Is there any chance there is or will you do a tutorial how to interact with NPC's without needing to move? In the dialogue episode you thought in an amazing way how to program the system, but to interact with NPC I consistently need to move. Is there any option to interact without the need to move?
i know this is old, but is there a way to create a button that you can click, JButton i think, for the menu instead? and another container/panel for that buttons.
A question! How can I change the Fonts to be different from the Title Name and the Menu? Thanks for all your videos! I've been learning a lot and I'll try to keep understanding everything about this. I would love to make my first game on Java, then maybe I'll explore other languages. THANKS AGAIN FOR EVERYTHING!
I have a subscreen of the title that changes the language, a variable called language that defaults to English and also where there are texts that are printed on the screen, I have a conditional for example: if(gp.language == "english) { name = "Key; } else if( gp.language == "portuguese" { ... } however when I click on new game the texts do not change, they remain in English, how do I change the language?
I played a different music in the title screen state and wanted to play a different music in play state, but somehow i can't make use of the stopMusic function to stop titlescreen music from being played during game state, so i currently have both music playing concurrently in playstate any help? :d
If you want to play music in the title screen that doesn't overlap with the game music, you can write gp.stopMusic() and then gp.playMusic(something else than the music used in the title screen): if(code == KeyEvent.VK_ENTER){ if(gp.ui.commandNum == 0){ gp.gameState = gp.playState; gp.stopMusic(); gp.playMusic(0); } if(gp.ui.commandNum == 1){ //add later } if(gp.ui.commandNum == 2){ System.exit(0); } }
I have a question sir, following your code, the getplayerimage method starts at the very beginning. How can I change the appearance of the character in character selection if the getplayerimage method run so early before character select?
I already use if else statement in the getplayerimage method and made variable name character = 0 in the keyhandler so when the user choose character, the character variable value will be changed into 0, 1, 2, 3 then following the if else statement in getplayerimage method. But the problem is the getplayerimage method runs at the beginning before titlescreen or character select screen.
For some reason my cursor doesn't disappear after moving down, If I move down there is a cursor on all three lines and I have no idea how to fix it. Any help would be greatly appreciated.
Hello, ive really enjoyed your tutorials, right now im trying to add a side panel to the game where player information is displayed, can anyone tell me how to do this?
Good afternoon. There is a question about the start menu, after clicking on a new game, I wanted to make a class selection. Created several more types in the entity class, such as warrior, mage and thief. Accordingly, when selecting the magician class in the menu, I would like to assign the type of magician to the player and, depending on the choice, load the default settings of the player corresponding to his class. But the problem is that when the game starts, the default values are already loaded and they cannot be changed : ( Tell me an option to change the default settings of the player. And yes, sorry for my English :D
@@RyiSnow I have tried everything I can think of to do this. I have created seperate player classes, created seperate methods, used the commandNum we set in keyhandler class and no matter what I change I cannot get the seperate classes to draw to the screen. They are there, they have collision and I can move them I just can't see them. Any help would be appreciated. And yes after two years I am still learning from these videos!!!!
@@RyiSnow Is this the best way or is there a better way? BufferedImage Image; try { image = ImageIO.read(getClass().getResourceAsStream("/tiles/water03.png")); g2.drawImage(image, 0, 0, gp.screenWidth, gp.screenHeight, null); } catch(IOException e) { e.printStackTrace(); }
Don't import the image inside of the game loop otherwise, it imports the image 60 times per second and that is a waste of resources. I would prepare the image in the constructor or a method that is processed before the game thread starts.
Hello i find a problem with ur tutorial, so basically i have implement the stop edge camera for the player. But if my player is at the edge and there is a npc there, the npc will move according to our opposite move because of int screenX = worldX - gp.player.worldX + gp.player.screenX; int screenY = worldY - gp.player.worldY + gp.player.screenY; can you help me to solve this problem ? Thank you
hello, i found that this game worked very well when downloading as a jar and sending it to friends until i added a title screen and the other intro screens, do you know why? the key functions work, except that it doesn't register on the game screen until i minimize then maximize the screen again. For example, if I click enter to get to the next screen, it "works" but doesn't show up until i minimize then maximize. Also, my player is gone entirely and I cannot move. Here are things that I can think of that I did differently from you if your exported jar works fine: Added a few extra objects Added randomized order for dialogue Added 3 intro screens including images and text I tried commenting out things that I thought might have impacted it, like extra images i put in the intro screens, the title screen entirely, and it still didn't work. Any idea why it doesn't work if I export it to a jar?
I see. Yeah sometimes what worked on IDE doesn't work when exported as a Jar. I have experienced a similar thing before. By the way, does the Jar still work in your environment?
@@RyiSnow i am not sure what that means, i'm assuming you mean when i click the play button in my ide, in which case yes it does work. also i use intellij if that helps!
do we have to add the character class screen to implement future functions like projectiles and sword? or is it just a complete sample just to get us thinking
Sorry every body, but i got a issue. The little ">" in the title menu do not work, but it work if I change the size of my window. Like I need to press w and go in full screen and then thw little ">" change is place 💁♂️...
Solved my last problem... but now.... the problem is... on the extra screen, the letters on the last 3 lines look black. not white. problem!!! Solution??
If anybody wants I made a simplified method for making already shadowed lines: public void drawShadowedLine(String text, int x, int y, int shadowWidth, int shadowHeight, Color textColor, Color shadowColor) {
Your the first person to actually create a full game in java on you tube. thanks for this!
Seeing a new video of this series makes me happy! Thanks so much for your work!
You're welcome!
Hey RyiSnow,
Your channel and tutorials have been a great help for me to learn java. Thank you very much for your kind efforts.
I have also edited the Title Screen a bit where instead of displaying the player image, i show the player moving from left to right until it hits the screen. I am further going to edit it more to make it more catchy and beautiful, but all of this has only been possible because of your tutorials. Thank you very much!!
Your channel is just amazing!
Please, proceed with your work!
Youre a legend!
Thank you so much for this series, I've had a lot of fun with this the last few days.
Your tutorials need more attention!
Best tuts I've seen on youtube in years! I've encountered a fairly inconsequential UI bug... when I'm in Character Select and go Back to Title screen the small > (greater than) sign we use to highlight menu items doesn't appear until you press S or W again. I'm sure if I put some thought into it I could figure it out, and I'm sure I wrote this bug myself somewhere and it's not your fault at all. I had to fix a few Null pointer exceptions throughout this video which taught me a lot too.
It's not your fault that the UI was bugged, that's how it was programmed. If you set gp.ui.commandNum = 0; when you hit the back button then it goes back automatically.
I often forget to like the videos. But for your videos I try to like them again and again after forgetting I already did.
You're doing a great job, keep going :)
These tutorials are incredible!
First of all, thank you for making this series RyiSnow, I cannot express how much it has helped me!
I have a question in regard to audio. I'd like for the title screen to have it's own audio and then go to the play audio when the player gets past the title screen. The problem is that the audio from the title screen continues to play after the player gets to the play screen. Then, both the title screen music and play music play at the same time. Almost like the music.stop() method is not working. I even set it to stop the music when the player hits pause, but nothing. Could you check to see if it is an error on my end? For reference, I called the music methods in the KeyHandler class. Also, if i call the music.stop() method right after music.play() method it works, but obviously the music never gets played because it was stopped right after it was started.
You need to call the stopMusic() before calling the playMusic(index). I tested in my environment and it worked fine. When I pressed the start button, the title screen music stopped and the play music started.
@@RyiSnow It works, thank you!
Tip: add gamePanel.stopMusic(); to the back button on character selection screen. As to avoid multiple instances of music starting and playing over each other.
tis times eps was so easy to understand especially te keyhandler part
Yooo i fuck up right there can you help ne please ?
Hi, I have one question, its possible to do all about map, npcs with your method and screens like title screen or another screen with JavaFX in a .xml, I was working with that for a problem and I don't know how to merge all. Thank you so much for this content!
Hi RyiSnow, love the videos, thank you
I wanted to add to my main menu a video on the background, representing the game, makes it feel better than just a simple color, but it seems I can't find a way to implement that, is there any way you could help me with that?
Thank you!
One question, all the extra modifications in the following movies they are kept thank you very much !
Omg, thank you so much Ryi, u helped me a lot!
Glad to hear that!
Is there a reason you copy and paste things into the } as opposed to just move the }? other than that great vid! I just have been deleting the bracket and placing it where it should go, thugh I can see it would be different when moving it to a totally different place
can anyone help me, i dunno why this happened, but my keyHandler seems kinda a bit bug. "W" and "S" button for title screen works totally fine, but the "Enter" button didnt work at all. And also when i change to playState, all of the button didnt work at all, so the character just stands there, anyone have idea?
Dude, you are amazing.^^ Your series was really helpful so far and there are a lot of vids to go.^^ I guess when we are trough with it, we are selling AAA-Games like no other.^^ 🤣🤣🤣🤣🤣
Thanks for everything!
Any idea on how to stop the music and play another from the Array?
Cheers!
How could I put a type of scrollbar if the number of options exceeds a limit?
Hello Ryisnow, I have a question. I just added this titleScreen, but now when i start game my movement doesn’t work
I have the same problem, did you solve it?
Thank you for sharing your knowledge , i have a question is possible to add multi player option to online play 👍.
I think it's possible if you have enough server knowledge!
Those videos are literally my brain savior, thank you so much.
But, maybe its in the next episodes (forgive me if it is).
Is there any chance there is or will you do a tutorial how to interact with NPC's without needing to move? In the dialogue episode you thought in an amazing way how to program the system, but to interact with NPC I consistently need to move.
Is there any option to interact without the need to move?
Yeah, that was a bit inconvenient so I fixed it in Part 23. No need to press directional keys to talk to him!
i know this is old, but is there a way to create a button that you can click, JButton i think, for the menu instead?
and another container/panel for that buttons.
A question!
How can I change the Fonts to be different from the Title Name and the Menu?
Thanks for all your videos!
I've been learning a lot and I'll try to keep understanding everything about this.
I would love to make my first game on Java, then maybe I'll explore other languages.
THANKS AGAIN FOR EVERYTHING!
You can set a font on g2 by typing: g2.setFont(fontname). Check Part 16 video for the details!
I have a subscreen of the title that changes the language, a variable called language that defaults to English and also where there are texts that are printed on the screen, I have a conditional for example:
if(gp.language == "english) {
name = "Key;
} else if( gp.language == "portuguese" {
...
}
however when I click on new game the texts do not change, they remain in English, how do I change the language?
save the data in a separate file, as shown in episode 36 or 50
I can't move my character after adding the class selection screen
I played a different music in the title screen state and wanted to play a different music in play state, but somehow i can't make use of the stopMusic function to stop titlescreen music from being played during game state, so i currently have both music playing concurrently in playstate
any help? :d
If you want to play music in the title screen that doesn't overlap with the game music, you can write gp.stopMusic() and then gp.playMusic(something else than the music used in the title screen):
if(code == KeyEvent.VK_ENTER){
if(gp.ui.commandNum == 0){
gp.gameState = gp.playState;
gp.stopMusic();
gp.playMusic(0);
}
if(gp.ui.commandNum == 1){
//add later
}
if(gp.ui.commandNum == 2){
System.exit(0);
}
}
lol thanks bro i was wondering
btw guys u should change playMusic in gamepanel and put the song u want on te menu
Hi RyiSnow! I wonder how to create another character to play. Could you suggest a way to do that? Thanks
I have a question sir, following your code, the getplayerimage method starts at the very beginning. How can I change the appearance of the character in character selection if the getplayerimage method run so early before character select?
I already use if else statement in the getplayerimage method and made variable name character = 0 in the keyhandler so when the user choose character, the character variable value will be changed into 0, 1, 2, 3 then following the if else statement in getplayerimage method. But the problem is the getplayerimage method runs at the beginning before titlescreen or character select screen.
Very nice
i need help with the game menu, everytime i press enter it wont work and i cant fix it can you help?
Nice ! I love your video.
For some reason my cursor doesn't disappear after moving down, If I move down there is a cursor on all three lines and I have no idea how to fix it. Any help would be greatly appreciated.
Thanks!
Can i ask if you will implement the Restart function next?
We will handle that when we implement a game over screen.
Hello, ive really enjoyed your tutorials, right now im trying to add a side panel to the game where player information is displayed, can anyone tell me how to do this?
🥰🥰🥰
Will you go over crafting and building?
How could we display a tile image (like grass01 or water01) as the background of the title screen instead if a color ?
You can use the drawImage method!
@@RyiSnow thank you so much!
Any one no how i would implement a charachter selection screen that upon enter the game brings a different character
Good afternoon. There is a question about the start menu, after clicking on a new game, I wanted to make a class selection. Created several more types in the entity class, such as warrior, mage and thief. Accordingly, when selecting the magician class in the menu, I would like to assign the type of magician to the player and, depending on the choice, load the default settings of the player corresponding to his class. But the problem is that when the game starts, the default values are already loaded and they cannot be changed : ( Tell me an option to change the default settings of the player. And yes, sorry for my English :D
There are a number of ways to do that. You can prepare multiple default values and call them based on the class that you have selected.
@@RyiSnow I have tried everything I can think of to do this. I have created seperate player classes, created seperate methods, used the commandNum we set in keyhandler class and no matter what I change I cannot get the seperate classes to draw to the screen. They are there, they have collision and I can move them I just can't see them. Any help would be appreciated. And yes after two years I am still learning from these videos!!!!
How could I put a background image on the title screen instead of the color?
You can draw images with g2.drawImage
@@RyiSnow Is this the best way or is there a better way?
BufferedImage Image;
try {
image = ImageIO.read(getClass().getResourceAsStream("/tiles/water03.png"));
g2.drawImage(image, 0, 0, gp.screenWidth, gp.screenHeight, null);
} catch(IOException e) {
e.printStackTrace();
}
Don't import the image inside of the game loop otherwise, it imports the image 60 times per second and that is a waste of resources. I would prepare the image in the constructor or a method that is processed before the game thread starts.
@@RyiSnow I imported the image in the drawTitleScreen method
Hello i find a problem with ur tutorial, so basically i have implement the stop edge camera for the player. But if my player is at the edge and there is a npc there, the npc will move according to our opposite move because of
int screenX = worldX - gp.player.worldX + gp.player.screenX;
int screenY = worldY - gp.player.worldY + gp.player.screenY;
can you help me to solve this problem ?
Thank you
Thanks for the report. I just posted the fix in community tab so pls take a look!
ruclips.net/user/RyiSnowcommunity
Okeee ty for ur hard work i will try it now. Thank you
hello, i found that this game worked very well when downloading as a jar and sending it to friends until i added a title screen and the other intro screens, do you know why?
the key functions work, except that it doesn't register on the game screen until i minimize then maximize the screen again. For example, if I click enter to get to the next screen, it "works" but doesn't show up until i minimize then maximize.
Also, my player is gone entirely and I cannot move.
Here are things that I can think of that I did differently from you if your exported jar works fine:
Added a few extra objects
Added randomized order for dialogue
Added 3 intro screens including images and text
I tried commenting out things that I thought might have impacted it, like extra images i put in the intro screens, the title screen entirely, and it still didn't work. Any idea why it doesn't work if I export it to a jar?
the last time i exported it was before the npcs i think, if that helps.
I see. Yeah sometimes what worked on IDE doesn't work when exported as a Jar. I have experienced a similar thing before. By the way, does the Jar still work in your environment?
@@RyiSnow i am not sure what that means, i'm assuming you mean when i click the play button in my ide, in which case yes it does work. also i use intellij if that helps!
No I mean, when you click the jar file (without using IDE), can you still play the game normally?
@@RyiSnow no, if i open the jar i downloaded it does not work, sorry if that is not what you mean
do we have to add the character class screen to implement future functions like projectiles and sword? or is it just a complete sample just to get us thinking
It's just a sample so you don't really need to add that part if it's not necessary for you.
May i have your source code? please
Sorry every body, but i got a issue. The little ">" in the title menu do not work, but it work if I change the size of my window. Like I need to press w and go in full screen and then thw little ">" change is place 💁♂️...
Bruhhh😑...
Never mind 😅...
Solved my last problem... but now.... the problem is... on the extra screen, the letters on the last 3 lines look black. not white. problem!!! Solution??
If anybody wants I made a simplified method for making already shadowed lines:
public void drawShadowedLine(String text, int x, int y, int shadowWidth, int shadowHeight, Color textColor, Color shadowColor) {
x += shadowWidth;
y += shadowHeight;
g2.setColor(shadowColor);
g2.drawString(text, x, y);
x -= shadowWidth;
y -= shadowHeight;
g2.setColor(textColor);
g2.drawString(text, x, y);
}
//////////////////////////////////////////////
I can’t pause the game for some reason now. I have it as gamesState = gp.pauseState;