javascript飞机大战-----001分析】的更多相关文章

1.游戏引擎 首先要做飞机大战要考虑的是这个游戏被分成了哪几大部分?这样我们一块一块去做,特别清晰明了.那么接下来我们就简单的分析下飞机大战分成了哪几大部分 1.游戏引擎 2.英雄机 3.敌机 4.子弹 5.敌机还分为小型 中型 大型 不过这个我们可以直接继承敌机的一些方法就好了 那么接下来我们逐个分析每一大块里面主要的属性和方法 游戏引擎 属性: 游戏状态=====>gameStatus 所有敌机=====>enemy 所有子弹=====>bullet 游戏分数=====>scr…
微信小游戏 demo 飞机大战 代码分析(四)(enemy.js, bullet.js, index.js) 微信小游戏 demo 飞机大战 代码分析(一)(main.js) 微信小游戏 demo 飞机大战 代码分析(二)(databus.js) 微信小游戏 demo 飞机大战 代码分析(三)(spirit.js, animation.js) 本博客将使用逐行代码分析的方式讲解该demo,本文适用于对其他高级语言熟悉,对js还未深入了解的同学,博主会尽可能将所有遇到的不明白的部分标注清楚,若有不…
微信小游戏 demo 飞机大战 代码分析(三)(spirit.js, animation.js) 微信小游戏 demo 飞机大战 代码分析(一)(main.js) 微信小游戏 demo 飞机大战 代码分析(二)(databus.js) 微信小游戏 demo 飞机大战 代码分析(四)(enemy.js, bullet.js, index.js) 本博客将使用逐行代码分析的方式讲解该demo,本文适用于对其他高级语言熟悉,对js还未深入了解的同学,博主会尽可能将所有遇到的不明白的部分标注清楚,若有不…
微信小游戏 demo 飞机大战 代码分析(二)(databus.js) 微信小游戏 demo 飞机大战 代码分析(一)(main.js) 微信小游戏 demo 飞机大战 代码分析(三)(spirit.js, animation.js) 微信小游戏 demo 飞机大战 代码分析(四)(enemy.js, bullet.js, index.js) 本博客将使用逐行代码分析的方式讲解该demo,本文适用于对其他高级语言熟悉,对js还未深入了解的同学,博主会尽可能将所有遇到的不明白的部分标注清楚,若有不…
微信小游戏 demo 飞机大战 代码分析(一)(main.js) 微信小游戏 demo 飞机大战 代码分析(二)(databus.js) 微信小游戏 demo 飞机大战 代码分析(三)(spirit.js, animation.js) 微信小游戏 demo 飞机大战 代码分析(四)(enemy.js, bullet.js, index.js) 本博客将使用逐行代码分析的方式讲解该demo,本文适用于对其他高级语言熟悉,对js还未深入了解的同学,博主会尽可能将所有遇到的不明白的部分标注清楚,若有不…
今天来写个游戏,飞机大战 1,布局 2,思路 1,动态创建自己的飞机 让它在规定的区域,跟着鼠标运动. 2,在自己飞机的上方,间隔1s生成子弹.子弹往上移动 当top:0 子弹消失 3,每隔1s 产生敌机  top 0,left 随机,敌机向下移动,敌机超过边距时.敌机消失. 4,子弹和敌机相遇时.子弹和敌机同时消失 3,代码 1,动态创建自己的飞机 让它在规定的区域,跟着鼠标运动. let view = document.getElementById('view'); // 创建自己的飞机 l…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{margin:0;padding:0;} .game{ position:relative; width: 320px; height: 568px; margin: 50px auto; b…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{margin:0;padding:0;} .game{ position:relative; width: 320px; height: 568px; margin: 50px auto; b…
/* 创建敌机: */ function Enemy(blood,speed,imgs,scroe){ //敌机left this.left = 0; //敌机top this.top = 0; //敌机血量 this.blood = blood; //敌机速度 this.speed = speed; //敌机图片集合 this.imgs = imgs;//爆炸前和爆炸后 //分数 this.scroe = scroe; } Enemy.prototype = { constructor:Ene…
先写一个敌机类 /* 创建敌机: */ function Enemy(blood,speed,imgs){ //敌机left this.left = 0; //敌机top this.top = 0; //敌机血量 this.blood = blood; //敌机速度 this.speed = speed; //敌机图片集合 this.imgs = imgs;//爆炸前和爆炸后 } Enemy.prototype = { constructor:Enemy, init:function(){ //…