Skip to content

Commit

Permalink
项目加载
Browse files Browse the repository at this point in the history
  • Loading branch information
苏伟杰 committed Apr 26, 2015
1 parent 67a249a commit cff1f5e
Showing 72 changed files with 15,004 additions and 0 deletions.
12 changes: 12 additions & 0 deletions css/style.css
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;
}
65 changes: 65 additions & 0 deletions html/test.html
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>
33 changes: 33 additions & 0 deletions html/weixin.html
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>
Binary file added images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bg_stastic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_falldown_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_falldown_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_hide_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_hide_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_stand_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_stand_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_walk_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bt_walk_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/btn_back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/btn_pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/btn_play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/loading_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_entrance_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_entrance_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_evolve_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_evolve_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_exit_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_exit_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_frozen_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_frozen_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_normal_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms1_normal_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms2_evolve_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ms2_evolve_right.png
Binary file added images/ms2_exit_left.png
Binary file added images/ms2_exit_right.png
Binary file added images/ms2_frozen_left.png
Binary file added images/ms2_frozen_right.png
Binary file added images/ms2_normal_left.png
Binary file added images/ms2_normal_right.png
Binary file added images/ms3_exit_left.png
Binary file added images/ms3_exit_right.png
Binary file added images/ms3_frozen_left.png
Binary file added images/ms3_frozen_right.png
Binary file added images/ms3_normal_left.png
Binary file added images/ms3_normal_right.png
Binary file added images/ot_rattan_bottom.png
Binary file added images/ot_rattan_left.png
Binary file added images/ot_rattan_right.png
Binary file added images/ot_rattan_top.png
Binary file added images/ot_stick_normal.png
Binary file added images/ot_stick_out.png
Binary file added images/ot_stone_in.png
Binary file added images/ot_stone_out.png
Binary file added images/player_walk2.png
Binary file added images/player_walk_left.png
Binary file added images/player_walk_right.png
Binary file added images/pt_freeze.png
Binary file added images/pt_hide.png
Binary file added images/pt_repel.png
24 changes: 24 additions & 0 deletions index.html
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>
111 changes: 111 additions & 0 deletions js/App.js
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);
}

56 changes: 56 additions & 0 deletions js/GameElement.js
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);
};
})();
Loading

0 comments on commit cff1f5e

Please sign in to comment.