Skip to main content

Spinal tap - First attempt at using Esoteric Software's Spine app.

In NDvsPR I made the sprites by creating individual images of the characters in various positions  in photoshop, collating them as a sprite sheet  and referencing them using the sprite API.
Since the sprite API in Corona has been deprecated, and I'd already purchased a copy of Spine I thought it worth trying it out.
First step is to divide the image to be used into layers, one for each section, so Head, Right arm, Left arm etc...
There is a script that comes with Spine that exports the layers as individual .PNGs and a JSON file outlining their relative positions.

{"bones":[{"name":"root"}],"slots":[
{"name":"Tail_Tip","bone":"root","attachment":"Tail_Tip"},
{"name":"Tail_2","bone":"root","attachment":"Tail_2"},
{"name":"Tail_3","bone":"root","attachment":"Tail_3"},
{"name":"Tail4","bone":"root","attachment":"Tail4"},
{"name":"Left_Leg","bone":"root","attachment":"Left_Leg"},
{"name":"Left_arm","bone":"root","attachment":"Left_arm"},
{"name":"Body","bone":"root","attachment":"Body"},
{"name":"Right_Leg","bone":"root","attachment":"Right_Leg"},
{"name":"Right_arm","bone":"root","attachment":"Right_arm"},
{"name":"Neck","bone":"root","attachment":"Neck"},
{"name":"Head","bone":"root","attachment":"Head"},
],"skins":{"default":{
"Tail_Tip":{"Tail_Tip":{"x":376,"y":1123.5,"width":321,"height":136}},
"Tail_2":{"Tail_2":{"x":154,"y":905,"width":263,"height":364}},
"Tail_3":{"Tail_3":{"x":148,"y":573,"width":236,"height":424}},
"Tail4":{"Tail4":{"x":377.5,"y":429,"width":513,"height":562}},
"Left_Leg":{"Left_Leg":{"x":390.5,"y":200,"width":528,"height":400}},
"Left_arm":{"Left_arm":{"x":922,"y":835,"width":169,"height":93}},
"Body":{"Body":{"x":542,"y":537,"width":1054,"height":1065}},
"Right_Leg":{"Right_Leg":{"x":735,"y":309,"width":718,"height":504}},
"Right_arm":{"Right_arm":{"x":913,"y":803.5,"width":147,"height":111}},
"Neck":{"Neck":{"x":885,"y":969.5,"width":260,"height":231}},
"Head":{"Head":{"x":1081.5,"y":997,"width":236,"height":189}},
}}, "animations": { "animation": {} }}


A new project is created in Spine, and the data imported providing the image with all the components correctly positioned. Each component needs to have a bone associated with it. This is a bit fiddly, and I redid the bone structure half a dozen times as I kept making mistakes. A handy hint when creating the bones is to hold the shift key which allows components to be associated directly, rather than once a bone is created.


Once the skeleton is attached I switched to animation mode. Here I had to create the initial keyframe, and subsequent movements for a 12 frame section. Unfortunately my components didn't lend themselves well to animation and the poor thing looks like it's got a hip problem.
I need to redraw the individual components and re-export them, but not today.


Popular posts from this blog

live

Spine again - animating game assets

Laura Tallarday gave a neat demo of how to build an animation in Spine on the CoronaGeek Hangout, so I had a bash at chopping up an image and animating it.
The plan is to add some more sophisticated animations to the new game "Duck sized horse".. but as was discussed in the show adding a whole bunch of spine animated objects might hammer a mobile device... and as the aim is to have 100 tiny duck sized horses, I'd best choose another approach for them.

anyway here's a swaying viking...




Using Corona SDK

Corona Architecture Overview
Diagram showing the Corona SDK architecture -source Walter Lua - CEO Corona The development process. I built the game "Ninja Dinosaurs vs Pirate Robots" in a series of 4 development sprints. I used a familiar game format, the "Infinite Runner" to guide the overall structure, and built the game using the Agile development methodology and Simplicity principle: "simplicity: write the simplest code to do the job, do not provide hooks in your code for ‘future needs" - this prevents scope creep. Studies by Jones (2009) have shown that Agile is most effective with small teams. Agile focuses on swift iterative cycles creating instances of working code, which are constantly reviewed and guided by the end users rather than a rigid commitment to a fixed system architecture. It values working code over heavy documentation, as might be encountered in a more traditional waterfall development approach.
Game Summary. Whilst the game is an inf…