This site requires JavaScript, please enable it in your browser!
Greenfoot back
zoukm@hotmail.com
zoukm@hotmail.com wrote ...

2013/10/16

How to make something/someone steps in to and out of a car?

zoukm@hotmail.com zoukm@hotmail.com

2013/10/16

#
Hello Every one, I have trouble making an object open, step in to and out of a car. I need the codes that can make this work for me. Thanks in advance for your help. zouk
Gevater_Tod4711 Gevater_Tod4711

2013/10/16

#
To do this you first need some images and no source code. You just have to change the images at the right time (e.g. when a key is pressed down). If you want us to help you with this part you have to be more specific. What exactly is the problem?
danpost danpost

2013/10/16

#
Normally, it is just a matter of removing and adding the something/someone from the world. The Car class will have a boolean or Object reference (to hold the something/someone) which can be set by method call. While value is true or not null (depending on type of field) the car is controlled; otherwise it does nothing. Having the something/someone saved in a reference in the Car class has the advantage of adding it back into the world when needed.
zoukm@hotmail.com zoukm@hotmail.com

2013/10/17

#
Can you how it is done? I want to, by pressing a key, make an image (thief) walk to a car, open the car, enter and ride away. Then, if the car stops, by pressing an other key, let the thief step out of the car again. Thanks in advance for your help. cheers
You need to login to post a reply.