Skip to content

Commit

Permalink
Cleanup of Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Applegate committed Dec 1, 2012
1 parent 0f876f9 commit 2228b98
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions public/coffee/models/Loader.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ define [
'cs!models/GoalEntity'
'cs!models/WallEntity'
'cs!SoundHelper'
'json!/data/level01.json'], ($, boxbox, GroundEntity, PlayableCharacter, DoorEntity, PlateEntity, BoxEntity, PlatformEntity, GoalEntity, WallEntity, SoundHelper, Level) ->
'json!/data/level01.json'], ($, boxbox, GroundEntity, PlayableCharacter, DoorEntity, PlateEntity, BoxEntity, PlatformEntity, GoalEntity, WallEntity, SoundHelper, level) ->

class Loader

currentLevel: 1

constructor: ->
@nextLevel 1
@currentLevel = 1
$canvas = $ '#gamescape'
@canvas = $canvas.get 0
@sound = new SoundHelper $canvas
@loadLevel Level
@loadLevel level
$('#gamescape').on 'nextLevel', (e) =>
@nextLevel()

Expand Down Expand Up @@ -53,10 +52,8 @@ define [
@player.register()

@player.entity.position {x:levelRequested.PlayableCharacter.x, y:levelRequested.PlayableCharacter.y}
console.log 'here'

nextLevel: =>
console.log @currentLevel
@currentLevel = @currentLevel + 1
if @currentLevel < 4
require ["json!/data/level0#{@currentLevel}.json"], (newLevel) =>
Expand Down

0 comments on commit 2228b98

Please sign in to comment.