Added comments and made code more readable

This commit is contained in:
SHIYING 2014-01-11 15:43:34 -05:00
parent 00cdb1e5ad
commit ae67a9dc23

View file

@ -6,13 +6,14 @@ Rand = require './rand'
module.exports = class Thang
@className: "Thang"
@random = new Rand 0
# Random ordering for each sprite name
@ordering: (spriteName) ->
Thang.orders ?= {}
names = thangNames[spriteName]
if names
len = names.length
array = Thang.orders[spriteName]
if !array?
if not array?
array = @random.randArray len
Thang.orders[spriteName] = array
else