Skip to content

Commit dfa4393

Browse files
author
unknown
committed
create 秦嘉茹 1520600050 的第十二周作业
1 parent 68995ea commit dfa4393

13 files changed

+1296
-0
lines changed
6 KB
Binary file not shown.

秦嘉茹 1520600050/天气2048/.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

秦嘉茹 1520600050/天气2048/.idea/2048.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

秦嘉茹 1520600050/天气2048/.idea/misc.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

秦嘉茹 1520600050/天气2048/.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

秦嘉茹 1520600050/天气2048/.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

秦嘉茹 1520600050/天气2048/.idea/workspace.xml

+478
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#canvas { display: block; margin: 0 auto; }
2+
header{
3+
display:block;
4+
margin:0 auto;
5+
width:100%;
6+
text-align:center;
7+
}
8+
9+
header h1{
10+
font-family:Arial;
11+
font-size:40px;
12+
font-weight:bold;
13+
margin:0 auto;
14+
}
15+
16+
header #newgamebutton{
17+
display:block;
18+
margin:10px auto;
19+
20+
width:100px;
21+
padding:10px 10px;
22+
background-color:#8f7a66;
23+
24+
font-family:Arial;
25+
color:white;
26+
27+
border-radius:10px;
28+
text-decoration:none;
29+
}
30+
header #newgamebutton:hover{
31+
background-color:#9f8b77;
32+
}
33+
34+
header p{
35+
font-family:Arial;
36+
font-size:25px;
37+
margin:10px auto;
38+
}
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="zh">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
6+
<title>天气2048</title>
7+
<link href="css/main.css" rel="stylesheet">
8+
</head>
9+
<body>
10+
<header>
11+
<h1>天气2048</h1>
12+
<div id="newgamebutton" onclick="startGame(context)" >开始游戏</div>
13+
<p>score: <span id="score">0</span></p>
14+
</header>
15+
<div id="canvas-warp">
16+
<canvas id="canvas">
17+
你的浏览器居然不支持Canvas?!赶快换一个吧!!
18+
</canvas>
19+
</div>
20+
<script src="js/controllerLayer.js"></script>
21+
<script src="js/modelLayer.js"></script>
22+
<script>
23+
24+
var canvas = document.getElementById("canvas");
25+
canvas.width = game_width;
26+
canvas.height = game_width;
27+
var context = canvas.getContext("2d");
28+
29+
// 监听键盘按键,按下时调用moveKeyDown函数
30+
window.addEventListener('keydown', moveKeyDown, true);
31+
32+
33+
window.onload = function(){
34+
35+
// 开始游戏
36+
startGame(context);
37+
38+
// 防止下滑时浏览器滚动
39+
document.addEventListener('touchmove',function(e){e.preventDefault();},false);
40+
}
41+
42+
</script>
43+
</body>
44+
</html>
Binary file not shown.

0 commit comments

Comments
 (0)