collision

Efficient collision detection in AS3

时光怂恿深爱的人放手 提交于 2020-04-30 10:58:16
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with

Efficient collision detection in AS3

谁说我不能喝 提交于 2020-04-30 10:57:18
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with

Finding points of intersection when two spheres intersect

老子叫甜甜 提交于 2020-02-05 07:39:20
问题 I have the center (xyz - in 3 dimensional space) and the radius of two spheres A and B. Now I have to figure out a point or more than 1 point where these spheres meet. It is fairly easy to figure out if the two spheres collide or not, but how do I find out the points of intersection of 2 spheres? Any help would be greatly appreciated. 回答1: The curve where they intersect is a circle. The equation for the radius of the circle is a bit complicated, but is shown here, in eqn. 8, and this distance

Box2D collisions error

邮差的信 提交于 2020-01-24 15:34:05
问题 I am currently using box2d physics engine in java in libgx, and i am facing problems with collisions. The problem is that the body stops moving, and a collision point appears while on a flat area. The way im working is i am making multiple bodies, each representing a block, and those blocks are side-by-side. Look at the collision point here: the body should not collide here for the Y coordinate of the bodies is equal, and their side is equal as well. float PPM = 100; float side = 45; for

Box2D collisions error

杀马特。学长 韩版系。学妹 提交于 2020-01-24 15:33:46
问题 I am currently using box2d physics engine in java in libgx, and i am facing problems with collisions. The problem is that the body stops moving, and a collision point appears while on a flat area. The way im working is i am making multiple bodies, each representing a block, and those blocks are side-by-side. Look at the collision point here: the body should not collide here for the Y coordinate of the bodies is equal, and their side is equal as well. float PPM = 100; float side = 45; for

jquery .animate() collision detection

﹥>﹥吖頭↗ 提交于 2020-01-23 12:49:27
问题 I'm using animate to move a div within a grid of divs. As a test I am setting some of the grid divs as obstacles. If the animated div collides with one of the obstacles I want to end the animation. A plug in is fine or a snippet of code. I kind of suspect I am sniffing up the wrong tree with .animate() so any shove in the right direction or improvement on what I am doing is appreciated: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

jquery .animate() collision detection

有些话、适合烂在心里 提交于 2020-01-23 12:49:10
问题 I'm using animate to move a div within a grid of divs. As a test I am setting some of the grid divs as obstacles. If the animated div collides with one of the obstacles I want to end the animation. A plug in is fine or a snippet of code. I kind of suspect I am sniffing up the wrong tree with .animate() so any shove in the right direction or improvement on what I am doing is appreciated: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

libgdx animation inside of a rectangle - collison detection - rectangles

馋奶兔 提交于 2020-01-22 03:31:07
问题 I am writing a RPG game similar to the style of Pokemon (top down view). I am now working on the issue of collision detection. I am wanting to create the collision detection based on rectangles. The problem is that i am having difficulty drawing the rectangle around the animation that i have previously set. I have searched Google and YouTube for a answer/tutorial of how to handle this problem yet found nothing. Player.class public class Player { public Vector2 position; private float

Pixel-perfect collision and doubles

三世轮回 提交于 2020-01-17 01:00:17
问题 I am working with tiles and entities ; they are both rectangles , and I can adjust the speed of the entities , such as setting the speed as 2.3 . The problem that complicates is when it comes to collision between the tiles and the entities . My method for collision actually adds on to check the next tile from its current speed , so if the speed is 2.3 , but the distance between the tile and entity is 1.4 , it won't let it move that tiny difference, and it will leave the tiniest pixel between

Lua for loop does not iterate properly

陌路散爱 提交于 2020-01-15 12:33:23
问题 I am in dire need of help with a for loop. I'm trying to go through a for loop in Lua with the Corona SDK, but I am doing something wrong but I don't know what. See below for my code: function moveLift(event) for j=1,4,1 do if event.phase == "began" then markY = event.target.y elseif event.phase == "moved" then local y = (event.y - event.yStart) + markY event.target.y = y elseif event.phase == "ended" then if (hasCollided( event.target, hotSpots[j] )) then print("hasCollided with floor: ",