Results 1 to 2 of 2

Thread: Sprite Movement

  1. #1
    Curtiz is offline Member
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Default Sprite Movement

    I am trying to make my sprite move from left to right in an infinite loop

    I can make my sprites move left then right.

    But the maths becomes a bit confusing after the timer is reset.

    It goes

    left -1
    right +1

    then the 2nd time it comes the to left cycle the movement is already at +1 instead of 0 so the code doesnt work and the sprite stays in one position.

    Can anybody help me?
    Last edited by Curtiz; 04-26-2010 at 02:37 PM.

  2. #2
    Curtiz is offline Member
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

Similar Threads

  1. [j2me] sprite rotation with degrees
    By Rooneyz in forum CLDC and MIDP
    Replies: 0
    Last Post: 07-06-2009, 03:40 PM
  2. Snake game movement
    By BeerMonkey in forum New To Java
    Replies: 9
    Last Post: 11-27-2008, 12:48 PM
  3. Detecting user movement of a JFrame
    By dklett in forum AWT / Swing
    Replies: 4
    Last Post: 08-27-2008, 07:01 AM
  4. [SOLVED] File Movement/Manipulation
    By Leprechaun in forum New To Java
    Replies: 2
    Last Post: 04-23-2008, 12:39 AM
  5. Movement of balls
    By BlitzA in forum New To Java
    Replies: 8
    Last Post: 01-09-2008, 03:30 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
  •