Results 1 to 3 of 3
  1. #1
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default Game move function

    Hi, i a moveUp() and moveDown() function that currently just increment and decrement the "y" value each time they are called. The outcome of this is that my object only moves slowly, how could i add more than one, say 10, to the "y" value each time?
    Those two functions look like this:
    Java Code:
    public moveUp() {
        y++;
    }
    
    public moveDown() {
        y++;
    }

  2. #2
    yellowledbet is offline Senior Member
    Join Date
    Feb 2011
    Location
    Georgia, USA
    Posts
    122
    Rep Power
    0

    Default

    y += 10;

    or

    y = y + 10;

  3. #3
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

Similar Threads

  1. Replies: 1
    Last Post: 06-02-2011, 09:29 AM
  2. Calling function in Javascript- from other function
    By jdigger in forum New To Java
    Replies: 1
    Last Post: 02-27-2011, 09:00 PM
  3. Move from console to GUI
    By MaxMonic in forum Advanced Java
    Replies: 2
    Last Post: 01-01-2011, 06:34 AM
  4. Rpg game player wont move help please
    By askumi in forum New To Java
    Replies: 19
    Last Post: 12-22-2010, 02:21 AM
  5. Replies: 3
    Last Post: 12-04-2009, 03:08 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
  •