Java Game Development Tutorial
Platformer

Welcome to my second Java Game Development Tutorial. In this one we will cover some old and improved from the Tower Defence Tutorial and some new stuff. Things like:

  • GameWindow

  • Gameloop

  • Inputs

  • Animations

  • Line of Sight

  • Enemies

  • Collisions

  • Event handling

  • Rendering

  • and much more.

All the code will be found here in the list below and also, in case you are watching this tutorial when its already complete or just not quite caught up yet, you can find the code for that specific episode.
You will also be able to find the code on gitHub if you rather go that route.
github.com/KaarinGaming/PlatformerTutorial

The pixelart is not my own creation. It’s by a creator by the name Pixel Frog.
pixelfrog-assets.itch.io/


If you have any questions or comments, join us on discord and post them there.
Good Luck!


Episode 01 - A New Beginning

Welcome!
This is the first episode of the tutorial and where we set it up.
We add 4 classes with a little code in each.
Enjoy!

Download Episode01.zip


Episode 02 - Inputs

We add inputs and control our rectangle we drew in the last episode.
Good Luck!

Download Episode 02.zip


Episode 03 - Game Loop

We create our game loop. Not just one, but two. And why we should not use the repaint loop.

Download Episode 03.zip


Episode 04 - Images

Today we add images and also learn how to draw smaller sections of a image.
The sprite is included in the zip folder. If you only want the sprite, you can download that separately.

Download Episode 04.zip

Download player_sprites.png


Episode 05 - Animations

Animations make the player come alive. We add that today and also add a constant class.

Download Episode 05.zip


Episode 06 - Gameloop 2.0

Today we add the update part of our gameloop and also make it be able to catch up incase of lagg.

Download Episode 06.zip


Episode 07 - Player Class

Today we add the playerclass and also change how we move the player.

Download Episode 07.zip


Episode 08 - Level Creation

Today we begin our journey with adding levels to our game. Our method is not the best, but it’s unique.

Download Episode 08.zip (code + img files)
Download outside_sprites.png
Download level_one_data.png


Episode 09 - Collision Detection

Today we add collision detection. There will be one more typ of collision later, we are starting by making sure we don’t overlap any tiles in the level.

Download Episode 09.zip


Episode 10 - Gravity

Today we add gravity and jumping. Big part of a platformer game.

Download Episode 10.zip


Episode 11 - Gamestates

In this episode we add Gamestates to our game!
Download Episode 11.zip


Episode 12 - Menu

Today we build on our menu by adding our own buttons!

Download Episode12.zip


Episode 13

In this two-part episode, we add a pauseoverlay.
Many new buttons and also a slider for volume control

Download Episode13.zip


Episode 14

Today we add so our levels can be bigger.
Also some fixes.

Download Episode 14.zip


Episode 15

Today we add some sweet background to our gamescene.

Download Episode 15.zip


Episode 16

The episode on how we add enemies to the game.
There will be a few parts to this.

Download Episode 16.part1.zip
Download Episode 16.part2.zip
Download Episode 16.part3.zip
Download Episode 16.part4.zip


Episode 17

Today we add multiple levels. Some bug fixes as well at the start.

Download Episode 17.zip


Episode 18

Just making some cleanup in the code.

Download Episode 18.zip


Episode 19

This episode is about objects and items that can drop.
This code is for both part 1 and part 2.

Download Episode 19.zip


Episode 20

Making a spike trap for our game. And some bug fixes from last episode.

Download Episode 20.zip


Episode 21

Adding our cannons this episode.

Download Episode 21.zip


Episode 22

Adding projectiles to our game.

Download Episode 22.zip


Episode 23

Today we add death animation and also the death screen.

Download Episode 23.zip


Episode 24

Adding the options menu in this episode by taking the pause menu apart.

Download Episode 24.zip


Episode 25

We are adding sounds!
Big episode!
No sounds in this zip file due to size limits here. Go to github to find it: https://github.com/KaarinGaming/PlatformerTutorial/tree/ep25/PlatformerTutorial/res/audio

Downlaod Episode 25.zip


Episode 26

We are adding our powerattack in this episode.
Audio is missing due to size limits of the zip file for this site. Check Ep25 for link to github for the sounds.

Download Episode 26.zip


Episode 27

Today we smash some bugs.
Audio is missing due to size limits of the zip file for this site. Check Ep25 for link to github for the sounds.

Download Episode 27.zip


Episode 28

The final episode of this tutorial.
A lot of things have been added.
Enjoy!

Audio is missing due to size limits of the zip file for this site. Check Ep25 for link to github for the sounds.

Download Episode 27.zip