蜘蛛飞机大战

欢迎来到程序小院

蜘蛛飞机大战

复制代码
玩法:
点击开始游戏,鼠标移动控制方向,可自由移动飞机打剁掉方飞机下落的子弹并打掉敌方飞机,三次生命,不同关卡不同奖励,快去闯关吧^^。

开始游戏https://www.ormcc.com/play/gameStart/189

html

复制代码
<div id="container_zzfj">
    <canvas width="320" height="480" class="canvas" style="background-image: none; background-color: transparent; "></canvas>
    <div id="banadaaa" style="display: block; "></div>
    <div id="consoleaaa" style="display: none; text-align: left; "></div>
</div>

css

复制代码
#container_zzfj {
    width: 320px;
    height: 480px;
    margin: 0px auto;
    padding: 0px;
    position: relative;
}

#container_zzfj .canvas {
    background-color: #000;
    z-index: -1;
    width: 100%;
    height: 100%;
}

#consoleaaa {
    position: absolute;
    height: 400px; width: 300px;
    top: 0px; left: 0px;
    overflow: auto;
    font-family: Helvetica;
    color: white;
    z-index: 3;
}

#banadaaa {
    width: 320px;
    height: 50px;
    background-color: transparent;
    z-index: 2;
    position: absolute;
    margin: 0px auto;
    padding: 0px;
    left: 0px; top: 320px;
}

js

复制代码
function getData()
{
 AJAX.gameId = "";
 AJAX.playerId = "";
 g.displayBanner = 0;
 g.qs = window.location.search.substring(1).split("&");
 for (var a=0;a < g.qs.length;a++)
 {
  var s = g.qs[a].split("=");
  write(s[0] + " = " + s[1]);
  switch(s[0])
  {
   case "banner":
    g.displayBanner = s[1];
    break;
   case "gameId":
    AJAX.gameId = s[1];
    break;
   case "playerId":
    AJAX.playerId = s[1];
    break;
  }
 }
};

function postData()
{
 AJAX.ts = g.time;
 AJAX.score = m.player.score;

 $.ajax({
  url: AJAX.url,
  type: "get",
  data: "user=" + AJAX.user + "&pass=" + AJAX.pass + "&gameId=" + AJAX.gameId + "&playerId=" + 
    AJAX.playerId + "&ts=" + AJAX.ts + "&score=" + AJAX.score,
  success: function(msg){
   write("Data Sent Successfully !");
  },
  error: function(jqXHR, textStatus, errorThrown) {
   write("Send error: " + jqXHR);
   write("Send error (" + textStatus + "): " + errorThrown);
  }
 });

 write("SENT user = " + AJAX.user);
 write("SENT pass = " + AJAX.pass);
 write("SENT gameId = " + AJAX.gameId);
 write("SENT playerId = " + AJAX.playerId);
 write("SENT ts = " + AJAX.ts);
 write("SENT score = " + AJAX.score);
};

/*
 ------------------------------------------------------------------------------------
*/

var g = {};
g.go = 0;

var m = {
 spritesheets : [],
 player : null,
 explosion : [],
 lasers : [],
 aliens : [],
 alienbomb : [],
 textsprites : [],
 bonusitems : []
};

var stars = [];
var dots = [];
var gameaudio = [];

g.checkSum = gamedata.imageFiles.length;// + gamedata.audioFiles.length; 
g.checkCount = 0;
g.imageData = [];
g.audioData = [];
g.aliensarray = [];

g.colours = [];
g.colours[0] = "#bf0000";
g.colours[1] = "#4386d0";
g.colours[2] = "#28d98c";
g.colours[3] = "#3de231";
g.colours[4] = "#d8e231";
g.colours[5] = "#feba4f";
g.colours[6] = "#fe5b4f";
g.colours[7] = "#fe4fd7";
g.colours[8] = "#ca4ffe";

g.explosionColours = [];
g.explosionColours[0] = "#ffffaa";
g.explosionColours[1] = "#ffe651";
g.explosionColours[2] = "#ffc51f";
g.explosionColours[3] = "#ff911a";
g.explosionColours[4] = "#e7623e";
g.explosionColours[5] = "#a81300";

function createStars()
{
 for (var a=0;a<20;a++)
 {
  stars[a] = new star("star"+a, rnd(g.canvaswidth), rnd(g.canvasheight), 4, rnd(2)+1, 4, g.colours[rnd(g.colours.length)-1]);
 }
};

function createDots()
{
 for (var a=0;a<100;a++)
 {
  dots[a] = new dot("dot"+a, rnd(g.canvaswidth), rnd(g.canvasheight), 4, rnd(2)+1, 4, g.colours[rnd(g.colours.length)-1]);
 }
};

源码https://www.ormcc.com/

需要源码请关注添加好友哦^ ^

转载:欢迎来到本站,转载请注明文章出处https://ormcc.com/

相关推荐
雨中散步撒哈拉7 分钟前
17、做中学 | 初三下期 Golang文件操作
开发语言·后端·golang
Baklib梅梅21 分钟前
员工手册:保障运营一致性与提升组织效率的核心载体
前端·ruby on rails·前端框架·ruby
CoderYanger25 分钟前
C.滑动窗口——1423. 可获得的最大点数
java·开发语言·算法·leetcode·1024程序员节
全栈陈序员28 分钟前
【Python】基础语法入门(九)—— 代码规范、调试技巧与性能初探
开发语言·python·代码规范
合作小小程序员小小店30 分钟前
图书管理系统,基于winform+sql sever,开发语言c#,数据库mysql
开发语言·数据库·sql·microsoft·c#
Yue丶越30 分钟前
【C语言】数据在内存中的存储
c语言·开发语言·网络
FakeOccupational1 小时前
电路笔记(信号):网线能传多少米?网线信号传输距离
开发语言·笔记·php
IT_陈寒1 小时前
Redis性能翻倍的5个冷门技巧,90%开发者都不知道第3个!
前端·人工智能·后端
李宥小哥1 小时前
Redis10-原理-网络模型
开发语言·网络·php
利刃大大1 小时前
【c++中间件】语音识别SDK && 二次封装
开发语言·c++·中间件·语音识别