Java 2D Game Development Tutorial: Episode 3 *Moving Objects On The Screen*

preview_player
Показать описание
Click Here To Watch: Java 2D Game Development Tutorial: Episode 2 *Grid Layout*:

--------------------
I (Ben) teach you how to program a very basic 2D sidescroller game in Java!
Go watch and support my other channel based on programming!

Leave some love for us here at TheBCBroz studios (Our Bedrooms) by putting a like or a comment!

-----Directors Channel(s)-----

-----Our Website-----

-----Directors Twitter(s)-----

--------TAGS IGNORE--------
Java "How To Code Java" "Java Tutorials" Portal2 Portal "Portal 2" GLADOS Wheatly BCBroz Bukkit terraria Ben Owen First CrazyRedPandaHD Battlefield BF3 Team Fortress "Team Fortress 2" Dust Soldier Gameplay game play frag video Tf2 Valve "Valve Corporation" Soon Communtiy Youth MW2 Black Ops World At War Halo Halo2 Halo3 Halo-Wars Reach Halo-ODST Terria Notch Markus Persson yt:quality=high

This video will show you:
HOW TO play With Java
HOW TO make a Java Program
HOW TO play with Code
HOW TO be a BCBroz Director
Рекомендации по теме
Комментарии
Автор

Thanks for this! Gonna try this later! You are really awesome and keep it up :D

KeirNellyer
Автор

on 9:56, if i press D, the white square just goes right and continues after the boarder. but when i press a, it just stops, not going anywhere. if i run it again, and press a, nothing happens. it seems like the d button works. plz help!

MrMinecraftStudio
Автор

@TheBCBroz

Actually, forget my previous post that is no longer a problem. However, my rectangle spawns in the top-right corner and doesn't move :(

PuffyBugs
Автор

also at f.addKeyListener(new KeyAdapter() {
void KeyPressed (KeyEvent e){
== KeyEvent.VK_D){
= true;
-=1;
I get an error at the "f"
the error is- Cannot refer to a non-final variable f inside an inner class defined in a different method
the suggested fix is- Change modifier of "f" to final

YogfanSteve
Автор

i just realised, if i put 'character.x += 1;' in line 26 (after 'right = true') and 'character.x -= 1;) in line 30 (after 'left = true') the thing goes right and left, only, slower. is this ok?

MrMinecraftStudio
Автор

Mine moves really fast at first... then after I press the key again it starts moving really slow. HELP!

mophydo
Автор

Please help, when I get to the end of your tutorial I get this error at "super.paintComponent(g);"
error- The method paintComponent(Graphics) is undefined for the type KeyAdapter

YogfanSteve
Автор

Please answer! Everything is fine, but when I press D, it just keeps going out the boarder, and when I press A, it just stops it, then when I let go of A, it keeps moving out. PLEASE HELP :P

TheSuperMaddman
Автор

Getting the same problem here, I can move it to the left or right really fast until I press the opposite button, then both buttons, when pressed, make it move slowly. It is very irritating :/

SoloPegasusWing
Автор

Hi ben you are great, but i seem to be having problems here. I have watched the video 3 times and checked every character but it still wont give me the white box. I am sure it is something small but what should i do?

nathanmaguire
Автор

Starting at time 6:12, I notice from line 36 to line 39 you have 4 curly braces, one parenthesis, and one semi- colon. How does that work? Over all great video.

teejaver
Автор

@TheBCBroz

Hello, it doesn't recognise KeyAdapter :(

Any ideas?

PuffyBugs
Автор

I had the same error as you. So I looked through the code again and found the problem. You have probably spelled paintComponent with an s.

I know this is a bit late
but I hope it will help you!

TeemoTales
Автор

same problem my caracter also have tail?

RemcoRemco
Автор

f.addKeyListener gives this error:
"The method addKeyListener(KeyListener) in the type Component is not applicable for the arguments (new KeyAdapter(){})"

MMedic
Автор

i pressing d or a it fast but i m trying again its slow

kaanbayazt
Автор

When I click first A or D it's going fast, but when I click them again, the Rectangle is TOO SLOW. Can somebody help me please?

ivakasdude
Автор

if i move my character it leaves a trail behind.

MrTheNewGuy
Автор

Screen is just grey and nothing else help

HungrySandwitch
Автор

Thank you, please continue making these :D

VirtuaNick