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)
{
Type: Posts; User: Flcha
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)
{
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;
/**
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);
...
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...
Sorry :\
Here it goes...
public void moveForward(int dist)
{
// Obtain the current rotation in degrees
int rotationInDegrees = carImage.getRotation();
//...
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...