我原以为这样的3D赛车只能用3D引擎来做:
http://www.fastfroots.de/ 结果不是这样的。太神奇了!
UploadFile/2004-5/2004521166129.swf 点击浏览该文件 有段关于2D模拟3D赛道的说明,先COPY过来看看 this is NOT a 3D engine,
it''''s just a smart concept of manipulating the appearance of the background image. the moving road and grass is made up of strips of the original image. From the bottom of the screen to the middle of the screen
there are movie clips placed with decreasing height,
say 10 at the bottom and 1 in the middle of the page and everything in between.
Every "strip movie clip" is masked using a mask with the same height as the strip movie clip itself (1-10).
Inside the strip mc the image is placed and scaled, smaller scale for strips with smaller height, to give the appearence of perspective.
The car has an angle (the direction of movement).
The car has a position on the huge image.
The images in the strip mc:s are rotated by the car angle around the car position coord on the image.
The images in every strip mc are moved to this position, with an offset in y-pos in the strip mc depending on the strip mc''''s position between the horizon and the bottom of the screen.
The collision detection is probably a comparison to a 2d array.
it''''s also possible to use an extra 3D engine just for trees and obstacles.