In this tutorial, you will learn to create the google chrome dinosaur game with the built-in java awt/swing graphics library.
Throughout the tutorial, you will learn how to create the game loop, create a jframe and jpanel, draw images on the jpanel, add click handlers to make the chrome dinosaur jump, randomly generate cactus and move them across the screen, detect collisions between the chrome dinosaur and each cactus, and add a running score.
How to setup Java with Visual Studio Code
You can continue working on this project if you like. In the img folder, you will find additional images not used in the tuturial. You can add additional obstacles such as the bird or the bigger cactus. You can also add a feature for the chrome dinosaur to duck. Another feature you can add is keeping track of the high score every time the player resets the game.