This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig | |
.module('game.main') | |
.requires( | |
'impact.game' | |
'impact.font' | |
'game.menu' | |
'game.levels.test' | |
'game.entities.player' | |
'game.entities.levelchange' | |
'game.entities.trigger' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig | |
.module('game.main') | |
.requires( | |
'impact.game' | |
'impact.font' | |
'game.menu' | |
'game.levels.test' | |
'game.entities.player' | |
'game.entities.levelchange' | |
'game.entities.trigger' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig | |
.module('game.main') | |
.requires( | |
'impact.game' | |
'impact.font' | |
) | |
.defines -> | |
mockGame = ig.Game.extend | |
computeTexts: (texts, parameters)-> | |
compiledText = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class window.MapTerritoryView extends Backbone.View | |
model: Territory | |
tagName: "area" | |
events: | |
"click": "handleClick" | |
handleClick: -> | |
console.log "Click on", @model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery -> | |
window.game = new Game | |
players: window.players | |
territories: window.territories | |
mapView = new MapView(model: game) | |
$("#application").append(mapView.render().el) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class window.MapBadgeView extends Backbone.View | |
model: Territory | |
tagName: "li" | |
initialize: -> | |
@model.bind("change", @render) | |
render: -> | |
@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.badges { | |
li { | |
width: 32px; | |
height: 32px; | |
text-align: center; | |
line-height: 34px; | |
font-size: 12px; | |
background: black; | |
border-radius: 50%; | |
border: 2px solid #333; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.BadgeView = Backbone.View.extend | |
model: Territory | |
tagName: "li" | |
events: | |
"click" : "handleClick" | |
initialize: -> | |
@model.bind("change:unitsCount", @unitsCountChanged, @) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "sinatra" | |
require "oauth2" | |
get "/" do | |
haml :index | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AttacksController | |
def create | |
attacker = current_users.characters.find(params[:attacker_id]) | |
target = Character.find_by_x_and_y(params[:x], params[:y]) | |
attack = CharacterAttacksAnotherCharacter.new(attacker, target) | |
attack.execute! | |
end | |
end |