Skip to content

Instantly share code, notes, and snippets.

View Sephi-Chan's full-sized avatar

Romain Tribes Sephi-Chan

  • Nîmes, France
View GitHub Profile
ig
.module('game.main')
.requires(
'impact.game'
'impact.font'
'game.menu'
'game.levels.test'
'game.entities.player'
'game.entities.levelchange'
'game.entities.trigger'
ig
.module('game.main')
.requires(
'impact.game'
'impact.font'
'game.menu'
'game.levels.test'
'game.entities.player'
'game.entities.levelchange'
'game.entities.trigger'
ig
.module('game.main')
.requires(
'impact.game'
'impact.font'
)
.defines ->
mockGame = ig.Game.extend
computeTexts: (texts, parameters)->
compiledText = {}
class window.MapTerritoryView extends Backbone.View
model: Territory
tagName: "area"
events:
"click": "handleClick"
handleClick: ->
console.log "Click on", @model
jQuery ->
window.game = new Game
players: window.players
territories: window.territories
mapView = new MapView(model: game)
$("#application").append(mapView.render().el)
class window.MapBadgeView extends Backbone.View
model: Territory
tagName: "li"
initialize: ->
@model.bind("change", @render)
render: ->
@
.badges {
li {
width: 32px;
height: 32px;
text-align: center;
line-height: 34px;
font-size: 12px;
background: black;
border-radius: 50%;
border: 2px solid #333;
window.BadgeView = Backbone.View.extend
model: Territory
tagName: "li"
events:
"click" : "handleClick"
initialize: ->
@model.bind("change:unitsCount", @unitsCountChanged, @)
require "rubygems"
require "sinatra"
require "oauth2"
get "/" do
haml :index
end
@Sephi-Chan
Sephi-Chan / dci_experiment.rb
Created February 1, 2012 14:55
DCI experimentation
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