This site requires JavaScript, please enable it in your browser!
Greenfoot back
rcompton5
rcompton5 wrote ...

2012/4/12

how to

rcompton5 rcompton5

2012/4/12

#
im trying to make a driving game where you walk a guy to a car and then he disapears and you can drive the car
toytttttt toytttttt

2012/4/12

#
What do you want help with?
tkiesel tkiesel

2012/4/12

#
I've done something similar to this before.. Let's say that your guy object is of the class Guy. And your car object of the class Car. Your Car can have a variable of type Guy named driver.
public class Car extends Actor
{

    private Guy driver = null;

    //  More stuff here....

}
And you can write methods in Car to load and unload the driver. And in act(), if the driver != null, you can follow keyboard commands to drive around. Having the driver accessible by the Car means that you Car can also pass along damage, powerups, etc to the driver and other fun things. :)
rcompton5 rcompton5

2012/4/13

#
i am still only able to move the guy"racer2"
You need to login to post a reply.