Level Creation - Episode #08 - Platformer Tutorial Java

preview_player
Показать описание
00:00 Intro
00:21 Recap
01:02 LoadSave
05:58 Final Sizes
10:41 Level and LevelManager
14:22 Level Sprite Array
16:46 Level Building
18:36 Gettin Leveldata
27:22 Outro

*** LINKS ***
*************

Want to make a platformer game? And in Java?
We build this one from scratch. No gameengine or shortcuts.
This is for beginners of game development, or those who just started.
Some of the things we will cover are:
- GameWindow
- Gameloop
- Inputs
- Animations
- Line of Sight
- Enemies
- Collisions
- Event handling
- Rendering
and much more.

Don't forget to subscribe and like the video.
If there is anything that's unclear, post a comment or join us on discord and ask it there.
Hope you enjoy this episode and good luck!

#java #gamedev #platformer
Рекомендации по теме
Комментарии
Автор

Hey guys!
Hope your day is going well.
This type of levelbuilding will be different from our last tutorial. It's not the best, but won't require code to change it.
Enjoy!

KaarinGaming
Автор

Nice tutorial series so far :) I've learned a lot new things and better methods thanks!

Just one thing regarding this video:
Some viewers which copy your code 1:1 might have issues with the auto-rescaling of the player when changing the 'SCALE' object. That is because, idk if you did this intentionally but probably not, when the video chapters go from 'Final Sizes' to 'Level and LevelManager', you added in the arguments of the constructor of the Player object 2 int values. Those probably represent the width and height in which the player sprite should be drawn, but the part where you add these, is cut out.

So for anyone who doesn't want to simply download his code, here's what he (probably) added/changed:

In Player.java extend the constructors arguments to: public Player(float x, float y, int width, int height) {...
still in Player.java: in the method render(Graphics g) replace the numbers in the g.drawImage call with width (left number) and height (right number)
and finally in Game.java, which should show an error by now: in the method initClasses() extend the Players arguments as you can see in the vid after 10:41 or this:
new Player(200, 200, (int) (64 * SCALE), (int) (40 * SCALE))

GreenPsycho
Автор

i have been using your tutorial to program a game for my university exam.
So far it was awesome and the only real help i can get with my project.
I have to admit tho that i have been having some troubles adapting the code to my sprites. With the character i figured it out quite fast but this level method took me way to long to do.
I would have liked to have a more detailed explanation on how to create my own lvl_data image. thats the first negative point i have found up to now in this tutorial
I am happy u did this and i am tuned to work my way though this whole thing

lolaletsplay
Автор

Hi Kaarin,

wanted to say your channel is a gold mine I stumbled onto with some late night youtubing lol, Your content is great and easy to understand due to the way you demonstrate and deliver the videos, Honestly wish you the best with the channel you've been a huge help!

TheByteBard
Автор

Hey,

at 10:47 you change the constructor of the player class (I think to match the scale value) but dont mention it in the video! ;)

lthom
Автор

I just started coding a couple of months ago and I always wanted to do a video game, man...this stuff is HARD but I managed to understand how the level creation worked and im really happy! hope I will finish this tutorial!

drpivotkid
Автор

I feel like before 10:41 and after are somewhat a missing part. the size of panel change. When I run the scales are different from what you have....

Overall, this is awesome!!

kaiiemsawat
Автор

Eclipse keeps saying "The type cannot be resolved. It is indirectly referenced
from required type javax.swing.JComponent" for the GamePanel class. I can't run the project.

Mesatg
Автор

I’m new to development and maybe I’m just dumb as rock but how do you get the exact tiles in the right place? I’m kinda confused on the RGB method you used and how it works. I tried using a different tile set and had no luck. It would form the outline of the level but with random tiles. I finally got it look like a level using the textures and sprite sheet you provided. Still confused on how the tiles are pulled from the sheet and placed neatly to look like a level.

_joselp
Автор

4:10
the animation is buggy idk why
edit1: Its only loading the 1 frame
edit2: GET IT! The problem was that i coded:
if (startAni == playerAction) {resetAniTick()}.
Instead of:
if (startAni != playerAction) {resetAniTick()} (the diference is the ==)

willienmuniz
Автор

i have a problem im using another background and i can't see my character, and after re-check he is actually behind my background, how do you fix this? im at 14:11 and i try to fix this before continue

gamecool
Автор

is there a problem some of my tileset are not the same dimension in height ? will it affect the matrix somehow? do i really need fix dimensions ? because i'm making a platformer where the players stands on some bridges/platforms and those are my only tiles, excluding the background layers.

beyondexistence
Автор

I DID THE SAME WORK AND AM GETTING A VLACK BACKGROUND INSTEAD OF YOU TELL WHAT I, MGHT BE DOING WRONG?

aasthashrivastava
Автор

Hello, I have a question, how should I do if I want to render a levelSprite with different layers ?

adressedje
Автор

im having ptoblem with generating half of the level and i have no idea why. Left half of it looks normal but the right half thinks r in rgb is always 0. Does anybbody have an idea why?

NoNameCz-vyxf
Автор

Great Content Man!!!
However I still do not understand the RGB Map creating method, how do you exactly create a map with RGB piexels by yourself? I want to know how because I have a map of my own, and wonder how I can input the LEVEL_ONE_DATA.

jackzhang
Автор

Why use 'j' before 'i' in your for loop?

ramonpaulocaumban
Автор

Hey, ik I’m maybe 2yrs late, but I’ve been following this series to help with a project of mine, I’ve encountered an error where it says ‘index 26 out of bounds for length 26’ I’d assume this is for my ‘tile in width’ but I’m unsure of how to fix this, I haven’t been using the same pngs that you have, but I have changed and fit all the sizes and cuts to fit my pngs, I’m just unable to figure out what I need to change in order for it to work, any help would appreciated, thanks

Kyroninn
Автор

hi, can you explain how we build a map in red? I don't understand

ЧИКЕНБУРГЕР-эй
Автор

I'm having trouble again. I'm trying to follow 1:1, and when I get to 14:10 and run the program, I get the level sprites, but not the pirate. What could I have missed?
I really don't want to look at his code if I don't have to

SchizoGenius