Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: [NOOB] How do i get X and Y cordinates for one of my two turtles?

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default [NOOB] How do i get X and Y cordinates for one of my two turtles?

    I can create a turtle that will be in a window with the following code
    Turtle t1 = new Turtle(w,100,100);

    if i want to know its cordinates i can write
    int getX(w);

    But when I have 2 turtles, t1 and t2, I dont know what to do if i want to know t1s X cordinates..

    Turtle t1 = new Turtle(w,100,100);
    Turtle t2 = new Turtle(w,200,100);


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,745
    My Mood
    Mellow
    Thanks
    172
    Thanked 622 Times in 609 Posts

    Default Re: [NOOB] How do i get X and Y cordinates for one of my two turtles?

    Turtle1's x coordinate should be: t1.getX()

Similar Threads

  1. Noob Question
    By javapol in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 23rd, 2013, 07:24 AM
  2. Java Noob needs help!
    By antares330 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 24th, 2012, 09:03 AM
  3. NOOB problem here.
    By Nemus in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 13th, 2011, 07:13 AM
  4. Noob needs help!
    By kram in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 2nd, 2011, 05:03 AM
  5. NOOB: Array Help
    By DEAF in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 30th, 2011, 08:39 PM