diff --git a/package.json b/package.json index dda6370..ce19bca 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/server.js b/server.js index ca283a4..a9268f7 100644 --- a/server.js +++ b/server.js @@ -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); diff --git a/src/game.js b/src/game.js index 3a4fbca..30094ef 100644 --- a/src/game.js +++ b/src/game.js @@ -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') diff --git a/src/scripts/game/20-comp-BigCard.coffee b/src/game/components/BigCard.coffee similarity index 100% rename from src/scripts/game/20-comp-BigCard.coffee rename to src/game/components/BigCard.coffee diff --git a/src/scripts/game/20-comp-Card.coffee b/src/game/components/Card.coffee similarity index 98% rename from src/scripts/game/20-comp-Card.coffee rename to src/game/components/Card.coffee index becf525..9f040ad 100644 --- a/src/scripts/game/20-comp-Card.coffee +++ b/src/game/components/Card.coffee @@ -1,3 +1,5 @@ +require './BigCard.coffee' + ################ # Card ################ diff --git a/src/scripts/game/20-comp-Playmat.coffee b/src/game/components/Playmat.coffee similarity index 100% rename from src/scripts/game/20-comp-Playmat.coffee rename to src/game/components/Playmat.coffee diff --git a/src/scripts/game/10-conf.coffee b/src/game/config.coffee similarity index 100% rename from src/scripts/game/10-conf.coffee rename to src/game/config.coffee diff --git a/src/scripts/game/30-scene-Battle.coffee b/src/game/scenes/Battle.coffee similarity index 95% rename from src/scripts/game/30-scene-Battle.coffee rename to src/game/scenes/Battle.coffee index c52c576..7e1be9d 100644 --- a/src/scripts/game/30-scene-Battle.coffee +++ b/src/game/scenes/Battle.coffee @@ -1,3 +1,5 @@ +require '../components/Playmat.coffee' + Crafty.defineScene "Battle", -> # free viewport diff --git a/src/scripts/game/40-test-entities.coffee b/src/game/test_entities.coffee similarity index 83% rename from src/scripts/game/40-test-entities.coffee rename to src/game/test_entities.coffee index 53e7202..4610e55 100644 --- a/src/scripts/game/40-test-entities.coffee +++ b/src/game/test_entities.coffee @@ -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" diff --git a/src/scripts/game/10-init-framework.coffee b/src/scripts/game/10-init-framework.coffee deleted file mode 100644 index ff27098..0000000 --- a/src/scripts/game/10-init-framework.coffee +++ /dev/null @@ -1,5 +0,0 @@ -# init Socket.IO -socket = io() - -# init CraftyJS framework -Crafty.init() diff --git a/static/game.html b/static/game.html new file mode 100644 index 0000000..356c4b2 --- /dev/null +++ b/static/game.html @@ -0,0 +1,9 @@ + + + + Crafty Things + + + + + diff --git a/webpack.config.js b/webpack.config.js index e6ae586..9a61579 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -51,7 +51,7 @@ module.exports = { loader: 'coffee-loader', options: { transpile: { - presets: ['env'] + presets: ['@babel/env'] } } }