forked from Snuby/corpse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
苏伟杰
committed
Apr 26, 2015
1 parent
67a249a
commit cff1f5e
Showing
72 changed files
with
15,004 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#corpse-container{ | ||
margin-left:auto; | ||
margin-right:auto; | ||
width:800px; | ||
height:480px; | ||
background-color:#111; | ||
} | ||
#fps{ | ||
position:absolute; | ||
padding:10px; | ||
font-size:22px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>test.html</title> | ||
|
||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> | ||
<meta http-equiv="description" content="this is my page"> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<script type="text/javascript" src="../js/quark.base-1.0.0.js"></script> | ||
<script type="text/javascript" src="../js/test.js"></script> | ||
<link rel="stylesheet" type="text/css" href="../css/style.css"> | ||
<!--<link rel="stylesheet" type="text/css" href="./styles.css">--> | ||
|
||
</head> | ||
<script type="text/javascript"> | ||
Array.prototype.deleteBy = function(indexOrValue){ | ||
if(typeof indexOrObj == "number"){ | ||
this.splice(indexOrVaule, 1); | ||
return true; | ||
}else{ | ||
for(var i = 0;i<this.length;i++){ | ||
if(this[i] == indexOrValue){ | ||
this.splice(i, 1); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
}; | ||
var obj ={}; | ||
|
||
|
||
|
||
|
||
var t = []; | ||
t.push(4); | ||
t.push(5); | ||
t.push(obj); | ||
|
||
for(var i = 0;i<t.length;i++){ | ||
var v = t[i]; | ||
if(v == 4){ | ||
t.push(2); | ||
} | ||
if(v == obj){ | ||
t.deleteBy(t[i]); | ||
i--; | ||
} | ||
dump(t); | ||
|
||
} | ||
|
||
//dump(t); | ||
//t.deleteBy(obj); | ||
//dump(t); | ||
|
||
trace(typeof ""); | ||
</script> | ||
<body> | ||
<div id="container" > | ||
<div id="fps">FPS:0</div> | ||
</div> | ||
<img id="player_walk" alt="" src="../images/player_walk2.png" style="display:none;"> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>weixin.html</title> | ||
|
||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> | ||
<meta http-equiv="description" content="this is my page"> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
|
||
<!--<link rel="stylesheet" type="text/css" href="./styles.css">--> | ||
<script type="text/javascript"> | ||
|
||
function dump(obj){ | ||
var str = ""; | ||
for(var key in obj){ | ||
str += "key:"+key+";value="+obj[key]+"\n"; | ||
} | ||
return str; | ||
} | ||
window.onload = function init(){ | ||
document.getElementById("test").onclick = function(){ | ||
this.style.fontSize = "45px"; | ||
}; | ||
}; | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
<div id ="test" style= "font-size:25px;background:#af3;padding:10px;">3434</div> | ||
This is my HTML page. <br> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>index.html</title> | ||
|
||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> | ||
<meta http-equiv="description" content="this is my page"> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<script type="text/javascript" src="./js/quark.base-1.0.0.js"></script> | ||
|
||
<script type="text/javascript" src="./js/includes.js"></script> | ||
|
||
<!--<link rel="stylesheet" type="text/css" href="./styles.css">--> | ||
|
||
</head> | ||
<script type="text/javascript"> | ||
|
||
|
||
</script> | ||
<body> | ||
<div id="corpse-container" > | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
(function(Q){ | ||
|
||
var App = window.App = function(){ | ||
this.W = 800; | ||
this.H = 480; | ||
|
||
this.sceneMenu = null; //菜单场景 | ||
this.sceneGame = null; //游戏场景 | ||
|
||
this.init(); | ||
}; | ||
|
||
App.prototype.init = function(){ | ||
|
||
}; | ||
|
||
App.prototype.switchScene = function(id){ //切换场景 | ||
switch(id){ | ||
case "menu": | ||
|
||
break; | ||
case "game": | ||
|
||
if(this.sceneGame == null) this.sceneGame = new SceneGame(); | ||
else this.sceneGame.startGame(); | ||
|
||
break; | ||
} | ||
}; | ||
|
||
window.onload = function(){ | ||
//includes(); | ||
var app = window.APP= new App(); | ||
app.switchScene("game"); | ||
}; | ||
|
||
Array.prototype.deleteBy = function(indexOrValue){ | ||
if(typeof indexOrObj == "number"){ | ||
this.splice(indexOrVaule, 1); | ||
return true; | ||
}else{ | ||
for(var i = 0;i<this.length;i++){ | ||
if(this[i] == indexOrValue){ | ||
this.splice(i, 1); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
}; | ||
|
||
})(Quark); | ||
|
||
/* | ||
function includes(){ | ||
includeJS("./js/Player.js"); | ||
includeJS("./js/R.js"); | ||
includeJS("./js/SceneGame.js"); | ||
includeJS("./js/SceneMenu.js"); | ||
includeJS("./js/Wall.js"); | ||
includeJS("./js/Layers.js"); | ||
includeCSS("./css/style.css"); | ||
} | ||
function includeJS(path){ | ||
if(!path) return; | ||
var script = document.createElement("script"); | ||
script.src = path; | ||
script.type = "text/javascript"; | ||
document.getElementsByTagName("head")[0].appendChild(script); | ||
} | ||
function includeCSS(path){ | ||
if(!path) return; | ||
var link = document.createElement("link"); | ||
link.rel = "stylesheet"; | ||
link.type = "text/css"; | ||
link.href = path; | ||
document.getElementsByTagName("head")[0].appendChild(link); | ||
} | ||
*/ | ||
function createRect(w, h, color) | ||
{ | ||
var canvas = document.createElement("canvas"); | ||
canvas.width = w; | ||
canvas.height = h; | ||
var ctx = canvas.getContext("2d"); | ||
ctx.fillStyle = color; | ||
ctx.rect(0, 0, w, h); | ||
ctx.fill(); | ||
|
||
var img = new Image(); | ||
img.src = canvas.toDataURL("image/png"); | ||
img.width = w; | ||
img.height = h; | ||
return img; | ||
} | ||
|
||
function dump(obj){ | ||
var str = ""; | ||
for(var key in obj){ | ||
str += "key:"+key+";value="+obj[key]+"\n"; | ||
} | ||
trace(str); | ||
} | ||
|
||
function random(b1,b2){ | ||
return Math.round(Math.random()*(b2-b1)+b1); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
(function(){ | ||
/** | ||
* 构造函数. | ||
* @name GameElement | ||
*/ | ||
var GameElement = Quark.GameElement = function(params){ | ||
this.manager = null;//管理器,在monsters、props和obstacles中用到 | ||
this.currentAnim = null;//当前动画 | ||
this.direction = null;//当前方向 | ||
this.v = {x:0,y:0};//速度 | ||
|
||
Quark.merge(this, params); | ||
this.oldp ={x:this.v.x,y:this.v.y}; | ||
|
||
GameElement.superClass.constructor.call(this,params); | ||
this.id = params.id || Quark.UIDUtil.createUID("GameElement"); | ||
this.init(); | ||
|
||
}; | ||
Quark.inherit(GameElement, Quark.DisplayObjectContainer); | ||
|
||
GameElement.prototype.init = function(){ | ||
|
||
}; | ||
|
||
GameElement.prototype.getCenter = function(){ | ||
return {x:this.currentAnim.regX,y:this.currentAnim.regY}; | ||
}; | ||
|
||
GameElement.prototype.scale = function(){ | ||
var ratio = 0.75+0.25*(this.y-80)/400; | ||
this.scaleX = ratio; | ||
this.scaleY = ratio; | ||
return ratio; | ||
}; | ||
|
||
GameElement.prototype.reset = function(ratio){ | ||
var r = ratio; | ||
if(r == undefined) r = 1; | ||
var dx = this.x - this.oldp.x; | ||
var dy = this.y - this.oldp.y; | ||
this.x = this.x - r*dx; | ||
this.y = this.y - r*dy; | ||
}; | ||
|
||
GameElement.prototype.getCollisionObj = function(){ | ||
return this.currentAnim; | ||
}; | ||
|
||
GameElement.prototype.switchAnim = function(anim){ | ||
if(this.currentAnim == anim) return false; | ||
this.removeChild(this.currentAnim); | ||
this.currentAnim = anim; | ||
this.addChild(this.currentAnim); | ||
}; | ||
})(); |
Oops, something went wrong.