tailieunhanh - ActionScript 3.0 Game Programming University, Second Edition phần 6

Bạn cũng có thể làm động hoặc một trong các clip phim mà không cần thêm bất kỳ mã bổ sung. Nó sẽ được vui vẻ Để bắt đầu với một số xử lý thẻ, chúng tôi sử dụng một thẻ duy nhất chơi trò chơi rất đơn giản đi rất nhiều cái tên. Hãy gọi nó là cao hơn hoặc thấp hơn. Những tiền đề cơ bản là thẻ được xử lý | 272 Chapter 7 Direction and Movement Air Raid II Space Rocks and Balloon Pop Each of the three level frames needs a call to startLevel startLevel Also the intro frame needs to have the button set up to start the game stop clickStart function clickStart event MouseEvent startBalloonPop Similarly the levelover frame needs to set its button to call to clickNextLevel in the main class clickNextLevel Finally the gameover frame needs a button script too playAgainClick function playAgainClick e MouseEvent gotoAndStop intro Modifying the Game This is another one of those games that can be used for a lot of different purposes. You could replace the balloons as well as the cannon with any object. You can also animate either one in the movie clip without adding any additional code. It would be fun to see a flailing circus clown get shot out of the cannon for instance. Of course you could add more levels easily enough. Add as many as you like with interesting challenges for a player like trying to use as few cannonballs as possible. Notice that the speed variable is not a constant. It certainly can be because it is set at 6 and then never changed. One way it can be used with different values is to reassign it a value on each level frame. On levels 1 to 10 it might be 6 but then on level 11 it could change to a 7 with a corresponding change to a larger cannon graphic to represent a more powerful cannon. Another variation could include some balloons or other objects that stop the cannonball. If the cannonball hits the objects the ball s journey is over and the object acts as protection for the other balloons. These new elements could persist or they could be destroyed with the first hit. This adds another layer of strategy to future levels. Wow eBook 8 Casual Games Match Three and Collapsing Blocks Reusable Class Point .

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.