axcho / ccbox2d Goto Github PK
View Code? Open in Web Editor NEWa cocos2d-flavored wrapper for Box2D
a cocos2d-flavored wrapper for Box2D
I just installed CCBox2d and followed the directions to install the XCode4 template. Then I attempted to create a new project with the template via XCode ( v4.6 ) and it deleted everything in my target folder.
Steps:
If you then go to the directory you picked, you will find only an XCode project called "Development.something". I can't remember exactly and I don't want to reproduce it.
But everything that was in that directory is gone.
Files folders everything. For me that was my Development folder. Thank God for offsite source control and backing up, though I did lose a mornings work.
System Info: iMac(iMac12,2), OS X 10.8.2 (12C60), 3.4 GHz Intel Core i7, 16 GB RAM
This project has a lot of potential and I am excited to use it. However, there are two major issues.
CCBodySprite *sprite = [CCBodySprite spriteWithFile:@"foo.png"];
sprite.worldLayer = self;
[sprite addShape:[CCShape circleWithCenter:ccp(240, 160) radius:16]];
[self addChild:sprite];
Because the body is never created. So, I tried this:
CCBodySprite *sprite = [CCBodySprite spriteWithFile:@"foo.png"];
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
bodyDef.allowSleep = true;
bodyDef.awake = true;
bodyDef.userData = sprite;
sprite.worldLayer = self;
// have to include the CCBox2dPrivate.h header to access world property
// which is really confusing because AFAICT this is the only way to get
// it to create a body
[sprite configureSpriteForWorld:self.world bodyDef:bodyDef];
[sprite addShape:[CCShape circleWithCenter:ccp(240, 160) radius:16]];
sprite.position = ccp(p.x, p.y);
[self addChild:sprite];
Which kind of works, but the position if the sprite is always 0, 0 no matter what the postion property is set to. Am I missing something obvious? Can you provide a simple example of how to create a CCBodySprite that works as expected?
Any help would be appreciated. Like I said, this project seems like it will be awesome once some of it is demystified. Thanks so much for open sourcing it!
If you do a download of the current repository it won't build because the file "CCBox2D-Prefix.pch" is missing.
Also CCWorldLayer.h line 67 has a typo.
-(UInt16) collisionTypeBits:(NSSArray*)collisionTypes;
NSSArray has too many Ses.
I'm trying to do a build and test for the Mac, like axcho asked, but haven't gotten past this yet.
Just found this: http://dl.getdropbox.com/u/1765875/79584589.png
Something like third image can be used as official icon for CCBox2D.
Woot? =)
❤️
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.