box2d-iphone

Drag and drop UIViews with Box2d (iOS) [closed]

主宰稳场 提交于 2020-01-11 14:44:46
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I recently found a nice tutorial for enabling physics with Box2d for iOS. http://www.cocoanetics.com/2010/05/physics-101-uikit-app-with-box2d-for-gravity/ I'm just wondering how to implement drag and drop for a

Drag and drop UIViews with Box2d (iOS) [closed]

妖精的绣舞 提交于 2020-01-11 14:43:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I recently found a nice tutorial for enabling physics with Box2d for iOS. http://www.cocoanetics.com/2010/05/physics-101-uikit-app-with-box2d-for-gravity/ I'm just wondering how to implement drag and drop for a

Speed increase when ApplyForce and LinearImpuls apply both using in Game

▼魔方 西西 提交于 2020-01-06 07:53:27
问题 In my game i am using LinearImpuls for jump player body and ApplyForce for movement left-right .But the problem is that when player jump at that time if movement occur then player speed so increases its just look like running on air. So what to do to resolve this problem?? Thanks in advance 回答1: I think keeping a check by boolean variable in code that at one time only one action can be performed either jump or moving left and right will solve the problem until and unless it does not affect

Speed increase when ApplyForce and LinearImpuls apply both using in Game

限于喜欢 提交于 2020-01-06 07:53:17
问题 In my game i am using LinearImpuls for jump player body and ApplyForce for movement left-right .But the problem is that when player jump at that time if movement occur then player speed so increases its just look like running on air. So what to do to resolve this problem?? Thanks in advance 回答1: I think keeping a check by boolean variable in code that at one time only one action can be performed either jump or moving left and right will solve the problem until and unless it does not affect

CCLOG not displaying

假装没事ソ 提交于 2019-12-31 07:30:35
问题 I have written a code to display using CCLog the exact position of a sprite when a mousejoint moving it is released. Below is the Sprite.mm class and the ccTouchesEnded method (which is in the HelloWorldLayer.mm class). The CCLog is not displaying the message. Sprite.mm: -(id)addSprite:(CCLayer *)parentLayer inWorld:(b2World *)world { PhysicsSprite *aSprite = [PhysicsSprite spriteWithFile:@"spriteIm.png"]; aSprite.tag = 1; [parentLayer addChild:aSprite]; b2BodyDef spriteBodyDef; spriteBodyDef

HTML 5 game development tools [closed]

我的未来我决定 提交于 2019-12-29 14:58:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can anybody please guide me with the best engine for game development in HTML5? It is simple jumping and surface detection game. The theme is like jumping and go above the tree tops. What you suggest in this case? I am targeting Android and iOS devices for the game. In order to save memory, should I write my

Simple gun in cocos2d+box2d game

独自空忆成欢 提交于 2019-12-28 03:04:20
问题 I'm newbie in box2d. Can you help me? I want to make gun (touch, move, stopped, ball flew). I make detection and rotation of gun, but I can't make popping of ball. How can I count velocity, which I need to set to the ball? Thank you very much 回答1: The easiest way is to look at the direction the gun is pointing when you define the body, and use GetWorldVector to see how it has changed. For example if the gun is pointing directly upwards when you create the body, this would be the direction (0

How to create a circle shape without solid polygon or non solid circle``

Deadly 提交于 2019-12-25 02:43:26
问题 I am developing a casino roulette game in box2d. As you know in this game a ball/dice will be in a circular spinning wheel. First I tried with b2circleShape but it didn't work. I mean that the ball is not sitting inside the circular shape. Then I tried with b2EdgeShape. But for the b2edgeShape I need to create as many vertices as I can to build a smooth circular surface. Is there anyway that I can create such circle shapes which are not polygons or which are not solid polygons? If have any

box2d world :: everything is so light !

一笑奈何 提交于 2019-12-14 02:40:40
问题 i'm using box2d 2.1.2 with cocos2d 0.99.4 in my world, everything is light, there is no sensation about dropping a stone or a box !! everything falling slowly at the same speed b2Vec2 gravity; gravity.Set(0.0f, -10.0f); bool doSleep = true; world = new b2World(gravity, doSleep); and my objects : b2BodyDef *TBodyDef = new b2BodyDef; TBodyDef->position.Set(100, 200); b2Body *TBody = world->CreateBody(TBodyDef); TBody->SetType(b2_dynamicBody); TBody->SetAwake(true); b2CircleShape TCircleShape;

Most Efficient way to deal with multiple CCSprites?

别等时光非礼了梦想. 提交于 2019-12-13 21:05:33
问题 I have four different types of objects within my environment(box2d), each type of object having multiple instances of itself, and would like to find the most efficient way to deal with adding and manipulating all the CCSprites. The sprites are all from different files, so would it be best to create each sprite and add it to a data structure (NSMutableArray) or would I use a CCSpriteBatchNode even though each CCSprite file is different (for each type of object)? Thanks. @interface LevelScene :