Skip to content

Commit

Permalink
Merge pull request #1212 from hawkthorne/moar_json
Browse files Browse the repository at this point in the history
Convert character maps to JSON
  • Loading branch information
kyleconroy committed Apr 6, 2013
2 parents 6960be9 + d1f79a1 commit 9d1ec96
Show file tree
Hide file tree
Showing 43 changed files with 2,480 additions and 742 deletions.
9 changes: 7 additions & 2 deletions src/character.lua
@@ -1,13 +1,18 @@
local json = require 'src/hawk/json'
local anim8 = require 'vendor/anim8'
local Timer = require 'vendor/timer'
local sound = require 'vendor/TEsound'
local sprite_map = require 'character_map'

local contents, _ = love.filesystem.read('character_map.json')
local sprite_map = json.decode(contents)

local characters = {}

for i,p in pairs( love.filesystem.enumerate( 'characters' ) ) do

-- bring in the data from the character file
local character = require( 'characters/' .. p:gsub('.lua', '') )
local contents, _ = love.filesystem.read('characters/' .. p)
local character = json.decode(contents)

if character.animations then --merge
local base = deepcopy(character.animations)
Expand Down

0 comments on commit 9d1ec96

Please sign in to comment.