This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/frontend/src_old/game.coffee

72 lines
1.2 KiB
CoffeeScript
Raw Normal View History

2018-11-29 11:27:26 +00:00
# libs
window.$ = require('jquery')
# on load
$ ->
# libs requiring full DOM
require 'craftyjs/dist/crafty'
2018-11-29 12:15:24 +00:00
io = require 'socket.io-client'
2018-11-29 11:27:26 +00:00
# style sheet
require './style/custom.scss'
# fftcg libs
require './game/config.coffee'
require './game/components/Card.coffee'
require './game/scenes/Battle.coffee'
# init Socket.IO
socket = io()
# init CraftyJS framework
Crafty.init()
# Load base scene
Crafty.scene "Battle"
# Testing some entities
Crafty.sprite 480, 670, '//www.fftcgmognet.com/images/cards/hd/1/1/107.jpg',
shantotto: [
0
0
]
backups = [
Crafty.e 'shantotto, AllyCard'
.attr {
card:
type: 'backup'
}
Crafty.e 'shantotto, AllyCard'
.attr {
card:
type: 'backup'
}
Crafty.e 'shantotto, AllyCard'
.attr {
card:
type: 'backup'
}
]
Crafty 'AllyCard'
.each (index) ->
switch @card.type
when 'backup'
@trigger 'Place',
x: CONF.coord.x.main + index * CONF.coord.x.step
y: CONF.coord.y.bkup
return
Crafty.e 'shantotto, EnemyCard'
.trigger 'Place',
x: 900
y: 0
return