tailieunhanh - Black Art of Java Game Programming PHẦN 6

Lớp này, thể hiện trong Liệt kê 12-12, là mẹ của tất cả các khung cảnh tĩnh. Phong cảnh là các loại đối tượng mà không tương tác với phần còn lại của thế giới. Mục đích duy nhất của nó trong cuộc sống là làm những điều trông đẹp Nghệ thuật lập trình Game Java | Black Art of Java Game Programming Building 3D Applets with App3Dcore This class shown in Listing 12-12 is the mother of all static scenery. Scenery is the type of object that does not interact with the rest of world. Its only purpose in life is to make things look prettier. No object should be interested in collisions with scenery and no scenery should be interested in collisions with other objects. Listing 12-12 The abstract static scenery abstract class cmAbstractStaticScenery extends cmAbstractStaticObject protected cmAbstractStaticScenery fWorld w fPoint3d p fAngle3d a super w p a Extensions of this class might be small rocks bushes and so on. The cmAbstractMovingScenery Class This class is just like the static one but this scenery is moving. The code is shown in Listing 12-13. Listing 12-13 The abstract moving scenery abstract class cmAbstractStaticScenery extends cmAbstractStaticObject protected cmAbstractStaticScenery fWorld w fPoint3d p fAngle3d a super w p a Extensions of this class might be small fragments clouds and so on. Previous Table of Contents Next file D Downloads Books Computer Java 20Game 20Programming ch12 3 von 3 13 19 02 Black Art of Java Game Programming Building 3D Applets with App3Dcore Black Art of Java Game Programming by Joel Fan Sams Macmillan Computer Publishing ISBN 1571690433 Pub Date 11 01 96 Previous Table of Contents Next The cmAbstractVehicle Class This is the most comprehensive class in the game layer. What distinguishes a vehicle from all other moving objects is that it can be controlled. It also travels in the direction that it faces. Controlling the vehicle is done through the methods supplied in the class. The abstract vehicle is interested in collisions with structures and the default behavior is to stop. The steering of the vehicle is done through methods like turnLeft turnRight and so on. The factor argument in these methods must be between 0 and 1 and tells the vehicle how much of .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.