Java Programming: Let's Build a Game #3

preview_player
Показать описание

In this video we look at adding key input into our game and working with different objects. If you have any questions then be sure to leave a comment or contact me on twitter; realtutsgml. If you learned something then be sure to leave a like, comment, and favorite.

Have you ever wanted to create games? Have you ever gotten fed up with it being to difficult? Well now is the time to thank me and possibly subscribe because you have just found the channel for you! Game Maker Tutorials, Java Game Programming, Unity3D Tutorials, Batch, C++ and much much more! This is the channel for you, the one stop shop for an exploration of your hidden talent as a game developer. Unleash your potential and go wild with imagination when you finally figure out how to make any game you want!

Visit CodingMadeSimple for more exclusive tutorials and get the help you need to succeed as your very own indie game developer!

Follow me on twitter for exclusive content and interaction with me!

Follow me on Google+ to keep updated with all of my tutorials

Game Maker Studio: Programming
Game Maker Studio: Tutorial
Java Programming
Game Programming
Game Tutorial
Programming Tutorial

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

"Make sure you spell release wrong." - you made my day XD

WurstschneideBrot
Автор

FOR ALL THOSE IN THE FUTURE WHO WISH NOT READ FURTHER ... ehehem

java doesnt start the game focused naturally, so if everything is correctly coded and spelt, yet it wont work and has no errors.

just click the screen

edit : 5 years later and this is still helping people :D wish I had the solution to just make it start focused for all of you tho!

odaghast
Автор

At 7:30, the reference to the handler is added before it is initialized, but it is given a value before you can press a key. That's why there is no error.

raenastra
Автор

First of all I want to say that this tutorial series is very helpful and awesome. I had a problem with the key input. It wasn't working because I wrote the keyPressed() and keyReleased() methods with capital K, so if anyone is experiencing any problems with the KeyInput consider checking this.

mircox
Автор

Finally, finished this video! Took me far too long and had to call in the help but I got it. Now video #4!

necrostalker
Автор

I am so friggin lovin this tutorial! thanks man you are so awesome! =)
Our professor gave us a project, making a tower defense game in java using eclipse, and I have a meager knowledge about object oriented programming in java.
Then I found these! I am being enlightened as I speak.
I subscribed! =)
make more game tutorials man! Two thumbs up! =)

jayrom
Автор

At 6:43
They character codes are ASCII. You can get the character for each number by holding alt and typing the number with the num pad on your computer.

uchthlskyproductions
Автор

Since I'm using notepad++ I've had few difficulties to face (no auto import / packaging) but learned much.

Great tutorial series :)

HDmaxify
Автор

Just a heads up you must write keyReleased and keyPressed with a lowercase "k" when they are spelled correctly an @override will appear above them. You must also press on the game screen to set focus on it. or in your "Window class" before "frame.add(game);" write "game.setFocusable(true);" and after "game.start()" write

carsonfisher
Автор

This is amazing. After having learned the core principles of java, data structures and algorithms, being able to create something and knowing how everything is working is truly a great feeling. Thank you!

ishahzodi
Автор

Really loving these videos. I'm coming from a 2 year background in c++ with no java experience and this is going at a perfect speed. I would definitely be overwhelmed if I tried this with no coding experience, but so far I have loved the way you've set these videos up.

itsnotasitis
Автор

my brother loved what i made just from these 3 tutorials- he kept demanding i play computer tag with him! thanks!

elliottwalker
Автор

Your tutorials are amazing! I am half-decent at programming physical things(e.g. robots, remote control cars, etc.), and I am finally starting to understand how to display things, and program software! Keep it up!

MysticalApple
Автор

I've tried watching this series 3 times now at different stages of learning java, and this is the first time I made it to the 3rd episode!!

tomtlrech
Автор

Hearing him say "Spell it wrong" in x0.75 made my day xD. Made me feel like I was watching one of my friends while they were drunk lol

DMlS
Автор

15:43 the reason it's less fluent without velocity is because the object move each time the keyboard sends a key signal to the program (when you press and hold a key on a text box it will type the key once first then repeat it at a steady rate). So the speed of the object is defined by the speed of the repetition of the key (on mac there is no repetition so the object would only move once unless you keep repressing the key).

flamme
Автор

I think that the code works in 7:37 because you give a null reference, so in that moment it does not matter but in future it will

YayoVBSosa
Автор

I love this series. By the way, the reason you didn't get an error with the null handler in the constructor is because you weren't doing anything with it. You were just storing it in a variable.

Mrwiseguy
Автор

For everyone new watching, KeyListener() in the game class may have to have the word handler in the parentheses.

Also, make sure the key release method is spelled keyReleased with a 'D' at the end.

daveshn
Автор

At around 8:00 when you say there should be an error and there isn't, the explanation is that you created the handler variable but didnt give it a value yet. Therefore, you can pass it ass null when creating the KeyInput class. You would get an error if you tried to call a method of handler on keyinput class

SamsWebDev