Coffee works, Crafty is strange
This commit is contained in:
parent
b62faa0530
commit
339cf62b07
12 changed files with 32 additions and 13 deletions
|
@ -13,7 +13,10 @@
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.1.6",
|
||||||
|
"@babel/preset-env": "^7.1.6",
|
||||||
"css-loader": "^1.0.1",
|
"css-loader": "^1.0.1",
|
||||||
|
"coffee-loader": "^0.9.0",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^7.1.0",
|
||||||
"style-loader": "^0.23.1",
|
"style-loader": "^0.23.1",
|
||||||
|
@ -26,7 +29,8 @@
|
||||||
|
|
||||||
"bootstrap": "^4.1.3",
|
"bootstrap": "^4.1.3",
|
||||||
"jquery": "^3.3.1",
|
"jquery": "^3.3.1",
|
||||||
"popper.js": "^1.14.5"
|
"popper.js": "^1.14.5",
|
||||||
|
"craftyjs": "^0.9.0"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -5,13 +5,8 @@ var
|
||||||
mysql = require('mysql'),
|
mysql = require('mysql'),
|
||||||
bcrypt = require('bcrypt'),
|
bcrypt = require('bcrypt'),
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
gulp = global.gulp = require('gulp'),
|
|
||||||
helmet = require('helmet');
|
helmet = require('helmet');
|
||||||
|
|
||||||
// gulp the sources
|
|
||||||
require('./gulpfile');
|
|
||||||
gulp.start('default');
|
|
||||||
|
|
||||||
// socket.io framework
|
// socket.io framework
|
||||||
let app = express();
|
let app = express();
|
||||||
let web = http.Server(app);
|
let web = http.Server(app);
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
import CONF from './scripts/game/10-conf.coffee'
|
import Crafty from 'craftyjs'
|
||||||
|
import CONF from './game/config.coffee'
|
||||||
|
|
||||||
|
require('./game/test_entities.coffee')
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require './BigCard.coffee'
|
||||||
|
|
||||||
################
|
################
|
||||||
# Card
|
# Card
|
||||||
################
|
################
|
|
@ -1,3 +1,5 @@
|
||||||
|
require '../components/Playmat.coffee'
|
||||||
|
|
||||||
Crafty.defineScene "Battle", ->
|
Crafty.defineScene "Battle", ->
|
||||||
|
|
||||||
# free viewport
|
# free viewport
|
|
@ -1,3 +1,12 @@
|
||||||
|
# init Socket.IO
|
||||||
|
socket = io()
|
||||||
|
|
||||||
|
# init CraftyJS framework
|
||||||
|
Crafty.init()
|
||||||
|
|
||||||
|
require './components/Card.coffee'
|
||||||
|
require './scenes/Battle.coffee'
|
||||||
|
|
||||||
# Load base scene
|
# Load base scene
|
||||||
Crafty.scene "Battle"
|
Crafty.scene "Battle"
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# init Socket.IO
|
|
||||||
socket = io()
|
|
||||||
|
|
||||||
# init CraftyJS framework
|
|
||||||
Crafty.init()
|
|
9
static/game.html
Normal file
9
static/game.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Crafty Things</title>
|
||||||
|
<script src="/socket.io/socket.io.js"></script>
|
||||||
|
<script src="game.bundle.js"></script>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
|
@ -51,7 +51,7 @@ module.exports = {
|
||||||
loader: 'coffee-loader',
|
loader: 'coffee-loader',
|
||||||
options: {
|
options: {
|
||||||
transpile: {
|
transpile: {
|
||||||
presets: ['env']
|
presets: ['@babel/env']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue