Rock YouTube channel with real views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

Game Loop and Key Input - How to Make a 2D Game in Java #2

Follow
RyiSnow

(Dec 4, 2022)
The Russian subtitles have been added. Thank you for the help!
French video title translation by @Akariiinnn

Caution: This is a tutorial for Java 2D beginners. So the pacing is slow!

In this video, I will explain how to construct a game loop in detail.

What we do in this video:
1. Draw an object on the screen with Graphics2D
2. Get keyboard input
3. Construct a "sleep" game loop
4. Construct a "delta" game loop
5. Display FPS and check if our game loop is working.

You might feel it's a bit complicated and constructing a game loop is the first big hurdle in 2D game development so hopefully, this video helps you to get through so we can move on to more fun stuff.

If you have any questions, feel free to leave a comment.

Guidelines for using Blue Boy Adventure's code and assets:
https://docs.google.com/document/d/1q...

Timestamps:
0:00 Game loop outline
5:30 Draw an object on the screen
8:19 Get keyboard input
17:50 About the system time
21:08 Construct the first game loop (sleep)
28:04 Construct the second game loop (delta)
31:21 Display FPS

#java #javagamedevelopment #java2d

posted by Bulciagoq7