box2d

Android, libgdx and box2d basics [closed]

别说谁变了你拦得住时间么 提交于 2020-01-01 08:38:13
问题 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 wrote couple of simple board games since i started on android learning, Please let me know is there any tutorial or links, where i can start with physics library with libgdx, looking for something like basics

Calculate the distance between two CGPoints

99封情书 提交于 2019-12-31 11:38:03
问题 i need to calculate the distance between two CGPoint s. I refered this and this, but I don't get it. 回答1: Well, with stuff your refering too where is the full code: CGPoint p2; //[1] CGPoint p1; //Assign the coord of p2 and p1... //End Assign... CGFloat xDist = (p2.x - p1.x); //[2] CGFloat yDist = (p2.y - p1.y); //[3] CGFloat distance = sqrt((xDist * xDist) + (yDist * yDist)); //[4] The distance is the variable distance. What is going on here: So first off we make two points... Then we find

Box2d libgdx, a bit confused about the pixels to meters stuff

浪子不回头ぞ 提交于 2019-12-31 05:33:08
问题 So I understand the concept. The idea is that box2d more or less works in meters, so you need to do a conversion from pixels to it. Makes sense. I was following the tutorial/intro to box2d here. It mentions to do the conversion and gives you some example amounts to use. Now, that's all well and good, but I find when I'm using such techniques, the debugger box doesn't seem to render where they should. The collision does work as expected however. In my GameScreen class, here's how I initialize

Rotate a Sprite on a bezier path with touch - Cocos2D/Box2D

懵懂的女人 提交于 2019-12-30 10:52:54
问题 I have an arrow that I rotate with touch. I was wondering if it was possible to rotate the arrow on a curved line? I've done some research and I think it is called a bezier path? Is it even possible to rotate a sprite on a bezier path using this code and if so how would I even incorporate it? UITouch *touch = [touches anyObject]; //acquire the previous touch location CGPoint firstLocation = [touch previousLocationInView:[touch view]]; CGPoint location = [touch locationInView:[touch view]]; /

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

Which Box2D JavaScript library should I use? [closed]

强颜欢笑 提交于 2019-12-29 02:21:13
问题 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 3 years ago . There are a few different ports of Box2D for JavaScript. Which one is the best? Box2DJS - "converted from Box2DFlashAS3_1.4.3.1 in an automatic manner" Box2Dflash 2.0 ported to JavaScript - "one big nasty hack that just happens to work" box2dweb - "a port of Box2DFlash 2.1a to JavaScript. I developed an

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

SpriteKit physics in Swift - Ball slides against wall instead of reflecting

南楼画角 提交于 2019-12-28 02:52:07
问题 I have been creating my own very simple test game based on Breakout while learning SpriteKit (using iOS Games by Tutorials by Ray Wenderlich et al.) to see if I can apply concepts that I have learned. I have decided to simplify my code by using an .sks file to create the sprite nodes and replacing my manual bounds checking and collision with physics bodies. However, my ball keeps running parallel to walls/other rectangles (as in, simply sliding up and down them) any time it collides with them

AndEgine/Box2d-How to move a dynamic body without using mouse joint?

梦想与她 提交于 2019-12-25 18:35:57
问题 I have tried a lot to find a solution for moving a dynamic body smoothly on the screen. Mouse Joint doesn't work for me, it has that rubber band effect that isn't useful for smooth movements. I have also tried to apply linear velocity to make the ball move, but couldn't do it so. What are the options to get a simple touch movement on bodies? For example, similar to Glow Hockey? The answer need not to be specific to AndEngine. Cocos2d would work for me as well. I've registered Touch listener,

JavaScript reference error can't find variable plus closure blues

安稳与你 提交于 2019-12-25 18:34:41
问题 Just in general I'm getting some errors with this. The major one is in safari and the android browser get the error JavaScript reference error can't find variable The variable in question is b2AABB . Here is the code var worldAABB = new b2AABB(); I am working with box2d JavaScript (the pixel lab variant) for google closure . Also if you can give my closure dependencies and requires a good once over I would appreciate it. <html> <title>Tune Tunnels Alpha</title> <head> <!--====================