摘要:隨著Internet和計算機新技術的飛快發展,計算機和游戲的結合逐步的緊密,游戲漸漸成為人們生活中必不可少的一部分。該文通過flash中AS腳本技術實現“饞嘴蟲”這一實例,詳細闡述用flash中AS腳本實現益智游戲的方法。
關鍵詞:flash;益智游戲;AS腳本
中圖分類號:TP37 文獻標識碼:A 文章編號:1009-3044(2014)20-4820-03
Design and Implementation of Flash in AS Script Development Puzzle Game
HU Qiao-ling1, LI Sha2
(1.The Department of Art and Design, Zhengzhou 450044,China; 2. Zhengzhou College of Finance and Economics, Department of Architectural Engineering, Zhengzhou 450044,China)
Abstract: With the rapid development of new technology of Internet and computer, the combination of computer and game gradually close, the game has become an indispensable part of people's life. In this paper, through the realization of \"greedy worm\" this instance of the AS script in the flash technology, explains the realization method of puzzle game with flash AS script.
Key words: flash; game; AS script
Flash的流行是信息化社會發展的必然結果,也因它本身有著許多獨特的優點。目前Flash被廣泛應用于游戲設計、網頁設計、網頁廣告、網絡動畫、多媒體教學軟件和電子相冊等領域。該文主要針對AS腳本實現益智游戲開發設計領域而言的,AS(ActionScript)腳本是Flash內置的一種編程語言,它可以實現復雜的交互功能。Flash的風靡和流行給人們帶來娛樂的同時,也推動了更多周邊產業的發展。
1 益智游戲“饞嘴蟲”實例過程
1.1 實例描述
本實例設計的是一個饞嘴蟲小游戲,在整個過程中用鍵盤上的方向鍵來控制蟲子去吃橙色的小球,橙色的小球被吃后又會隨機出現在別的地方,而蟲子每吃一個小球,身體就會增加一個小球的長度。
1.2 實例中涉及的主要AS腳本語句
1) gotoAndPlay():跳轉函數。作用是跳轉到用幀標簽或幀編號指定的某一特定幀并繼續播放。
類似語句還有gotoAndStop():作用是通知播放頭跳轉到某一幀
并在該幀停止。
2) 影片剪輯的屬性設置
除了控制動畫的播放過程外,動畫的交互性還體現在對影片剪輯屬性的控制方面,在Flash中,用于控制影片剪輯屬性的語句主要有這樣幾點:
①_x和_y屬性代表影片剪輯在場景中的水平坐標和垂直坐標。……