crafty itself doesnt want to webpack? Also include config file
This commit is contained in:
parent
339cf62b07
commit
d044abb709
9 changed files with 35 additions and 8 deletions
|
@ -29,8 +29,7 @@
|
|||
|
||||
"bootstrap": "^4.1.3",
|
||||
"jquery": "^3.3.1",
|
||||
"popper.js": "^1.14.5",
|
||||
"craftyjs": "^0.9.0"
|
||||
"popper.js": "^1.14.5"
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
|
|
12
src/game.js
12
src/game.js
|
@ -1,4 +1,10 @@
|
|||
import Crafty from 'craftyjs'
|
||||
import CONF from './game/config.coffee'
|
||||
// libs
|
||||
const $ = require('jquery')
|
||||
|
||||
require('./game/test_entities.coffee')
|
||||
// style sheet
|
||||
require('./style/custom.scss')
|
||||
|
||||
// on load
|
||||
$(() => {
|
||||
require('./game/test_entities.coffee')
|
||||
})
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
CONF = require '../config.coffee'
|
||||
|
||||
# intermediate config
|
||||
bcConf = Crafty.clone CONF.bigcard
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
CONF = require '../config.coffee'
|
||||
require './BigCard.coffee'
|
||||
|
||||
################
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
CONF = require '../config.coffee'
|
||||
|
||||
################
|
||||
# Playmat
|
||||
################
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
CONF = require '../config.coffee'
|
||||
require '../components/Playmat.coffee'
|
||||
|
||||
Crafty.defineScene "Battle", ->
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
CONF = require './config.coffee'
|
||||
require './components/Card.coffee'
|
||||
require './scenes/Battle.coffee'
|
||||
|
||||
# init Socket.IO
|
||||
socket = io()
|
||||
|
||||
# init CraftyJS framework
|
||||
Crafty.init()
|
||||
|
||||
require './components/Card.coffee'
|
||||
require './scenes/Battle.coffee'
|
||||
|
||||
# Load base scene
|
||||
Crafty.scene "Battle"
|
||||
|
||||
|
|
14
static/crafty-min.js
vendored
Normal file
14
static/crafty-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<title>Crafty Things</title>
|
||||
<script src="/socket.io/socket.io.js"></script>
|
||||
<script src="crafty-min.js"></script>
|
||||
<script src="game.bundle.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
|
|
Reference in a new issue