Coffee works, Crafty is strange

This commit is contained in:
Jörn-Michael Miehe 2018-11-28 17:17:51 +01:00
parent b62faa0530
commit 339cf62b07
12 changed files with 32 additions and 13 deletions

View file

@ -13,7 +13,10 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"css-loader": "^1.0.1",
"coffee-loader": "^0.9.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
@ -26,7 +29,8 @@
"bootstrap": "^4.1.3",
"jquery": "^3.3.1",
"popper.js": "^1.14.5"
"popper.js": "^1.14.5",
"craftyjs": "^0.9.0"
},
"dependencies": {

View file

@ -5,13 +5,8 @@ var
mysql = require('mysql'),
bcrypt = require('bcrypt'),
express = require('express'),
gulp = global.gulp = require('gulp'),
helmet = require('helmet');
// gulp the sources
require('./gulpfile');
gulp.start('default');
// socket.io framework
let app = express();
let web = http.Server(app);

View file

@ -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')

View file

@ -1,3 +1,5 @@
require './BigCard.coffee'
################
# Card
################

View file

@ -1,3 +1,5 @@
require '../components/Playmat.coffee'
Crafty.defineScene "Battle", ->
# free viewport

View file

@ -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
Crafty.scene "Battle"

View file

@ -1,5 +0,0 @@
# init Socket.IO
socket = io()
# init CraftyJS framework
Crafty.init()

9
static/game.html Normal file
View 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>

View file

@ -51,7 +51,7 @@ module.exports = {
loader: 'coffee-loader',
options: {
transpile: {
presets: ['env']
presets: ['@babel/env']
}
}
}