       lastIDNum = Thang.lastIDNums[spriteName]
       idNum = (if lastIDNum? then lastIDNum + 1 else 0)
       Thang.lastIDNums[spriteName] = idNum
+      console.log order
       id = names[order[idNum % names.length]]
       if idNum >= names.length
         id += Math.floor(idNum / names.length) + 1

module.exports = class Thang
  @className: "Thang"
  @random = new Rand 0
  # Random ordering for each sprite name
  @ordering: (spriteName) ->
    Thang.orders ?= {}

      Thang.lastIDNums[spriteName] = if Thang.lastIDNums[spriteName]? then Thang.lastIDNums[spriteName] + 1 else 0
      id = spriteName + (Thang.lastIDNums[spriteName] or '')
    id
    
  @resetThangIDs: -> Thang.lastIDNums = {}

  constructor: (@world, @spriteName, @id) ->
