World and Camera - How to Make a 2D Game in Java #5
In this video, we will render a world map on the screen.
Also we implement a camera function so the camera follows the player character and display the tiles around the player.
Implementing camera might be a bit confusing at first so no need to rush. Try to understand little by little then I think you will get it in the end. Of course, if you have any questions, feel free to leave a comment.
Caution: This is a tutorial for Java 2D beginners so it's pretty verbose! (and the pacing is a bit slow...)
If you want to use my asset (tiles and map) that are used in this tutorial, here's the link:
https://drive.google.com/drive/folders/1OBRM8M3qCNAfJDCaldg62yFMiyFaKgYx?usp=sharing
*I'm releasing my art/music/sound effects to help your smooth learning with this series. If you wish to use them to create public content (profitable/non-profitable), please contact me via Twitter or email. Both links are in the About section of this channel. In any case, please don't re-distribute my asset (graphics/sound) and limit it to personal use.
Thanks for watching.
Timestamps:
0:00 Importing additional tiles
2:46 Displaying player character at the center
8:31 Loading world map data
11:07 Implementing camera
18:51 Checking the result
19:25 Improving rendering efficiency
23:55 Final result
#java2dgame #javagamedevelopment #javatutorial