Search:

Type: Posts; User: Flcha

Search: Search took 0.12 seconds.

  1. Replies
    13
    Views
    2,571

    [SOLVED] Re: Moving object in the y-axis

    Greg

    I tried this and now works ;)
    I took off the rotationinRadians=0.0; and did other small modifications
    see

    public void moveForward(int dist)
    {
  2. Replies
    13
    Views
    2,571

    [SOLVED] Re: Moving object in the y-axis

    Ok.

    I will repost again all the code of car2 class (the class that I'm working in)


    import comp102x.IO;
    import comp102x.Canvas;
    import comp102x.ColorImage;

    /**
  3. Replies
    13
    Views
    2,571

    [SOLVED] Re: Moving object in the y-axis

    No matter what I do, the car only moves in the x-axis. It's like it's not recognizing the y-axis coordinates.

    I suppose will be this

    ...
    carImage.setX(carImage.getX() + (int)distX);
    ...
  4. Replies
    13
    Views
    2,571

    [SOLVED] Re: Moving object in the y-axis

    Thanks for your fast reply.

    The program doesn't use the paint component.
    And yes, I know some basic trig, although it was very long time that I studied that.

    And sorry because I forgot to post...
  5. Replies
    13
    Views
    2,571

    [SOLVED] Re: Moving object in the y-axis

    Sorry :\
    Here it goes...



    public void moveForward(int dist)
    {
    // Obtain the current rotation in degrees
    int rotationInDegrees = carImage.getRotation();
    //...
  6. Replies
    13
    Views
    2,571

    [SOLVED] Moving object in the y-axis

    Hi guys,

    I'm new in this forum and I'm using it to help me in my coding classes.

    I just have one problem with a "car" program in java.
    The objective is to move the car in the direction it is...
Results 1 to 6 of 6