Week 10

 Tried doing something simple to get a some more insight to how the other games were working.


Making the game frame, setting how big it is, and intializing the key listener to listen to the keys being typed. We use label as the object we're using, the commented line of code is to add a icon as a picture instead of a red box. I set the color, add, and make it visible. Then we have a method that tracks what key I type and how it suppose acts to each respective key.(returns the character of what was pressed)

Similar method that instead returns the int of the character pressed. then when released prints the "keychar" and the "keycode". 
me typing random key combinations of w,a,s,d, and you can see the key codes and key chars.

This was a much more simple to see of the basic GUI functionality and so I can get the grasp of all of what the code is doing.


Here is me pressing the left arrow so that it moves. The "?" are any keys other than w,a,s,d.


Citation: Java Keylistener 🚀 - Youtube. https://www.youtube.com/watch?v=BJ7fr9XwS2o.

Comments

Popular posts from this blog

Week 9

Week 10

Week 11