game-04-21
来源:互联网 发布:ubuntu 串口调试工具 编辑:程序博客网 时间:2024/06/14 03:45
<html>
<head>
<title>game</title>
<script>
var SCREEN_WIDTH = 0,
SCREEN_HEIGHT = 0,
BACKGROUND_COLOR = "#1d1d1d";
var b = new Image;
var m_math;
//function dot_Sprite(){
//alert("dot_Sprite()");
var PI = 3.1415926;
//}
//var dot_ScoreContext = function(){};
function dot_Math(){
//alert("dot_Math");
this.load = function(){
//alert("dot_Math.load()");
this.m_sin = Array(1440);
//alert(this.m_sin.length);
this.m_cos = Array(1440);
//alert(this.m_cos.length);
/*
for(var a = 0,b = 0;1440>b;b++){
alert("b---"+b);
this.m_sin[b] = Math.sin(a * PI/180);
//alert("this.m_sin["+b+"]---"+this.m_sin[b]);
this.m_cos[b] = Math.cos(a * PI / 180);
a+= 0.25;
alert("this.m_cos["+b+"]---"+this.m_cos[b]);
}
*/
for(var a = 0,b = 0;1440>b;b++)//alert("b---"+b),
this.m_sin[b] = Math.sin(a * PI/180),
//alert("this.m_sin["+b+"]---"+this.m_sin[b]),
this.m_cos[b] = Math.cos(a * PI / 180),
a+= 0.25;
//alert("this.m_cos["+b+"]---"+this.m_cos[b]);
this.msquare = Array(600);
for(b=0;b<this.msquare.length;b++)this.msquare[b] = b * b;//alert("this.msquare["+b+"]-------"+this.msquare[b] );
}
}
function dot_Button(){
//alert("dot_Button");
this.create = function(a,b,c,d,e){
alert(a+''+b+''+c+''+d+''+e);
}
}
this.update = function(){
//alert("update()");
m_heartBeat.update(m_elapsed);
}
var m_button_start;
var img_buttons = 'aaaa';
this.appInit = function(){
alert("this.appInit()");
//m_heartBeat = new HeartBeat;
m_button_start = new dot_Button;
//m_button_start();
m_button_start.create(img_buttons, 0, 26, 40, 13);
//dot_ScoreContext.prototype = new dot_Sprite;
//alert(new dot_Sprite);
//dot_ScoreContext.prototype = new dot_Sprite;
//alert("dot_ScoreContext.prototype--"+dot_ScoreContext.prototype);
//dot_ScoreContext.prototype.constructor = dot_ScoreContext;
m_math = new dot_Math;
m_math.load();
setInterval(function(){
//alert("setInterval()");
update();
},1000);
}
this.updatePreloader = function(){
m_context.fillStyle = BACKGROUND_COLOR;
//alert("m_context.fillStyle---------"+m_context.fillStyle);
m_context.fillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT);
//alert("m_context.fillRect()-------OK");
//alert("b---"+b);
b.src = "./images/brand_logo.png";
//alert("b.src---"+b.src);
m_context.drawImage(b,30,30);
//alert("m_context.drawImage(img_brand_logo,30,30)----------OK");
b.src = "./images/load_bar.png";
//alert("b.src----"+b.src);
m_context.drawImage(b,30,100);
//alert("m_context.drawImage(b,30,100);---------------OK");
appInit();
}
this.screenResize = function(){
//alert("this.screenResize()");
m_canvas = document.createElement("canvas");
//alert("m_canvas---"+m_canvas);
m_canvas.setAttribute("id","game_canvas")
//alert("id---"+m_canvas.getAttribute("id"));
m_canvas.setAttribute("width",""+SCREEN_WIDTH);
//alert("m_canvas.getAttribute('width')----"+m_canvas.getAttribute("width"));
m_canvas.setAttribute("height",""+SCREEN_HEIGHT);
//alert("m_canvas.getAttribute('height')----"+m_canvas.getAttribute("height"));
document.body.appendChild(m_canvas);
//alert("documen.body.appendChild(m_canvas)-------ok");
m_canvas.setAttribute("style","border:1px solid red;width:400px;height:550px;position:fixed;left:30%");
m_context = m_canvas.getContext("2d");
//alert("m_context------"+m_context);
m_canvas.style.display = "block";
//alert("m_canvas.style.display----"+m_canvas.style.display);
}
this.resourceLoad = function(){
//alert("this.resourceLoad()");
//alert("b----"+b);
updatePreloader();
b.src = "./images/logo.png";
//alert("b.src---"+b.src);
//this[""];
}
this.touchPressde = function(a,b){
//alert("a and b==="+a +"and" +b);
}
this.globalInit = function(){
SCREEN_WIDTH = 144,
SCREEN_HEIGHT = 208;
//alert("this.globalInit()");
document.body.addEventListener("mousedown",function(){
//alert("mousedown");
touchPressde(50,80);
});
screenResize();
setTimeout(this.resourceLoad,1E3);
}
MY_START_GAME = function(){
//alert("MY_START_GAME()");
globalInit();
}
window.onload = function(){
//alert("window.onload");
MY_START_GAME();
}
</script>
</head>
<body>
</body>
</html>
<head>
<title>game</title>
<script>
var SCREEN_WIDTH = 0,
SCREEN_HEIGHT = 0,
BACKGROUND_COLOR = "#1d1d1d";
var b = new Image;
var m_math;
//function dot_Sprite(){
//alert("dot_Sprite()");
var PI = 3.1415926;
//}
//var dot_ScoreContext = function(){};
function dot_Math(){
//alert("dot_Math");
this.load = function(){
//alert("dot_Math.load()");
this.m_sin = Array(1440);
//alert(this.m_sin.length);
this.m_cos = Array(1440);
//alert(this.m_cos.length);
/*
for(var a = 0,b = 0;1440>b;b++){
alert("b---"+b);
this.m_sin[b] = Math.sin(a * PI/180);
//alert("this.m_sin["+b+"]---"+this.m_sin[b]);
this.m_cos[b] = Math.cos(a * PI / 180);
a+= 0.25;
alert("this.m_cos["+b+"]---"+this.m_cos[b]);
}
*/
for(var a = 0,b = 0;1440>b;b++)//alert("b---"+b),
this.m_sin[b] = Math.sin(a * PI/180),
//alert("this.m_sin["+b+"]---"+this.m_sin[b]),
this.m_cos[b] = Math.cos(a * PI / 180),
a+= 0.25;
//alert("this.m_cos["+b+"]---"+this.m_cos[b]);
this.msquare = Array(600);
for(b=0;b<this.msquare.length;b++)this.msquare[b] = b * b;//alert("this.msquare["+b+"]-------"+this.msquare[b] );
}
}
function dot_Button(){
//alert("dot_Button");
this.create = function(a,b,c,d,e){
alert(a+''+b+''+c+''+d+''+e);
}
}
this.update = function(){
//alert("update()");
m_heartBeat.update(m_elapsed);
}
var m_button_start;
var img_buttons = 'aaaa';
this.appInit = function(){
alert("this.appInit()");
//m_heartBeat = new HeartBeat;
m_button_start = new dot_Button;
//m_button_start();
m_button_start.create(img_buttons, 0, 26, 40, 13);
//dot_ScoreContext.prototype = new dot_Sprite;
//alert(new dot_Sprite);
//dot_ScoreContext.prototype = new dot_Sprite;
//alert("dot_ScoreContext.prototype--"+dot_ScoreContext.prototype);
//dot_ScoreContext.prototype.constructor = dot_ScoreContext;
m_math = new dot_Math;
m_math.load();
setInterval(function(){
//alert("setInterval()");
update();
},1000);
}
this.updatePreloader = function(){
m_context.fillStyle = BACKGROUND_COLOR;
//alert("m_context.fillStyle---------"+m_context.fillStyle);
m_context.fillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT);
//alert("m_context.fillRect()-------OK");
//alert("b---"+b);
b.src = "./images/brand_logo.png";
//alert("b.src---"+b.src);
m_context.drawImage(b,30,30);
//alert("m_context.drawImage(img_brand_logo,30,30)----------OK");
b.src = "./images/load_bar.png";
//alert("b.src----"+b.src);
m_context.drawImage(b,30,100);
//alert("m_context.drawImage(b,30,100);---------------OK");
appInit();
}
this.screenResize = function(){
//alert("this.screenResize()");
m_canvas = document.createElement("canvas");
//alert("m_canvas---"+m_canvas);
m_canvas.setAttribute("id","game_canvas")
//alert("id---"+m_canvas.getAttribute("id"));
m_canvas.setAttribute("width",""+SCREEN_WIDTH);
//alert("m_canvas.getAttribute('width')----"+m_canvas.getAttribute("width"));
m_canvas.setAttribute("height",""+SCREEN_HEIGHT);
//alert("m_canvas.getAttribute('height')----"+m_canvas.getAttribute("height"));
document.body.appendChild(m_canvas);
//alert("documen.body.appendChild(m_canvas)-------ok");
m_canvas.setAttribute("style","border:1px solid red;width:400px;height:550px;position:fixed;left:30%");
m_context = m_canvas.getContext("2d");
//alert("m_context------"+m_context);
m_canvas.style.display = "block";
//alert("m_canvas.style.display----"+m_canvas.style.display);
}
this.resourceLoad = function(){
//alert("this.resourceLoad()");
//alert("b----"+b);
updatePreloader();
b.src = "./images/logo.png";
//alert("b.src---"+b.src);
//this[""];
}
this.touchPressde = function(a,b){
//alert("a and b==="+a +"and" +b);
}
this.globalInit = function(){
SCREEN_WIDTH = 144,
SCREEN_HEIGHT = 208;
//alert("this.globalInit()");
document.body.addEventListener("mousedown",function(){
//alert("mousedown");
touchPressde(50,80);
});
screenResize();
setTimeout(this.resourceLoad,1E3);
}
MY_START_GAME = function(){
//alert("MY_START_GAME()");
globalInit();
}
window.onload = function(){
//alert("window.onload");
MY_START_GAME();
}
</script>
</head>
<body>
</body>
</html>
0 0
- game-04-21
- game
- game
- game
- game...
- Game
- Game
- Game
- Game
- game
- Game
- Game
- game
- game
- Game
- GAME
- Game
- Game
- c字符处理之空字符、null与0
- C# 获取中文首字母
- Gradient Descent
- 【jQuery学习笔记--------操作类样式】
- LeetCode(Sum Root to Leaf Numbers)
- game-04-21
- OpenStack云计算快速入门之三:OpenStack镜像管理
- Android 自动化测试框架对比
- 【明星学员】hadoop让我的人生拥有一万种可能-Java崔金辉
- 栈区和堆区内存分配区别
- 工作笔记-修改Iperf的Makefile文件编译出调试程序
- hibernate、JPA主键生成策略及如何选择
- springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序
- java入门:排序