Questions tagged [chipmunk]

Chipmunk is an open-source physics library written in C.

See: The Chipmunk Website

318 questions
1
vote
1 answer

How can I store SpaceManager cpShape's in something like an array?

I'm trying to create a squishy ball with Cocos2d and Chipmunk (via SpaceManager) using a bunch of rects all chained together then joined with springs to a central body. Something like these examples But in order to do this, i think I need to store…
gargantuan
  • 8,888
  • 16
  • 67
  • 108
1
vote
0 answers

How velocity impacts on CCSprite in Cocos2d Chipmunk?

I am in need of the basic understanding of how velocity changing works? i.e. how CCSprite is able to jump at particular height when some velocity is set? Let me give you an example on which I am working currently. I am preparing a demo like flappy…
Paresh Thakor
  • 1,795
  • 2
  • 27
  • 47
1
vote
2 answers

Check collision speed in Chipmunk Physics

I'm using Chipmunk 5 for iPhone, with Cocos2D. Upon collision between two specific objects I'd like to run a method which checks the velocity of that collision, if it's over x it runs one set of code, if it's under x it runs another. Now, I…
Andrew
  • 13
  • 2
1
vote
0 answers

cocos2d-x physics nodes slide along other

I am developing a game using cocos2d-x with built-in physics engine. In this game, user try to put object as stack and keep them balance. However, i got a problem when i try to put an object on other one, it makes two objects slide along each…
chuanhd
  • 11
  • 2
1
vote
0 answers

game unit collision with obstacle

I am making an action game and is trying to make the player character not being able to pass through obstacles in the game map. Situation is similar to the game Metal Gear obstacles(wall) in the middle of the scene. Because movement are controlled…
Nick
  • 783
  • 7
  • 21
1
vote
1 answer

cocos2dx - ActionTween not working

In my game, I need to rotate coin for that I am using ActionTween like below auto animateTo=ActionTween::create(.4, "roll", 0.f, M_PI_2); auto animateFrom=ActionTween::create(.4, "roll", M_PI_2, M_PI); auto…
iphonic
  • 12,615
  • 7
  • 60
  • 107
1
vote
1 answer

Create Dynamic Body using cocos 2d js and Chipmunk

I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic. this.space = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new…
Sameer Hussain
  • 2,421
  • 8
  • 23
  • 41
1
vote
1 answer

Compiling Chipmunk2D for Android using CMake

I want to use Chipmunk2D on Android. In the sample Chipmunk2D/android/Android.mk they talk about using CMake to build Chipmunk2d for Android. As per the comment of the commit when this file was added suggests, I use Android-CMake to build a static…
simon
  • 93
  • 1
  • 9
1
vote
1 answer

Chipmunk physics: Velocity question

I'm making an iPhone game where the main actor is a ball that rolls depending on the device's accelerometer rotation. I haven't started on this part of the coding yet, but I was wondering if you guys had a nice way of solving this: I tried looking a…
Johannes Jensen
  • 1,228
  • 2
  • 18
  • 28
1
vote
1 answer

Finding nearest points with Chipmunk and cocos2d

Using cocos2d and chipmunk, I try to get the different object around a sprite (for example a bomb) so that I can apply an impulse on these. I first added this on top of my project: #import "ObjectiveChipmunk/ObjectiveChipmunk.h" #import…
1
vote
0 answers

Cocos2d-JS, cpBodyFree and cpShapeFree?

I'm using Cocos2d-JS with Chipmunk and I want release a body and a shape. I see in the chipmunk documentation the functions cpBodyFree and cpShapeFree, but I don't know how call them in my javascript code (body.free and shape.free are not…
1
vote
1 answer

CCPhysicsBody Collision not working in cocos2d-swift v3.4

Here is code: @interface MainScene : CCNode //.m -(void)onEnter { [super onEnter]; mPhysicsWorld = [CCPhysicsNode node]; mPhysicsWorld.gravity = ccp(0,0); mPhysicsWorld.debugDraw = YES; …
Guru
  • 21,652
  • 10
  • 63
  • 102
1
vote
2 answers

How to access Physics World in Layer

I need to create joint between two bodies in layer. Joints are to be added in physics world. How can i access physics world in layer?
Nishu
  • 11
  • 4
1
vote
0 answers

Using collision groups with a large amount of similar objects - COCOS 2d v3 (Chipmunk)

I have had a good look at other similar questions here but cant seem to find one that answers my question. The answer may be simple in which case please excuse my ignorance.. I have a game with a large amount of balls (over 100). These are created…
1
vote
2 answers

How do you make a static sprite be a child of another sprite in cocos2D while using SpaceManager

I have two static (STATIC_MASS) SpaceManager sprites. One is a child of the other - by which I mean that one sort of builds up the other one, but although the child's images shows up in the right place, the child doesn't seem to exists in the…
JJ Rohrer
  • 2,671
  • 5
  • 29
  • 37