If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
xfstudio
Posts: 16
Registered: ‎01-06-2013
My Device: BlackBerry 10 - Z10 LE
My Carrier: Optus

Cocos2d-x + Scoreloop integration for BB10?

Hello guys,

 

I am currently working on a game using Cocos2d-x. I am wondering if there is any example on Cocos2d-x + Scoreloop integration for BB10 Native development. 

 

Any one also try upSL wrapper yet? The source code for this wrapper seems a bit out dated.

 

http://www.cocos2d-x.org/projects/cocos2d-x/assets/9

 

Thanks a lot!

Please use plain text.
BlackBerry Development Advisor (Retired)
whoang
Posts: 71
Registered: ‎11-08-2012
My Device: Blackberry 10 - Dev Alpha B | Blackberry Playbook | Blackberry Torch 9810
My Carrier: BELL Canada

Re: Cocos2d-x + Scoreloop integration for BB10?

Hello @xfstudio,

There are a lot of developers on the Cocos2d-x forum that may have tried upSL wrapper:

http://www.cocos2d-x.org/boards/6/topics/14197

William Hoang

Application Developer Advocate | Developer Relations
BlackBerry


Please use plain text.
BlackBerry Development Advisor (Retired)
rmadhavan
Posts: 29
Registered: ‎03-19-2012
My Device: Z10
My Carrier: BELL

Re: Cocos2d-x + Scoreloop integration for BB10?

Hi,

 

Please take a look at this blog post on ways to integrate Cocos2dx and Scoreloop.

 

http://devblog.blackberry.com/2013/02/scoreloop/

 

cheers, Ram

Please use plain text.
Contributor
josempans
Posts: 14
Registered: ‎01-20-2013
My Device: Playbook
My Carrier: None

Re: Cocos2d-x + Scoreloop integration for BB10?

Hi Ram, I was reading that post, but I can´t figure it out how to handle events using SC_RUN_LOOP_TYPE_CUSTOM

What I don't know is how to listen events from the server, I have something like this:

if (!CCLayer::init()) return false;

    SC_InitData_Init(&scData);
    scData.runLoopType = SC_RUN_LOOP_TYPE_CUSTOM;

    errCode = SC_Client_New(&client, &scData, SCORELOOP_GAME_ID, SCORELOOP_GAME_SECRET,                              SCORELOOP_GAME_VERSION, SCORELOOP_GAME_CURRENCY, SCORELOOP_GAME_LANGUAGE);

 And a function:

 

void GameSL::OnScoreloopCustomEvent(float dt)
{
	SC_HandleCustomEvent(&scData, SC_FALSE);
}

 But with these stuff I don't know how can I detect an event. Can you help me?

 

Thanks!

 

PS: This class is a CCLayer, I'm trying to have a persistent layer with scoreloop.

 

Please use plain text.