Skip to content

Commit

Permalink
Project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
quantuminformation committed Sep 29, 2016
1 parent f3100fe commit dfeac55
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
node_modules
.idea
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# youtube-space-invaders
Simple space invaders game for the browser

I used TypeScript as it is pretty nice for games and catches a lot of bugs at compile time.
47 changes: 47 additions & 0 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var path = require("path");
var webpack = require("webpack");
var HtmlWebpackPlugin = require("html-webpack-plugin");


const PATHS = {
src: path.join(__dirname, '../src'),
build: path.join(__dirname, '../build')
};

module.exports = {

entry: {
app: PATHS.src + '/app.ts'
},
output: {
path: PATHS.build,
filename: '[name].js'
},


devtool: "source-map",
module: {
loaders: [
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.css/,
loader: "style!css"
}
]
},
resolve: {
// you can now require('file') instead of require('file.js')
extensions: ['.js', '.json']
},
plugins: [
new HtmlWebpackPlugin({
title: 'Webpack boilerplate',
hash: true,
filename: 'index.html',
template: PATHS.src + '/index.html',
})
]
};
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "youtube-space-invaders",
"version": "1.0.0",
"description": "Simple setup for client-only projects",
"main": "webpack.config.js",
"dependencies": {},
"devDependencies": {
"css-loader": "^0.25.0",
"html-webpack-plugin": "^2.22.0",
"style-loader": "^0.13.1",
"ts-loader": "^0.8.2",
"typescript": "^2.0.3",
"webpack": "^2.1.0-beta.25",
"webpack-validator": "^2.2.7"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/QuantumInformation/youtube-space-invaders.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/QuantumInformation/youtube-space-invaders/issues"
},
"homepage": "https://github.com/QuantumInformation/youtube-space-invaders#readme"
}
1 change: 1 addition & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert("it works!")
12 changes: 12 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h1>You have reached the Space Invaders game!</h1>

<p>You project has compiled successfully</p>

<div class="contnet">
<canvas id="canvas"> Your browser doesn't appear to support the HTML5 <code>&lt;canvas&gt;</code> element.
</canvas>
<p>Keys: Arrows = movment, Space = shoot</p>
</div>

<p>This code matches the last video of the youtube series <a
href="https://www.youtube.com/playlist?list=PLCrwuqjmVebIU2b4qesWz7PAEm1UJl15n">here</a></p>
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"sourceMap": true
},
"files": []
}
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const validate = require('webpack-validator')
module.exports = validate(require('./config/webpack.common.js'), {
quiet: true
});

0 comments on commit dfeac55

Please sign in to comment.