首页  |  精品网站  |  原创作品秀   |  艺术设计  |  网络学院  |  信息中心  |  站内搜索  |  求职招聘  |  建站资源  |  服装网站  |  编程开发 |  设计论坛 
  平面设计 画册 VI欣赏 包装 CG-插画   酷站 个人网页 商业网站   Alexa排名 CSS 建站资源 下载专区 JS特效 品牌服装 服装院校   专题欣赏 SEO 图标欣赏
域名注册 虚拟主机 广州网站建设 广州网页设计 IDC赞助 设计资源下载 虚拟主机 域名注册 品牌网站建设 服装品牌网站建设 广告服务 网站推广 娱乐
当前位置:首 页 >> 网络学院 >> Flash ※ FreeHand >> flash走迷宫游戏的制作基础实例

flash走迷宫游戏的制作基础实例


中资源
转载请注明出处-中国设计秀-cnwebshow.com


waypoint_x = new Array(40, 140, 140, 220, 220, 80, 80, 340, 340, 420, 420);
waypoint_y = new Array(140, 140, 60, 60, 240, 240, 320, 320, 100, 100, -20);
delay = 25;
new_monster = 0;
monsters_placed = 0;
onEnterFrame = function () {
 if (monsters_placed<25) {
  new_monster++;
 }
 if (new_monster == delay) {
  monsters_placed++;
  new_monster = 0;
  min = attachMovie("minion", "minion"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:40, _y:-20});
  min.point_to_reach = 0;
  min.speed = 1;
  min.onEnterFrame = function() {
   dist_x = waypoint_x[this.point_to_reach]-this._x;
   dist_y = waypoint_y[this.point_to_reach]-this._y;
   if ((Math.abs(dist_x)+Math.abs(dist_y))<1) {
    this.point_to_reach++;
   }
   angle = Math.atan2(dist_y, dist_x);
   this._x = this._x+this.speed*Math.cos(angle);
   this._y = this._y+this.speed*Math.sin(angle);
   this._rotation = angle/Math.PI*180-90
  };
 }
};

测试结果!good luck to you!



<< 1 2 >>
转载请注明出处-中国设计秀-cnwebshow.com



投稿 】【对本文进行评论】 【字体: 】【发布于2007-10-15 14:31】

相关专题:暂无相关专题

上一篇:this的使用   下一篇:Flash文本框局部文本样式的控制
欢迎投稿
 认证LOGO下载
     
Copyright © 2005-2007 中国设计秀_网页设计教程_优秀网页设计欣赏_平面设计欣赏 All Right Reserved.
做最专业的设计服务网站,秀出自我,秀出精彩!中国设计秀,秀---无处不在!!
QQ:54292427  8208442 MSN:kingvisual#hotmail.com 交流群:9107036 3848215 8850631
粤ICP备05067046号 RSS