Advertisement
Guest User

Untitled

a guest
Mar 11th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. class MainMenu extends Phaser.State
  3.  
  4.     preload: () ->
  5.         @buttons = []
  6.  
  7.         @load.spritesheet 'electric', './assets/img/game/electric.png', 32, 32
  8.  
  9.         @style = {font: "32px Arial", fill: "#fff", align: "center"}
  10.         @headText = @game.add.text (@game.canvas.width/2)-130, 0, "Defiled Dreams", @style
  11.  
  12.         @game.stage.backgroundColor = '#aaaaaa'
  13.  
  14.     create: () ->
  15.         for i in [1..@game.MAX_LEVELS]
  16.             @buttons.push new MenuTextButton @game, 140+(32*i-1)+(3*i-1), 140, "#{i}"
  17.  
  18.  
  19. class MenuTextButton
  20.     constructor: (@game, x, y, text) ->
  21.         @button = @game.add.button x,y,'electric', (()->@game.state.start "world-#{text}"), @, 1,0,2
  22.         @text = @game.add.text x+8, y, text, @style
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement