Results 1 to 4 of 4
  1. #1
    xchan is offline Member
    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Default Moving sprite with keyboard slight problem

    You see i got an image and i can move it with my keyboard (left/up/down/right)

    when i LONGPRESS an arrow key like how you usually do this -> wwwwwwwwwwwwwwwwwww,

    it does move 1 pixel away, then stops for a second or so, then continues moving.

    what i want is it keeps moving on :/

    please help!

    if my explanation is smoggy, try to type a letter with just a single press and you will see it stops and types again... >.<
    Last edited by xchan; 07-27-2013 at 07:09 PM.

  2. #2
    MustSeeMelons is offline Member
    Join Date
    Oct 2012
    Posts
    38
    Rep Power
    0

    Default Re: Moving sprite with keyboard slight problem

    Create booleans like keyLeft, keyRight etc. When you press a button, change the value to true, when you release the button set it back to false and in the game update check the values, if true moveLeft() etc.

  3. #3
    bakriawad2000 is offline Member
    Join Date
    Aug 2013
    Posts
    6
    Rep Power
    0

    Default Re: Moving sprite with keyboard slight problem

    post the code please..?
    make sure u surround it by code tag

  4. #4
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Posts
    101
    Rep Power
    0

    Default Re: Moving sprite with keyboard slight problem

    i wrot e tha t its inside of a larger program if you feel like looking through it non linear shots

    you can find your answer

Similar Threads

  1. What am I doing wrong in moving this sprite?
    By Wesley.laferriere in forum AWT / Swing
    Replies: 9
    Last Post: 11-06-2012, 10:11 PM
  2. Replies: 1
    Last Post: 06-08-2011, 10:22 PM
  3. Confisuion about sprite.getX() and sprite.getY()
    By Basit781 in forum Java Gaming
    Replies: 0
    Last Post: 01-10-2011, 06:16 AM
  4. Problem using KeyAdapter to get keyboard input
    By DerekRaimann in forum New To Java
    Replies: 0
    Last Post: 12-20-2010, 04:10 AM
  5. KeyBoard Problem
    By arimakidd in forum Java Applets
    Replies: 3
    Last Post: 09-19-2008, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •