collision

Help with flash collision detection. Rotating and hiting at the same time

What I want to do is rotate the object and have its collision box rotate with it. I want the rectangle to rotate so it looks like a diamond and have one of its sides hit the object in a per pixel fashion. From my reading of some books and websites it seems that normal rectangular collision and hitTestObject collision won't do for this pr...

collision with moving objects

I have tried to write a collision with the moving "floats" but did not succeed. Is something maybe in the wrong place of the "collision" code? // // FruitsView.m // #import "FruitsView.h" #import "Constants.h" #import "Utilities.h" #define kFloat1Speed 0.15 #define kFloat2Speed 0.3 #define kFloat3Speed 0.2 @interface FruitsView (Priv...

Collision Detection for Actionscript 3

Well, I was searching for a simple collision detection function for as3, I found Collision Detection Kit, but it is too complicated, I just want a damn function that I give 2 objects as paramenters and that's it. I would like to know where can I find a pixel-perfect collision detection function (The faster, the better) ...

2D colliding n-body simulation (fast Collision Detection for large number of balls)

Hello I want to write a program for simulating a motion of high number (N = 1000 - 10^5 and more) of bodies (circles) on 2D plane. All bodies have equal size and the only force between them is elastic collision. I want to get something like but in larger scale, with more balls and more dense filling of the plane (not a gas model as he...

Processing velocity-vectors during collision as neatly as possible

Hello. I'm trying to create a good way to handle all possible collisions between two objects. Typically one will be moving and hitting the other, and should then "bounce" away. What I've done so far (I'm creating a typical game where you have a board and bounce a ball at bricks) is to check if the rectangles intersect and if they do, i...

IPhone sdk, more accurate collision detection and set the frame/bounds of UIImageView...

Hey, Im having a big problem with my app at the moment, its all too inaccurate. I have a image of a ballooon, https://dl.dropbox.com/u/2578642/Balloonedit.png And i have a dart which if it collides into the balloon the game ends. At the moment i am populating the image of the balloon with 8 UIImageViews. and i am detecting if the dart...

Sphere to Rectangle collision detection in actionscript 3.0?

Hi, for the past two weeks I've been working on coming up with a collision detection system for my game in flash CS4. No matter what I try for some reason I just can't seem to do it, and I don't know how to fix it. This has never been an issue for me, I would even settle for basic rectangle to rectangle collision if I could, but no mat...

eclipse 3.4 (ganymede) package collision with type

We have a package that ends with exception e.g. package a.b.c.exception; Our code base had no issues up till eclipse 3.3, however when we shifted to eclipse 3.4, it started giving errors related to this package: "The package a.b.c.exception collides with a type" When I refactor the package name to a.b.c.exceptions, there are no is...

Compiler error while compiling the RAPID library on VS2008

I've downloaded the RAPID library and tried to compile it on Microsoft Visual Studio 2008. However, I'm getting the following compiler error: C4430 missing type specifier - int assumed. Note: C++ does not support default-int at this code segment (the exact line that produces the error is int flag): class RAPID_model { public: box...

iPhone Pong Advanced Deflection Angle

Hi, I am currently developing a simple Pong game for the iPhone. Currently using CGRectIntersectsRect for the collision detection and as for the deflection of the ball when it hits the paddle, I just multiply the ball velocity with -1 (therefore reversing the direction of the ball). What I am trying to do is to make it so that when the...

Java hashtable with seperate chaining collision resolution?

I have created a program using the built in java.util.hashtable but now I need to resolve collisions using separate chaining. Is it possible with this implementation of a hashtable? Is there one out there already implemented that uses separate chaining? ...

Oval collision detection not working properly

So I'm trying to implement a test where a oval can connect with a circle, but it's not working. edist = (float) Math.sqrt( Math.pow((px + ((pwidth/2) )) - (bx + (bsize/2)), 2 ) + Math.pow(-((py + ((pwidth/2)) ) - (bx + (bsize/2))), 2 ) ); and here is the full code (requires Slick2D): import org.newdawn.slick.AppGameContainer...

Bouncing a ball off a surface

Hi all, I'm currently in the middle of writing a game like Breakout, and I was wondering how I could properly bounce a ball off a surface. I went with the naive way of rotating the velocity by 90 degrees, which was: [vx, vy] -> [-vy, vx] Which (unsurprisingly) didn't work so well. If I know the position and veocity of the ball, as we...

constrain a touchesmoved object from colliding with walls?

Hi, I'm trying to create a very simple game where you can drag a simple imageView. The thing is there is a wall in the frame (just a rectangle) on which the image should not go. so I did something like this: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; if ([tou...

Surface Detection in 2d Game?

I'm working on a 2D Platform game, and I was wondering what's the best (performance-wise) way to implement Surface (Collision) Detection. So far I'm thinking of constructing a list of level objects constructed of a list of lines, and I draw tiles along the lines. I'm thinking every object holds the ID of the surface that he walks on...

Could this cause multiple identical GUIDs?

As GUID generation is time-dependent, if System.Guid.NewGuid() is called multiple times at the exact same instant on different threads, could it return identical GUIDs? ...

Reflecting a circle off another circle

Working with iPhone and Objective C. I am working on a game and I need to correctly reflect a ball off a circle object. I am trying to do it as a line and circle intersection. I have my ball position outside the circle and I have the new ball position that would be inside the circle at the next draw update. I know the intersect point of...

Unix directory structure: managing file name collision

Usually every time `make install' is run, files are not put in a specific directory like /usr/prog1. Instead, the files are put in directories where files from other programs are already in like /usr/lib and /usr/bin. I believe this has been a common practice since long time ago. This practice surely increases the probability of file nam...

Check collision speed in Chipmunk Physics

Hello. 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 understand the basics but I can't work out the code to run a method on collision detecti...

Actionscript 3 pixel perfect collision. How to? (learning purposes)

I know that there are people out there creating classes for this (ie http://coreyoneil.com/portfolio/index.php?project=5). But I want to learn how to do it myself so I can create everything I need the way I need. I've read about BitMap and BitMapData. I should be able to .draw the MovieClips onto a BitMap so I could then cycle the pixel...