11-30-2011, 08: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
http://www.youtube.com/user/drdave785
Also check out my Programming in Alice blog at
http://programminginalice.com
|