Java Game Development – 30 – Final Keyboard Input

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

29 responses to “Java Game Development – 30 – Final Keyboard Input”

  1. P092O9901O09 Avatar

    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!

  2. Raj shah Avatar

    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

  3. Johnson Wei Avatar

    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!

  4. Christopher Courson Avatar

    For Mac users, in KeyTest.java, init() after "w.addKeyListener(this);" add "w.requestFocus();".

  5. Jordan Georgiev Avatar

    Best EVer EVer tutorials EVer

  6. Jaroslav Huss Avatar

    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.
        }

  7. Jaroslav Huss Avatar

    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? 🙁

  8. Jakub Strnad Avatar

    Hes not explaining what is enum used to, but he explains what W, S, A, D is used to :/

  9. Braden Brown Avatar

    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.

  10. Dave Ryan Avatar

    I had this same problem and this fix worked, many thanks.

  11. Marno Pretorius Avatar

    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

  12. Mikkel Hansen Avatar

    Lol. It didn't work for me a whole day, until i realised i'd spelled "init()", "Init()" 😀

  13. Rouben Manukian Avatar

    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?

  14. Eimantas Šipalis Avatar

    Maybe do the same as in this tutorial and add every symbol the player pressed into String?

  15. Mikeson'sMovies Avatar

    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.

  16. Victor Romero Avatar

    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

  17. jensssen Avatar

    this is the first tut of this series that I'm actually become excite with

  18. Under_score_ Avatar

    Bandicam records this type o window

  19. Kevin Wetzel Avatar

    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.

  20. n00bje Avatar

    Do you get a stacktrace in the Console window?

  21. Xorglord Avatar

    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.

  22. ZEROgringo Avatar

    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?

  23. Dan Johnson Avatar

    g.drawString(mess, s.getWidth() /2 , s.getHeight() /2);
    to put it right in the middle. 🙂

  24. Nol Ros Avatar

    thanx man that was the fix

  25. pabloelpopstar Avatar

    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)

  26. DoberFrann Avatar

    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 { }

  27. John Wilkinson Avatar

    Ha! I had to disable the bucky code to get it to work in the MAIN event. Way cool though!

  28. TheViolinCalamity Avatar

    @shadowarcher1000 OUCH MAN, was it flickery or anything, cos I'm kinda scared to run it now 😛

Leave a Reply

Your email address will not be published. Required fields are marked *