Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Diagonal keyboard movement in java on: 2005-10-14 05:47:09
Ok I have a square. I want to use the 4 directional keyboard buttons to move it around by changing its x and y cooardinates. I can move it anyplace except
for diagonally. This is because only the last pressed and held down key is firing the event and keyTyped( ). Therefore, to move diagonally, you have to
do something like this: UP, RIGHT, UP,RIGHT...etc rather than keeping the buttons pressed down simultaneously which will result in a non-diagonal movement
according to the last pressed button. If anyone can help me by first explaining
the concept of what I should do, then if necessary show me some code I would appreciate it.

Another thing is, when I want to move into a certain direction, let's say to the right, I keep pressing right. However, the first movement is a movement
followed by a small delay, then the movement continues normally. If you want to know what I mean just keep holding down a letter button now and see how the
first typed letter and the rest of the letters are not typed in the same speed. How do I get rid of this to make the movement more appropriate? Concept is always
more important so please don't just paste some code and tell me to use it, thank you.

Pages: [1]
EgonOlsen (78 views)
2018-06-10 19:43:48

EgonOlsen (58 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (260 views)
2018-05-13 18:23:11

nelsongames (158 views)
2018-04-24 18:15:36

nelsongames (157 views)
2018-04-24 18:14:32

ivj94 (899 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (812 views)
2018-03-24 14:43:53

Solater (175 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!