欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

高級:利用Flash制作精彩的迷宮游戲_Flash教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:Flash制作紅外線引導(dǎo)導(dǎo)彈爆炸視覺效果
前幾天的一篇文章,用Flash輕松制作電子發(fā)散視覺效果動畫好多人都問有什么用?今天就再繼續(xù)一下!看看紅外線引導(dǎo)導(dǎo)彈爆炸效果。爆炸的代碼我們還使用前面那

  在以前的教程中我們講解了利用Flash制作游戲的一些方法,比如碰撞的檢測等,在這個教程中我們利用以前學(xué)的知識創(chuàng)建一個不錯的迷宮游戲!該教程主要是Flash利用材質(zhì)和遮照創(chuàng)建真實的小球動畫的延續(xù),利用創(chuàng)建好的小球滾動動畫制作迷宮游戲。

  在這篇教程中沒有新的知識,就是利用一個舞臺(地圖),然后還有一個運(yùn)動的小球?qū)崿F(xiàn)的一個小的Flash游戲。

  一共制作了兩個迷宮動畫效果。

  一、背景不動的迷宮游戲

  預(yù)備好一幅背景之后,直接輸入下面代碼。

level = new Array();
_root.attachMovie("starz", "starz", 1);
_root.createEmptyMovieClip("bricks", 2);
level[0] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0);
level[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
level[2] = new Array(1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1);
level[3] = new Array(1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1);
level[4] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
level[5] = new Array(1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1);
level[6] = new Array(1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1);
level[7] = new Array(1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1);
level[8] = new Array(1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1);
level[9] = new Array(1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1);
level[10] = new Array(0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1);
for (y=0; y<=10; y ) {
for (x=0; x<=11; x ) {
if (level[y][x] == 1) {
place_brick = bricks.attachMovie("brick", "brick_" bricks.getNextHighestDepth(), bricks.getNextHighestDepth(), {_x:x*40 30, _y:y*40 30});
}
}
}
_root.attachMovie("ball", "ball", _root.getNextHighestDepth(), {_x:30, _y:30});
ball.texture.setMask(ball.ball_itself);
power = 0.4;
yspeed = 0;
xspeed = 0;
friction = 0.99;
ball.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;
}
if (Key.isDown(Key.RIGHT)) {
xspeed = power;
}
if (Key.isDown(Key.UP)) {
yspeed -= power;
}
if (Key.isDown(Key.DOWN)) {
yspeed = power;
}
xspeed *= friction;
yspeed *= friction;
this._y = yspeed;
this._x = xspeed;
this.texture._y = yspeed;
this.texture._x = xspeed;
if (this.texture._x>53) {
this.texture._x -= 63;
}
if (this.texture._x<-53) {
this.texture._x = 63;
}
if (this.texture._y>53) {
this.texture._y -= 63;
}
if (this.texture._y<-53) {
this.texture._y = 63;
}
brick_x = Math.floor((this._x-10)/40);
brick_y = Math.floor((this._y-10)/40);
if (level[brick_y][brick_x]!=1) {
this._x = 30;
this._y = 30;
xspeed = 0;
yspeed = 0;
}
};

分享:Flash問答:一個簡單的字母順序變化效果
問:我設(shè)定一個動態(tài)文本框var=zimu,我想讓它不停的按順序顯示A-Z26個字母,然后當(dāng)顯示到指定T時,則停止下來。這個效果用AS怎么寫啊?(終極討厭)答:

/所屬分類:Flash教程/更新時間:2008-03-05
相關(guān)Flash教程