Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
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 startButton.addEventListener MouseEvent.CLICK clickStart function clickStart event MouseEvent startBalloonPop Similarly the levelover frame needs to set its button to call to clickNextLevel in the main class nextLevelButton.addEventListener MouseEvent.CLICK clickNextLevel Finally the gameover frame needs a button script too playAgainButton.addEventListener MouseEvent.CLICK 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 WoweBook.Com 8 Casual Games Match Three and Collapsing Blocks Reusable Class Point .