Skip to content

Commit

Permalink
Level edge walls
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Applegate committed Dec 1, 2012
1 parent 79ba898 commit 5f5240c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/coffee/models/Loader.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ define [
'cs!models/BoxEntity'
'cs!models/PlatformEntity'
'cs!models/GoalEntity'
'cs!models/WallEntity'
'cs!SoundHelper'
'json!/data/level01.json'], ($, boxbox, GroundEntity, PlayableCharacter, DoorEntity, PlateEntity, BoxEntity, PlatformEntity, GoalEntity, SoundHelper, Level) ->
'json!/data/level01.json'], ($, boxbox, GroundEntity, PlayableCharacter, DoorEntity, PlateEntity, BoxEntity, PlatformEntity, GoalEntity, WallEntity, SoundHelper, Level) ->

class Loader

Expand Down Expand Up @@ -43,6 +44,9 @@ define [

world = boxbox.createWorld @canvas, levelRequested.World

# Edge walls
walls = (new WallEntity world, options).register() for options in levelRequested.WallEntity

grounds = (new GroundEntity world, options).register() for options in levelRequested.GroundEntity

doors = (new DoorEntity world, options).register() for options in levelRequested.DoorEntity
Expand Down
4 changes: 4 additions & 0 deletions public/data/level01.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"scale": 32,
"tickFrequency": 100
},
"WallEntity": [
{ "x": 1.17, "y": 10 },
{ "x": 30.83, "y": 10}
],
"GroundEntity": [
{ "width": 30, "x": 16, "y": 20.3 },
{ "width": 16.25, "x": 10.3, "y": 14.3 },
Expand Down

0 comments on commit 5f5240c

Please sign in to comment.