Thread: Stop my car
View Single Post
Status: Offline
Posts: 38
Join Date: Nov 2011
Default 11-30-2011, 09:35 PM

To make sure the car doesn't go off of the road you could place a dummy object on the edge of each side of the first road. Then put your move left and move right commands inside of an if condition. Use the "is to left of" function to check that the convertible is to the left of the dummy object on the right hand side. Similar for the other side.

I also suggest changing your left and right movement events to while key is pressed events. This will give much smoother movement. Also decrease the distance in your left and right move methods (1 metre will be enough).

Finally, you might want to change the vehicle for the camera (look under properties) to the convertible. That way the camera follows the vehicle. You can do this instead of moving the camera forward.

Other than those changes it looks good.

For video tutorials on programming in Alice 2.2 check out my YouTube channel

Also check out my Programming in Alice blog at
Reply With Quote