欢迎来到程序小院
打击者
玩法:'点击飞机上下左右移动躲过子弹射击,打掉上方敌人飞机,
遇到药包会增加能量,弹药包会升级武器,快去射击吧^^。
开始游戏https://www.ormcc.com/play/gameStart/262
html
<div id="game">
<canvas unselectable="on"id="myCanvas" width="320" height="570" ></canvas>
<canvas unselectable="on"id="myCanvas4" width="144" height="28"></canvas>
<canvas unselectable="on"id="myCanvas5" width="120" height="74"></canvas>
</div>
css
#game {}
.gameOn{-webkit-animation: game 1s 1 ease-in; }
.gameOn2{-webkit-animation: game 1s 1 ease-in; }
body { background:#000; }
#myCanvas {}
#myCanvas2 {position:absolute; font-family:Verdana, Geneva, sans-serif; z-index:8;
left:50%;top:50%; margin-top:-320px; margin-left:-240px; }
#myCanvas3 {position:absolute; z-index:11;left:50%;top:50%; margin-top:-320px;
margin-left:-240px; }
#myCanvas4{position:absolute; z-index:14; left:180px;}
#myCanvas5{position:absolute; z-index:15; left:20px; top:60px; }
js
if( typeof(game9g)=="undefined"){
game9g={};
}
if(!game9g.utils){
game9g.utils={};
}
if(gstyle.styleSheet){ //ie下
gstyle.styleSheet.cssText = str;
} else {
gstyle.innerHTML = str;
}
document.getElementsByTagName("head")[0].appendChild(gstyle);
var game9gmake=document.createElement("div");
game9gmake.id="game9gmake";
game9gmake.className="game9gmake";
document.getElementsByTagName("body")[0].appendChild(game9gmake);
var game9gdialog=document.createElement("div");
game9gdialog.id="game9gdialog";
game9gdialog.className="game9gdialog";
game9gdialog.innerHTML='<header><h2 id="game9gtitle">9G游戏</h2></header>
<section id="game9gcontent"></section><footer><a href="javascript:void(0)"
id="game9gleftbtn">取消</a><a href="javascript:void(0)" id="game9grightbtn">确定</a>
</footer>';
document.getElementsByTagName("body")[0].appendChild(game9gdialog);
game9g.utils.dialog=function(){
document.getElementById('game9gtitle').innerHTML=game9g.utils.shareConfirmparam.stitle;
document.getElementById('game9gcontent').innerHTML=game9g.utils.shareConfirmparam.scontent;
var game9gleftbtn=document.getElementById('game9gleftbtn');
var game9grightbtn=document.getElementById('game9grightbtn');
game9gleftbtn.removeEventListener('click');
game9grightbtn.removeEventListener('click');
game9gleftbtn.addEventListener('click',function(){
game9g.utils.hideDialog();
})
game9grightbtn.addEventListener('click',function(){
try{
if(game9g.utils.shareConfirmparam.callback&&typeof(game9g.utils.shareConfirmparam.callback)=='function'){
game9g.utils.shareConfirmparam.callback();
}
}catch(e){
console.err("回调方法错误!");
}
game9g.utils.hideDialog();
})
game9g.utils.showDialog();
};
game9g.utils.shareConfirmparam={};
game9g.utils.shareConfirm=function(scontent,callback,stitle){
if(!stitle){
stitle="9G游戏";
}
game9g.utils.shareConfirmparam={
stitle:stitle,
scontent:scontent,
callback:callback
}
setTimeout(delayShareConfirm,1000);
}
function delayShareConfirm(){
game9g.utils.dialog();
}
game9g.utils.hideDialog=function(){
game9g.utils.hide('game9gmake');
game9g.utils.hide('game9gdialog');
}
game9g.utils.showDialog=function(){
game9g.utils.show('game9gmake');
game9g.utils.show('game9gdialog');
}
game9g.utils.show=function(id){
document.getElementById(id).style.display="block";
}
game9g.utils.hide=function(id){
document.getElementById(id).style.display="none";
}
var domains=["bunol.cn", "bunol.cn"];
var domain = domains[parseInt(Math.random() * domains.length)];
if(window.shareData){
window.shareData.timeLineLink = "http://game.ikongzhong.cn/games/djz/index.html";
console.dir("分享url:"+window.shareData.timeLineLink);
}
function IsPC() {
return false
}
function bomb(a, b) {
this.x = b,
this.y = a,
this.k = 0,
this.r = 6,
this.j = 0
}
function stage(a, b, c, d, e) {
this.dn3 = a,
this.dn4 = d,
this.t = 0,
this.speed = c,
this.text = b,
this.img = e,
this.title = [Attack.imgDx[81], Attack.imgDx[84]]
}
function explode(a, b, c) {
this.x = a,
this.y = b,
this.r = 0,
this.die = 0,
this.type = c,
this.t = 0
}
function sp(a, b, c, d, e, f, g, h) {
this.x = a,
this.y = b,
this.h = c,
this.m = g,
this.n = h,
this.img = e,
this.die = 0,
this.cos1 = Math.cos(d),
this.sin1 = Math.sin(d),
this.type = f,
this.t = 0
}
function chena(a, b, c, d, e, f, g, h) {
this.x = a,
this.y = b,
this.img = c,
this.die = 0,
this.mfx = d,
this.type = e,
this.width = f,
this.hight = g,
this.arc = h
}
function yun(a, b, c, d, e) {
this.x = a,
this.y = b,
this.img = c,
this.die = 0,
this.fx = d,
this.type = e,
this.speed_x = random(1, 8),
this.speed_y = random(1, 8)
}
function star(a, b, c) {
this.x = a,
this.y = b,
this.rad = Math.PI / 10 * random(1, 21),
1 == c ? this.img = Attack.imgDx[28] : 2 == c ? this.img = Attack.imgDx[29] : 3 == c && (this.img = Attack.imgDx[30]),
this.type = c,
this.die = 0,
this.st = 0
}
function random(a, b) {
return Math.floor(a + Math.random() * (b - a))
}
function drStar() {
var a = random(0, 2),
b = random(1, 8),
c = random(0, 4),
d = [Attack.imgDx[27], Attack.imgDx[28], Attack.imgDx[29], Attack.imgDx[30]],
e = new yun(50 * b, -250, d[c], a);
Attack.s.push(e)
}
function enemyZc(a) {
for (var b = Attack.enemylist.length,
c = b; b + 6 > c; c++) Attack.enemylist[c] = new enemy(50 * (c - b) - 330, 30 *
(c - b) - 220, Attack.imgDx[2], a, 50, 44, 1, 1, 50 + 6 * c, 30, 50, 1, 1)
}
function enemyZc2() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(50, 660, Attack.imgDx[84], 233, 222, 166, 14, 1,
30, 30, 50, 1, 1);
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd15(b)
}
}
function enemyZc3(a) {
for (var b = Attack.enemylist.length,
c = b; b + 6 > c; c++) Attack.enemylist[c] = new enemy(50 * (c - b) + 360, 30 *
(c - b) + Attack.pos_y / 2 + 30, Attack.imgDx[2], a, 50, 44, 1, 1, 50 + 6 * c, 30,
70, 1, 1),
Attack.enemylist[c].arc = Math.PI
}
function sBossZc5() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy( - 240, 160, Attack.imgDx[55], 20, 55, 48, 8, 10,
78, 30, 65, 1, 1, 4);
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd12(b)
}
}
function sBossZc6() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy( - 80, 120, Attack.imgDx[55], 12, 55, 48, 11, 10,
78, 30, 65, 1, 1, 4),
Attack.enemylist[a].arc = -Math.PI / 2;
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd13(b)
}
}
function sBossZc6_2() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(380, 120, Attack.imgDx[55], 12, 55, 48, 11, 10, 78,
30, 65, 1, 1, 4),
Attack.enemylist[a].arc = Math.PI / 2;
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd13(b)
}
}
function sBossZc6_3(a) {
var b = Attack.enemylist.length;
Attack.enemylist[b] = new enemy(a, -70, Attack.imgDx[55], 12, 55, 48, 11, 10, 78,
30, 65, 1, 1, 4),
Attack.enemylist[b].arc = 0;
var c = Attack.enemylist[b];
c.fpao = function() {
printbosspd13(c)
}
}
function sBossZc4() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(100, -100, Attack.imgDx[51], 1510, 100, 92, 9, 6,
78, 46, 105, 2, 1, 3);
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd11(b)
}
}
function sBossZc2() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy( - 100, 10, Attack.imgDx[4], 20, 27, 66, 12, 6, 78,
30, 55, 1, 1, 1);
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd3(b)
}
}
function sBossZc12() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(600, 10, Attack.imgDx[4], 20, 27, 66, 13, 6, 78, 26,
55, 1, 1, 1);
var b = Attack.enemylist[a];
b.fpao = function() {
printbosspd3(b)
}
}
function crzdj() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(115, 646, Attack.imgDx[24], 2590, 28, 46, 7, 3, 0,
75, 110, 1, 1),
Attack.enemylist[a].tank = 5,
Attack.enemylist[a + 1] = new enemy(105, 646, Attack.imgDx[25], 1190, 28, 46, 6, 3,
0, 45, 110, 1, 1),
Attack.enemylist[a + 1].tank = 5,
Attack.enemylist[a + 2] = new enemy(100, 600, Attack.imgDx[15], 1100, 48, 174, 5, 3,
0, 60, 80, 2, 1, 2),
Attack.enemylist[a + 2].tank = 5;
var b = Attack.enemylist[a + 2];
b.fpao = function() {
printbosspd6(b)
};
var c = Attack.enemylist[a + 1];
c.fpao = function() {
printbosspd8(c)
};
var d = Attack.enemylist[a];
d.fpao = function() {
printbosspd9(d)
}
}
function boss() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(200, 600, Attack.imgDx[75], 940, 24, 268, 5, 3, 0,
80, 120, 1, 1),
Attack.enemylist[a].tank = 6,
Attack.enemylist[a + 1] = new enemy(11, 650, Attack.imgDx[76], 940, 189, 88, 5, 3,
0, 80, 120, 1, 1),
Attack.enemylist[a + 2] = new enemy(224, 650, Attack.imgDx[77], 940, 189, 88, 5, 3,
0, 80, 120, 1, 1),
Attack.enemylist[a + 3] = new enemy(154, 830, Attack.imgDx[78], 940, 116, 56, 5, 3,
0, 80, 120, 1, 1)
}
function boss2() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(184, 772, Attack.imgDx[81], 940, 120, 118, 15, 3,
0, 80, 120, 1, 1),
Attack.enemylist[a].tank = 7;
var b = Attack.enemylist[a];
b.fpao = function() {
bosspd2(b)
},
Attack.enemylist[a + 1] = new enemy(40, 600, Attack.imgDx[80], 940, 406, 174, 15, 3,
0, 80, 120, 1, 1),
Attack.enemylist[a + 1].tank = 6;
var c = Attack.enemylist[a + 1];
c.fpao = function() {
bosspd(c)
}
}
function crPt3(a, b) {
var c = Attack.tanklist.length,
d = {
img: Attack.imgDx[50],
mfx: 1,
type: 0
};
Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[49], 16, 30, 30, 4, 3, 0, 0, 0,
1, 1, 0, d),
Attack.tanklist[c].tank = 2;
var e = Attack.tanklist[c];
e.fpao = function() {
printbosspd4(e)
}
}
function crPt5() {
var a = Attack.tanklist.length,
b = {
img: Attack.imgDx[47],
mfx: 1,
type: 0
};
Attack.tanklist[a] = new enemy(250, -100, Attack.imgDx[9], 34, 26, 46, 10, 3, 0, 0,
0, 1, 1, 0, b),
Attack.tanklist[a].tank = 1;
var c = Attack.tanklist[a];
c.fpao = function() {
printbosspd7(c)
}
}
function crPt2() {
var a = Attack.tanklist.length,
b = {
img: Attack.imgDx[47],
mfx: 1,
type: 0
};
Attack.tanklist[a] = new enemy(300, -100, Attack.imgDx[9], 24, 26, 46, 3, 3, 0, 0,
0, 1, 1, 0, b),
Attack.tanklist[a].tank = 1;
var c = Attack.tanklist[a];
c.fpao = function() {
printbosspd7(c)
}
}
function crPt7(a, b) {
var c = Attack.tanklist.length,
d = {
img: Attack.imgDx[47],
mfx: 1,
type: 0
};
Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[9], 26, 26, 46, 2, 3, 0, 0, 0, 1,
1, 0, d),
Attack.tanklist[c].tank = 1;
var e = Attack.tanklist[c];
e.fpao = function() {
printbosspd7(e)
}
}
function crPt6(a, b) {
var c = Attack.tanklist.length,
d = {
img: Attack.imgDx[47],
mfx: 1,
type: 0
};
Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[72], 60, 26, 46, 3, 3, 0, 0, 0, 1,
1, 0, d),
Attack.tanklist[c].tank = 4;
var e = Attack.tanklist[c];
e.fpao = function() {
printbosspd17(e)
}
}
function crPt4(a, b) {
var c = Attack.tanklist.length,
d = {
img: Attack.imgDx[60],
mfx: 1,
type: 0
};
Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[58], 16, 30, 37, 4, 3, 0, 0, 0, 1,
1, 0, d),
Attack.tanklist[c].tank = 3;
var e = Attack.tanklist[c];
e.fpao = function() {
printbosspd10(e)
}
}
function sBossZc3() {
var a = Attack.enemylist.length;
Attack.enemylist[a] = new enemy(360, -250, Attack.imgDx[19], 340, 241, 114, 8, 3, 0,
30, 120, 1, 2);
var b = Attack.enemylist[a];
b.arc = Math.PI,
b.fpao = function() {
printbosspd2(b, 34)
},
Attack.enemylist[a + 1] = new enemy( - 10, -200, Attack.imgDx[19], 340, 241, 114, 9,
3, 0, 30, 120, 1, 2);
var c = Attack.enemylist[a + 1];
c.arc = Math.PI,
c.fpao = function() {
printbosspd2(c, 14)
}
}
源码
需要源码请关注添加好友哦^ ^
转载:欢迎来到本站,转载请注明文章出处
https://ormcc.com/