       scoreText.content = "Score: #{score}"
 
     update: () ->
-      @phaser.physics.collide stars, platforms
-      @phaser.physics.overlap stars, collectStar, null, this
+      @phaser.physics.collide @balls, @platforms
+      #@phaser.physics.overlap @balls, @collectStar, null, this
 
 game = new Game()


    constructor: (@status, @players) ->
        # basic config
        @window_x = 1200
        @window_y = 680
        @stars = null
        @scoreText = null
        @score = 0
        @players = []
        # Generate the word
        @phaser = new Phaser.Game @window_x, @window_y, Phaser.AUTO, '', preload: @preload, create: @create, update: @update
        @generate_fake_player()
        @platforms = @phaser.add.group()


    generate_fake_player: () ->
        x = y = 0
        for i in [0..3]
            @players.push new Player @game, i, 0

    preload: () ->
      console.log ':preload'
      console.log this
      this.load.image 'sky', '/assets/images/sky.png'
      this.load.image 'ground', '/assets/images/platform.png'
      this.load.image 'star', '/assets/images/star.png'
      #game.load.spritesheet 'dude', '/assets/images/dude.png', 32, 48


    create: () ->
      console.log ':create'
      @phaser.add.sprite 0, 0, 'sky'
      @phaser.add.sprite 0, 0, 'star'

      #cursors = @phaser.input.keyboard.createCursorKeys()
      stars = @phaser.add.group()

      for i in [0..12]
        star = stars.create i * 70, 0, 'star'
        star.body.gravity.y = 6
        star.body.bounce.y = 0.7 + Math.random() * 0.2



class Player
    constructor: (@game, @id, @score) ->
        @bucket = @game.plateforms.create 0, 0, 'ground'
        @bucket.scale.setTo 0.3, 2
        @bucket.body.immovable = true

class Game
    GameStatus = 
