Hello, thank you very much for the lessons, this is the best thing I have ever seen. You are excellent at teaching, you perceive everything perfectly. I have a question. We performed the "pos" test at 1920*1080 resolution. How to check for all resolutions simultaneously so that it works equally on 2, 5, 10, 20 and so on inch devices? I don’t know how to say this correctly so that it works identically on all devices, regardless of screen size.
Hey! Thanks for the kinds words :D There is a few ways of doing this. I will probably make a video about this topic in the end of this tutorial. The simplest way is to use 0-1 as pos for the object. draw object at 0.454 in x pos. 0 is then the very left, 1 is the very right. And if you use a 1920x1080 screen, use multiplication. 0.454 * 1920 = the pos of the object in x. Regardless of the screen resolution, the object will always be in the correct place. Some games use slightly different ui for bigger screens to make the experience better for the user. Different screen sizes = different size of the world/ui. Best of luck.
I tried to compile the code but I got this error: PS C:\Users\oscar\java games\platformer tutorial\src\main> javac MainClass.java MainClass.java:5: error: cannot find symbol new Game(); ^ symbol: class Game location: class MainClass 1 error
The guide itself is nuts, but these variables names like 'bWaterC' ale absolutly terrible, it's unmaintainable for person who doesn't know the code and with project growing it's getting just bigger and harder to fix it. I would work on it. Besides of that, I find the series very helpful and well explained and edited.
I'm watching the platformer tutorial and I've encountered a bug. Will this be addressed in the upcoming episodes? The issue is that when the player reaches 80% of the level, only the x-coordinate of the draw function is being updated, not the hitbox. As a result, the hitbox continues to move incorrectly.
Yeah it's going to be fixed. The problem is that we forget to adjust the drawhitbox method so you had to on add - lvloffset as parameter and in the g.draw()
Your videos are incredibly helpful, and you're the first to shed light on 2D game development with Java for me. I'm looking forward to more videos, especially on creating 2D open-world games like Stardew Valley and Harvest Moon, and using frameworks like LibGDX.
hey bro! nice tutorial i am looking forward to make this game as my final year java projects! i want to add the score and highscore and update the highscore as it makes the new high score, is there a tutorial for this playlist, if not can you please tell me how to do it?
case RUNNING: return 6; case IDLE: return 5; case HIT return 4; case JUMP: case ATTACK_1: case ATTACK_JUMP_1: case ATTACK_JUMP_2: return 3; case GROUND: return 2; case FALLING: default: return 1; i got you bro❤
package utils; public class Constants { public static class PlayerConstants{ public static final int RUNNING = 0; public static final int IDLE = 1; public static final int JUMP = 2; public static final int FALLING = 3; public static final int GROUND = 4; public static final int HIT = 5; public static final int ATTACK_1 = 6; public static final int ATTACK_JUMP_1 = 7; public static final int ATTACK_JUMP_2 = 8; public static int GetSpriteAmount(int player_action) { switch(player_action) { case RUNNING: return 6; case IDLE: return 5; case HIT: return 4; case JUMP: case ATTACK_1: case ATTACK_JUMP_1: case ATTACK_JUMP_2: return 3; case GROUND: return 2; case FALLING: default: return 1; } } } }
I was wondering, I can wait until I finish this tutorial, but do you have a book that you recommend like this course? I prefer to learn from books and so far, I like the series, thank you for making it love your voice, but I still want to read a book. I am pairing this tutorial as my hobby while learning Java for the afternoons and I am also following the Mooc-Java in the mornings before work. I am just interested in Java because of college and I am trying to balance learning with hobbies.
When I try to run my code like he does at 10:21, i keep getting errors that say: Exception in thread "main" java.lang.IllegalArgumentException: input == null! at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1356) at main.GamePanel.importImg(GamePanel.java:35) at main.GamePanel.<init>(GamePanel.java:25) at main.Game.<init>(Game.java:11) at main.MainClass.main(MainClass.java:6) I really thought I did everything right, but it seems not. Any Ideas?
I used the plataformer tutorial to learn how to make a game, in the end I learned so much and used the idea for a project. Thank u so much for this videos, they r really great and helpful, I learned a lot from them Best for you From Portugal ❤
Incredible tutorial. I was reading Java Swing documentation over the last week and was making a game (solely for practice) with only JPanels, JButtons, JDialogues etc etc but I felt the LayoutManagers were too restrictive and not great options for switching between views in a game (although great for other type of apps) The whole time I kept thinking I was missing something and hadn't realized paintComponent was called automatically and I can essentially draw my entire game with it. This is incredible thank you! Back to the drawing board for me haha