[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Java Game Development – 30 – Final Keyboard Input
by
Tags:
Comments
29 responses to “Java Game Development – 30 – Final Keyboard Input”
-
The text is flashing…. but I'm using window.createBufferStrategy(1);. What happened???
I set my window.createBufferStrategy(2); and it's not flashing now. SHould be 1 for drawing images…so…
I wonder how I can have images AND text on the screen without one of them flashing!
-
i dont know why but when i compare the display modes to get the display mode suitable for my device, i get ArrayIndexOutOfBounds. Anyway I tried with vc.getDisplayMode() and the rest of the code is working just fine
-
I've got to say, some topics in programming can seem super bland and the Java API documentation at times can be unforgiving, but at the end of the journey there is THENEWBOSTON to save the day!
-
For Mac users, in KeyTest.java, init() after "w.addKeyListener(this);" add "w.requestFocus();".
-
Best EVer EVer tutorials EVer
-
I solved that problem with this code generated by NetBeans. @Override
public void keyTyped(KeyEvent ke) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} -
NetBeans is not able to compile this program. It Writes :" KeyTest is not abstract and does not override abstract method keyTyped(KeyEvent) in KeyListener… What the hell should I do with that? 🙁
-
Hes not explaining what is enum used to, but he explains what W, S, A, D is used to :/
-
I know this was 7 months ago so who knows if you will reply but how did you make the ping pong game i'm just beginning learning java and wanted to make a simple game.
-
I had this same problem and this fix worked, many thanks.
-
before you want to override a method from a super-class type @Override then press enter and start typing your method, and if you do something silly like that java will tel you that there is an error because there is no such method to override
-
Lol. It didn't work for me a whole day, until i realised i'd spelled "init()", "Init()" 😀
-
Can anyone help me here, I've combined the keytest and runall2 to make an animated character walk in the game, I want to be able to change my sprite depending on the way he is going. is there a way to easily change the animation the sprite takes in, without redrawing the sprite at the beginning every time?
-
Maybe do the same as in this tutorial and add every symbol the player pressed into String?
-
I had the same problem. Went back over the video's on found out I had running = true; missing from the Core.class at the end of the init method. Worked fine after I added it.
-
can anyone give me ideas on how to take input…I've created a ping pong game using the code from these tutorials however I want to add a feature that allows the user to type in his name..I have no idea on how to do it…I tried a jframe and input pane but they are set behind the full screen.. any help anyone??? thanks
-
this is the first tut of this series that I'm actually become excite with
-
Bandicam records this type o window
-
For me this was happening because running never had a value of true, even while the program was running. Fixed by initializing running to true when run method is called.
-
Do you get a stacktrace in the Console window?
-
When I try to run the program, I just get a fully black screen for a second or two, before it exits the program. I know I'm a bit late to the party, but would still love any help if anyone has any ideas.
-
so im trying to make space invaders in java. i have loaded the images for the spaceship and whenever i press the arrows on the keyboard it moves in the screen. so my problem is that whenever it moves, like the screen doesnt refresh and the images just kinda duplicates on the screen. how can i fix this?
-
AWESOME!!! *****
-
g.drawString(mess, s.getWidth() /2 , s.getHeight() /2);
to put it right in the middle. 🙂 -
thanx man that was the fix
-
this is like a program for the blind. Please record what you see! It's annoying to see all the code and not the results (for those who don't want to type all that)
-
If you have problems with the KeyListener import java.awt.event.KeyEvent; and import java.awt.event.KeyListener;
If you have problem with abstract draw method, change in Core to public abstract void draw(Graphics2D g); take off those { }
-
Ha! I had to disable the bucky code to get it to work in the MAIN event. Way cool though!
-
@shadowarcher1000 OUCH MAN, was it flickery or anything, cos I'm kinda scared to run it now 😛
Leave a Reply