Super excited to see another tutorial! Your explanations are very clear and have helped me a lot. I only have a couple of videos left in the 2D tutorial and I'm looking forward to tackling this one when I'm ready.
This looks way more fun than using a Game Engine. And not only that its more fun, but its a great way to learn more cause its so challenging ! Amazing work Ryi .
Thank-you so much for the tutorial! It's always so cool to see how people handle these kinds of projects differently and your take was very simple and straight-to-the-point, which I find to be one of the best things about your channel! I can't wait to see what else you have planned in the future and wish the best of luck to you!
Thank you so much for this video. You've inspired me to study programming on my own. I don't know if I ever make a career out of it, but I really like it as a hobby :) Keep up the good work, RyiSnow!
this tutorial is great, i followed it the whole way through besides some of my own design changes for a school project. Ive learnt so much more than i would if i tried to make my own original game
this is really awesome. Just finished following this over 2 days (!) I have found this really good in writing my own projects using your code as a template for how to do things the right way! Many thanks - I look forward to seeing more excellent content.
I picked up Java as my first computer language and I can't thank you enough for these tutorials. You are literally the best Java teacher on CZcams. А еще меня заставили: Ю хев ошибка Ин ер коде
I have been very excited for this since I saw tweet about the tutorial. It's always exciting to see an upload from you!! I learned so much from your videos 💕
I finally finished this tutorial, the end result looks really cool! When testing the Sound class at about 1:26:12 I kept getting a null pointer exception for the Clip object, which seemed to indicate the file paths for the wav files weren't being read correctly. After checking the Sound class for typos and not finding any, I eventually figured out that the res folder wasn't included as a resource in the project's build configuration by default. If anyone runs into this situation while using Eclipse, the steps I took to fix it are: 1. Right-click on your project in the Project Explorer and select "Properties" 2. Select "Java Build Path" from the menu on the left 3. Click "Add Folder", check the "res" folder in the window that pops up, hit OK, and then "Apply and Close". This allowed the res folder to be recognized, stopped the null pointer exception and now music & sound effects play perfectly. :) It's kind of weird because I've never had this issue before. I could always just create a folder, add the sound files and it would work without any extra steps just like it did in the tutorial. So maybe it had to do with me recently moving my projects around on my hard drive? I'm not sure. Anyway, thanks for another awesome tutorial, Ryi. I'd love to see more tutorials for classic games like this. I appreciate your hard work.
@RyiSnow OH woops, I thought I followed what you did at that timestamp exactly, but turns out that I selected "Folder" instead of "Source Folder". That explains it. 😄
PlayManager class 68 line: While the value is 7, Mino Z2 does not fall out, if you change it to 8, then everything works, since now we take into account 0 and count from 0, not from 1
@@RyiSnow His tutrials are good, but his pace of explanation, wiriting, scrolling are too fast so its hard to chatch up for beginners.. I hope your version of platformer tutrial too!
I love your videos, and have been working on your 2D Game tutorial and want to make a video walking through it. What screen recording software do you use?
Man, i'm having a problem and I was wandering if you could help me. On the Auto drop step, when i put the "gp.launchgame" the mino simply disapears and I dont know why, can you help me?
Actually, you should put the "repaint" method outside that if. You should update in every possible moment, it's good to limitate the update but the render should be outside.
hey @ryiSnow. i've been following your code very carefully but at doing the auto drop part when i tried calling the gp.launchgame, i dont see any blocks falling but before i call the gp.launchgame its just floating and not moving just like yours.
Hey! I've ran into an issue, I tried adding a 1x1 mino, but it didnt work. I tried putting all 4 cubes in 1, but then the line breaker didn't work, then I tried just removing other 3 parts, but then it had some bugs. Could you please help me?
Love the tutorial so far! Quick question about the auto drop, I called launchGame in the main class and it seems to not be running after doing that as well. Was wondering if you have any thoughts as to why? Thank you and great content!
@@RyiSnow Yes I saw that my if statement in the game loop was not in the implementation of the while. Hence why it was not running. Thank you for responding!
Hello Ryisnow unfortunately I can't fix issue. I can't replace the current mino with next one. when Im writting if bottomCollision than else and autoDropCounter. but it does not work please check f you can: package Main; import java.awt.Color; import java.awt.Graphics2D; public class Mino {
public Block b[] = new Block[4]; public Block tempB[] = new Block[4]; public int autoDropCounter = 0;
public int direction = 1; public boolean leftCollision, rightCollision, bottomCollision; public boolean active = false;
public void create(Color c) {
b[0] = new Block(c); b[1] = new Block(c); b[2] = new Block(c); b[3] = new Block(c); tempB[0] = new Block(c); tempB[1] = new Block(c); tempB[2] = new Block(c); tempB[3] = new Block(c);
2:12 I am getting NullPointerException for // window.setLocationRelativeTo(null); // please tell how to fix Exception in thread "main" java.lang.NullPointerException: Cannot read field "x" because "p" is null at java.desktop/java.awt.Component.setLocation(Component.java:2191) at java.desktop/java.awt.Window.setLocation(Window.java:956) at main.Main.main(Main.java:17)
Hey nice video !! I'm using your video for training my java haha. But i'm stock because I use intelij. Is someone here using intelij ? because at 5:29 you telling us to add unimplemented methods but can we do that on intelij ?
If it doesn't show up in your environment, you can manually type the run method. I just used the auto-fill function of Eclipse. I'm pretty sure IntelliJ also has a similar function though.
@@RyiSnow thank you :) but I have an other bug. I check all of my code but I dont found the bug... the left, top and right colision of the static mino's are OK But the left side have no colision. I review the chapiter colision but I didnt found any diffence btwn my code and your code. can you help me pls ?
Hey Ryi! I wanted to know if you could do a candy crush on java, im studying computer science in Argentina and that is my class first proyect for this semester. Im actually really stressed and nervous about it so it would be the best of helps and reliefs if you could do it. Thank you and I love your videos
Thank you so much for the video ❤❤ but the static boolean variables upPressed,downPressed... doesn't work in the class Mino(KeyHandler.upPressed...) please inform me to solve this problem
Hi Ryi, thank you very much for this video. I am having some trouble though when creating the first mino. When running the project, it returns the error: Exception in thread "main" java.lang.NullPointerException: Cannot assign field "x" because "this.b[0]" is null. Could anyone help me please?
At 22:02, when I type in Block.SIZE, it shows an error that it cannot find symbol variable for Block. In the mino class I did make it a public array, so not sure why its not finding the symbol. Otherwise, great video so far!
The goat is back
Super excited to see another tutorial! Your explanations are very clear and have helped me a lot. I only have a couple of videos left in the 2D tutorial and I'm looking forward to tackling this one when I'm ready.
I've been waiting for your new tutral!!
新しいチュートリアルずっと待ってました!
I know some of those, I recognize Shi, Ri, Su'', Tsu, Te, Ma, Ta
So great to have new videos from you. Currently following your Java tutorial for creating my 2D game, thank you!
I picked up Java as my first computer language and I can't thank you enough for these tutorials.
You are literally the best Java teacher on CZcams.
Glad you liked them and good luck with your learning!
Thank you legend, this is just awesome. Your coherent and elegantly paced explanation makes it easy to follow and learn the concepts.
This looks way more fun than using a Game Engine. And not only that its more fun, but its a great way to learn more cause its so challenging ! Amazing work Ryi .
Gonna give this a go after I make more progress on your Java adventure game. Thanks!
Happy to hear that!
@@RyiSnow Hello! What University are you at?
I can't thank you enough for these videos, you are an excellent teacher, plus I love your accent!
Thank-you so much for the tutorial! It's always so cool to see how people handle these kinds of projects differently and your take was very simple and straight-to-the-point, which I find to be one of the best things about your channel!
I can't wait to see what else you have planned in the future and wish the best of luck to you!
Thank you so much for this video. You've inspired me to study programming on my own. I don't know if I ever make a career out of it, but I really like it as a hobby :) Keep up the good work, RyiSnow!
Love your videos! Thanks so much for uploading a new tutorial.
this tutorial is great, i followed it the whole way through besides some of my own design changes for a school project. Ive learnt so much more than i would if i tried to make my own original game
Glad to hear that!
this is really awesome. Just finished following this over 2 days (!) I have found this really good in writing my own projects using your code as a template for how to do things the right way! Many thanks - I look forward to seeing more excellent content.
As always, amazing vid man!
Glad you like it! Gracias for the support🙏
I picked up Java as my first computer language and I can't thank you enough for these tutorials.
You are literally the best Java teacher on CZcams.
А еще меня заставили:
Ю хев ошибка Ин ер коде
I always look forward to your uploads! They always inspire me to keep coding! Thank you :D
love videos like this, would love to see more videos of you making some retro game clones :D
I have been very excited for this since I saw tweet about the tutorial. It's always exciting to see an upload from you!! I learned so much from your videos 💕
pls continue making this content... ur way of teaching is awesome.. specially inbetween topic/method explanation. thanks
Beautiful Video. Keep Coding. Also please complete Rayndia. I wish we could see the final result one day.
I will most certainly complete Rayndia! I've been working on it behind the scenes and hopefully release a demo next year :D
Thank you very much. It's crazy that such legendary games can be so easily replicated in just few hours
I finally finished this tutorial, the end result looks really cool! When testing the Sound class at about 1:26:12 I kept getting a null pointer exception for the Clip object, which seemed to indicate the file paths for the wav files weren't being read correctly. After checking the Sound class for typos and not finding any, I eventually figured out that the res folder wasn't included as a resource in the project's build configuration by default. If anyone runs into this situation while using Eclipse, the steps I took to fix it are:
1. Right-click on your project in the Project Explorer and select "Properties"
2. Select "Java Build Path" from the menu on the left
3. Click "Add Folder", check the "res" folder in the window that pops up, hit OK, and then "Apply and Close".
This allowed the res folder to be recognized, stopped the null pointer exception and now music & sound effects play perfectly. :)
It's kind of weird because I've never had this issue before. I could always just create a folder, add the sound files and it would work without any extra steps just like it did in the tutorial. So maybe it had to do with me recently moving my projects around on my hard drive? I'm not sure. Anyway, thanks for another awesome tutorial, Ryi. I'd love to see more tutorials for classic games like this. I appreciate your hard work.
Or you can directly create a resource folder as I did in the video! 1:21:06
@RyiSnow OH woops, I thought I followed what you did at that timestamp exactly, but turns out that I selected "Folder" instead of "Source Folder". That explains it. 😄
This is awesome, thanks for the new vid!
Hi, why are you using eclipse and not intelij ?
I thank you for making this code, it is very well explained and complete, greetings from Mexico!!! ❤️🇲🇽
BRO I JUST LOVE YOU !
PlayManager class 68 line:
While the value is 7, Mino Z2 does not fall out, if you change it to 8, then everything works, since now we take into account 0 and count from 0, not from 1
Love your videos ! Keep it up !
ur the best ytber i ever know
thank you!! pls how to make 2d platformer ... You are the best person to explain game programming using Java
Check the @KaarinGaming channel! He did a nice 2D platformer tutorial series ;)
Thank you.. but your explanations are good and easier for beginners@@RyiSnow
@@RyiSnow His tutrials are good, but his pace of explanation, wiriting, scrolling are too fast so its hard to chatch up for beginners.. I hope your version of platformer tutrial too!
Welcome back king❤
Thanks for making these!!
LOVE your videos! I have a quick question though... what font are you using? lol
I love your videos, and have been working on your 2D Game tutorial and want to make a video walking through it. What screen recording software do you use?
loved this!
Man, i'm having a problem and I was wandering if you could help me. On the Auto drop step, when i put the "gp.launchgame" the mino simply disapears and I dont know why, can you help me?
Awesome video, as always! I am glad you enjoyed coding Tetris. You are incredible, Ryi!
You're so awesome man.
Hello, could you tell me what application are you using to code in java? (I'm new to programing)
Also, how much time did it take to you to make it?
Been looking for a good reason to use Java again
Actually, you should put the "repaint" method outside that if. You should update in every possible moment, it's good to limitate the update but the render should be outside.
Can anyone help me how do I add the music on intelij that's the only part I'm missing
I love it thanks !
can you please tell that how did you change the color theme of netbeans. which one is yours?
hey bro nice tutorial! keep it up, and can i ask you a favor? can i get the source code of this project?
why does mine say cannot read field "x" because this.b[0] is null am i missing something
hey @ryiSnow. i've been following your code very carefully but at doing the auto drop part when i tried calling the gp.launchgame, i dont see any blocks falling but before i call the gp.launchgame its just floating and not moving just like yours.
Hey! I've ran into an issue, I tried adding a 1x1 mino, but it didnt work. I tried putting all 4 cubes in 1, but then the line breaker didn't work, then I tried just removing other 3 parts, but then it had some bugs. Could you please help me?
Hi. Great tutorial!! Would you know how to add an instant drop function to the game?
ia have a question, in this tetris there is just one thread right?
how come yours mino is moving and rotating fast and mine is so slow?
This is timeline for my own studying
44:55
thanks... Amazing video!
Love the tutorial so far! Quick question about the auto drop, I called launchGame in the main class and it seems to not be running after doing that as well. Was wondering if you have any thoughts as to why? Thank you and great content!
Is your game loop running?
@@RyiSnow Yes I saw that my if statement in the game loop was not in the implementation of the while. Hence why it was not running. Thank you for responding!
@@RyiSnow I do have another qs regarding the rotation. For the upPressed key for W on the keyboard, it would not work for the rotation. Any thoughts?
Thanks RyiSnow, you are Awesome..:)
How would you go about approaching a cutscene intro animation - before a game starts? Mega-Man
at 13:01 I have written the code as it is but instead of a white border my whole window is turning white...how can I solve this?
@@ga8r13l naah
so that is a great video thanks a lot.
Help mine still go out the box but my codes are right
The collision part doesn't work. I've rechecked it, nothing seems to be wrong
the GOAT
Theres no error when i run it but the collision didnt work for me i checked it many times i cant see why it wont work
Your are the best
Can you do a 3D game from scratch?
can you share the code files? i am lost somewhere
Do you have a source code for this tutorial?
hi snow i cannot get the sound part in my project
Hello Ryisnow unfortunately I can't fix issue. I can't replace the current mino with next one. when Im writting if bottomCollision than else and autoDropCounter. but it does not work please check f you can: package Main;
import java.awt.Color;
import java.awt.Graphics2D;
public class Mino {
public Block b[] = new Block[4];
public Block tempB[] = new Block[4];
public int autoDropCounter = 0;
public int direction = 1;
public boolean leftCollision, rightCollision, bottomCollision;
public boolean active = false;
public void create(Color c) {
b[0] = new Block(c);
b[1] = new Block(c);
b[2] = new Block(c);
b[3] = new Block(c);
tempB[0] = new Block(c);
tempB[1] = new Block(c);
tempB[2] = new Block(c);
tempB[3] = new Block(c);
}
public void setXY(int x, int y) {
}
public void updateXY(int direction) {
checkRotationCollision();
if(leftCollision == false && rightCollision == false && bottomCollision == false) {
this.direction = direction;
b[0].x = tempB[0].x;
b[0].y = tempB[0].y;
b[1].x = tempB[1].x;
b[1].y = tempB[1].y;
b[2].x = tempB[2].x;
b[2].y = tempB[2].y;
b[3].x = tempB[3].x;
b[3].y = tempB[3].y;
}
}
public void getDirection1() {
}
public void getDirection2() {
}
public void getDirection3() {
}
public void getDirection4() {
}
public void checkMovementCollision() {
leftCollision = false;
rightCollision = false;
bottomCollision = false;
for(int i = 0; i < b.length; i++) {
if(b[i].x == PlayManager.left_x) {
leftCollision = true;
}
}
for(int i = 0; i < b.length; i++) {
if(b[i].x + Block.SIZE == PlayManager.right_x) {
rightCollision = true;
}
}
for(int i = 0; i < b.length; i++) {
if(b[i].y + Block.SIZE == PlayManager.bottom_y) {
bottomCollision = true;
}
}
}
public void checkRotationCollision() {
leftCollision = false;
rightCollision = false;
bottomCollision = false;
for(int i = 0; i < b.length; i++) {
if(tempB[i].x < PlayManager.left_x) {
leftCollision = true;
}
}
for(int i = 0; i < b.length; i++) {
if(tempB[i].x + Block.SIZE > PlayManager.right_x) {
rightCollision = true;
}
}
for(int i = 0; i < b.length; i++) {
if(tempB[i].y + Block.SIZE > PlayManager.bottom_y) {
bottomCollision = true;
}
}
}
public void update() {
if(KeyHandler.upPressed) {
switch(direction) {
case 1: getDirection2(); break;
case 2: getDirection3(); break;
case 3: getDirection4(); break;
case 4: getDirection1(); break;
}
KeyHandler.upPressed = false;
}
checkMovementCollision();
if(KeyHandler.downPressed) {
if(bottomCollision == false) {
b[0].y += Block.SIZE;
b[1].y += Block.SIZE;
b[2].y += Block.SIZE;
b[3].y += Block.SIZE;
}
KeyHandler.downPressed = false;
}
if(KeyHandler.leftPressed) {
if(leftCollision == false) {
b[0].x -= Block.SIZE;
b[1].x -= Block.SIZE;
b[2].x -= Block.SIZE;
b[3].x -= Block.SIZE;
}
KeyHandler.leftPressed = false;
}
if(KeyHandler.rightPressed) {
if(rightCollision == false) {
b[0].x += Block.SIZE;
b[1].x += Block.SIZE;
b[2].x += Block.SIZE;
b[3].x += Block.SIZE;
}
KeyHandler.rightPressed = false;
}
if(bottomCollision) {
active = false;
}
else {
autoDropCounter++;
if(autoDropCounter == PlayManager.dropInterval) {
b[0].y += Block.SIZE;
b[1].y += Block.SIZE;
b[2].y += Block.SIZE;
b[3].y += Block.SIZE;
autoDropCounter = 0;
}
}
}
public void draw(Graphics2D g2) {
int margin = 2;
g2.setColor(b[0].c);
g2.fillRect(b[0].x+margin, b[0].y+margin, Block.SIZE -(margin*2), Block.SIZE - (margin*2));
g2.fillRect(b[1].x+margin, b[1].y+margin, Block.SIZE - (margin*2), Block.SIZE - (margin*2));
g2.fillRect(b[2].x+margin, b[2].y+margin, Block.SIZE - (margin*2), Block.SIZE - (margin*2));
g2.fillRect(b[3].x+margin, b[3].y+margin, Block.SIZE - (margin*2), Block.SIZE - (margin*2));
}
}
how would you implement holding a tetromino function?
is there any chance to get the source code??
2:12 I am getting NullPointerException for // window.setLocationRelativeTo(null); // please tell how to fix
Exception in thread "main" java.lang.NullPointerException: Cannot read field "x" because "p" is null
at java.desktop/java.awt.Component.setLocation(Component.java:2191)
at java.desktop/java.awt.Window.setLocation(Window.java:956)
at main.Main.main(Main.java:17)
can you build snake game next?
hi how to ocreate a menu for this game?cam you put a tutorial for that?
love it
Thanks
can you do a multiplayer game next one 🤔
Hey nice video !! I'm using your video for training my java haha. But i'm stock because I use intelij. Is someone here using intelij ? because at 5:29 you telling us to add unimplemented methods but can we do that on intelij ?
If it doesn't show up in your environment, you can manually type the run method. I just used the auto-fill function of Eclipse. I'm pretty sure IntelliJ also has a similar function though.
@@RyiSnow thank you :) but I have an other bug. I check all of my code but I dont found the bug... the left, top and right colision of the static mino's are OK But the left side have no colision. I review the chapiter colision but I didnt found any diffence btwn my code and your code. can you help me pls ?
hmmm, do you like Game Engine like unity or Unreal engine?
Yes (well maybe not Unity anymore though...), but I also like coding from scratch.
@@RyiSnow That's awesome
Hey Ryi! I wanted to know if you could do a candy crush on java, im studying computer science in Argentina and that is my class first proyect for this semester. Im actually really stressed and nervous about it so it would be the best of helps and reliefs if you could do it. Thank you and I love your videos
Can you make a Pokemon game in Java ?
Do you have a github that i can follow you?
code src please
Thank you so much for the video ❤❤ but the static boolean variables upPressed,downPressed... doesn't work in the class Mino(KeyHandler.upPressed...) please inform me to solve this problem
Could you be more specific? Just saying "it doesn't work" doesn't give me any clue to guess your issue/situation. More context would be appreciated!
@RyiSnow the code now is correct until the sound but in execution stoped the score and level and next are displaying but the mino doesn't move
Hi Ryi, thank you very much for this video. I am having some trouble though when creating the first mino. When running the project, it returns the error: Exception in thread "main" java.lang.NullPointerException: Cannot assign field "x" because "this.b[0]" is null. Could anyone help me please?
Sounds like the mino or the b[0] block hasn't been instantiated. I'd recommend you check the line of code that was suggested in the error message.
Thank you, I found a solution, checking the rest of the video now :-)@@RyiSnow
am tilted, its not working,idk
Bro how you not a google employee yet
What Text-Editor is This?
Eclipse
@@user-sh3zt5nl7f which font he code?
can i try to do this whit intellij idea?
You can!
@@RyiSnow ty, ill try it then
17:39
At 22:02, when I type in Block.SIZE, it shows an error that it cannot find symbol variable for Block. In the mino class I did make it a public array, so not sure why its not finding the symbol. Otherwise, great video so far!
maybe it's not static.. do you have it like: "public static final int SIZE = 30;" this?
日本人ですか?
はい
@@RyiSnow 色々教えてくれてありがとうございます!これからもよろしくお願いします!
ok i did something wrong, mine turned white xD ahahhahahahha
good video please keep going
Hello, where I can get this sound effect? white-labyrinth-active.way I'ts not in the link you provided. Need help please
Does this link work for you?
(the site is all in Japanese btw!)
pocket-se.info/?s=%E7%99%BD%E3%81%84%E8%BF%B7%E5%AE%AE&x=0&y=0
thanks... Amazing video!