Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #11 from crosswalk-project/space-dodge-game
Browse files Browse the repository at this point in the history
[space dodge game] Add sample game used in 'Screens' tutorial
  • Loading branch information
townxelliot committed Aug 6, 2014
2 parents 3923604 + ed8f50d commit a8be952
Show file tree
Hide file tree
Showing 43 changed files with 2,453 additions and 0 deletions.
Binary file added space-dodge-game/Crosswalk-6-resize/asteroid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions space-dodge-game/Crosswalk-6-resize/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
* {
user-select: none;
-webkit-user-select: none;
user-drag: none;
-webkit-user-drag: none;
}

body {
margin: 0;
}

#container {
position: relative;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
}

#game-screen, #finish-screen {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #11F;
}

#finish-screen {
z-index: 100;
}

#play-area-container {
float: right;
width: 80%;
height: 100%;
}

#play-area {
position: relative;
box-sizing: border-box;
border: 2px solid darkblue;
}

#controls {
height: 100%;
width: 20%;
padding: 0.5em;
text-align: center;
box-sizing: border-box;
float: left;
}

.vbox {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

p, button {
font-family: sans-serif;
font-size: 1.5em;
}

#control-down {
margin: 0.5em 0 0 0;
}

#finish-screen > * {
text-align: center;
}

#score, #final-score {
color: white;
}

[data-visible="false"] {
display: none !important;
}
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.
36 changes: 36 additions & 0 deletions space-dodge-game/Crosswalk-6-resize/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>space dodge game</title>
<link rel="stylesheet" href="base.css">
</head>

<body>

<div id="container">

<div id="game-screen">
<div id="controls" class="vbox">
<p id="score">Score<br><span id="score-display"></span></p>
<img id="control-up" src="control-up.png">
<img id="control-down" src="control-down.png">
</div>

<div id="play-area-container">
<canvas id="play-area" width="600" height="450"></canvas>
</div>
</div>

<div id="finish-screen" class="vbox" data-visible="false">
<p id="final-score"></p>
<button id="restart">Restart</button>
</div>

</div>

<script src="main.js"></script>

</body>
</html>
Loading

0 comments on commit a8be952

Please sign in to comment.