I created a game in cocos2d-x javascript binding and I used a array and json to store in. But in c++ I don’t know how to do it. Someone can help me how to do it. Convert a array like this array to c++.
this.animalInfos =
[
{
name: 'su_tu',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 64,
animationFilePrefix: 'con su tu_0000',
animationStartFrame: 1,
animationEndFrame: 14,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'huou_cao_co',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 70,
animationFilePrefix: 'huou_cao_co.ai_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'khi',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 17,
animationFilePrefix: 'con khi_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'nai',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 30,
animationFilePrefix: 'Con nai_000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 30,
selectedAnimationEndFrame: 36
},
{
name: 'da_dieu',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 85,
animationFilePrefix: 'con da dieu_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'cu',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 29,
animationFilePrefix: 'con cu_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 16,
selectedAnimationEndFrame: 18
},
{
name: 'ran',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 70,
animationFilePrefix: 'Con_ran_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'gau_truc',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 36,
animationFilePrefix: 'con gau_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
{
name: 'vit_xiem',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 28,
animationFilePrefix: 'vit xiem_0000',
animationStartFrame: 1,
animationEndFrame: 16,
selectedAnimationStartFrame: 17,
selectedAnimationEndFrame: 19,
moving: true
},
{
name: 'soc',
boundingCentralOffset: cc.p(0, 0),
boundingRadius: 35,
animationFilePrefix: 'con soc_0000',
animationStartFrame: 1,
animationEndFrame: 15,
selectedAnimationStartFrame: 15,
selectedAnimationEndFrame: 17
},
];