# Tagged Questions

46 views

### Help finding time of collision

I am making a simple game right now and am struggling with collision response. My goal is to someday be able to turn it into a 2D platformer but I have a long way to go. I am currently making this in ...
229 views

### How to simulate wind in 2D

for a 2D scenario, I wanted to have a fan blow at an object and make it move with the "wind", how can I simulate the wind under these circumstances?
42 views

### Resolving penentration after collision using Separating Axis Thereom

I implemented collision detection in my game using SAT. The detection works, but I'm trying to use the algorithm to figure out the penetration vector of the two OBBs and push them apart (before doing ...
151 views

### XNA - Making 2D Hexagons Connect With Each Other

Hey so I'm working on a top-down 2D strategy game in XNA, and the tiles are hexagons. I can't have a grid because of the game mechanics, so everything has its own location, and every tile object is ...
76 views

### Adding a small slide when player releases left/right key

the aim is for the player object to slow down and stop instead of just stopping dead. The following codes works ok when the player is not jumping, but gets stuck in an object if the player is in the ...
136 views

### Smooth moving on tile-based map, how to fix simple collisions?

I've already had some experiences about the work of 2 dimensional square-based playfields and moving a player on them. Though, when a square has multiple pixel sizes, and player moves e.g. 1 pixel per ...
145 views

### Wall jumping collision detection anomaly

I'm creating a game where the player ascends a tower by wall jumping his way to the top. When the player has collided with the right wall they can only jump left and vice versa. Here is my current ...
96 views

### in a 2D game that has an array as a map how to make graphics look nice?

I have a map that's stored in a 2D Array with 1s being walls, 0s being roads, and 2s being houses. There is a character that is not stored in the map but its position is always checked against the map ...
497 views

### How can I tell what a rectangle intersects with?

I understand XNA's Rectangle class is rather limited, but surely there is a way to tell what a Rectangle is intersecting with? If I had Rectangle boundingBox = new Rectangle(stuff here); how would I ...
275 views

### 2D Rectangle Collision

I want to make a small 2D game. In the game you can go in all directions(with the bird's-eye view) and can shoot. (A little bit like BoxHead http://de.y8.com/games/box_head_2play) My problem there is ...
160 views

### Using uniform grids for collision detection - Efficient way to keep track of what a cell contains

I was looking for an efficient way to implement collision detection in a 2D game. A way that won't result in an O(n^2) level of complexity. A lot of people recommend to use Uniform Grids for this ...
61 views

### how to project a collision between a pair of polygons under rotation?

I am trying to create a physically plausible 2d physics engine. I have read many documents about detection of collisions, contact resolving, interpenetrations, projection, separating axis theorem ...
712 views

### Platformer raycast collision detection

I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
109 views

### Polygon Collision Response

I'm working on a game engine that has a built in custom physics engine (I know it's a waste of time, but I have years to make this, so why not make it good?). Currently, with any number of polygons, ...
202 views

### Strange collision behaviour in 2D game even though the collision is very basic [closed]

I have a player ship (cube) and some enemy laser projectiles. When the player ship has position X values greater than 1, collision with the enemy projectiles occur but when it has lower X values, the ...
147 views

### Grid based Collision Detection between circles [duplicate]

I am working on a 2d arcade game where I have 5 types of circles with different sizes: The ship, the missiles, and 3 types of monsters. This is what it looks like: Currently I'm using brute force ...
461 views

### Slope polygon collider 2D causing box collider 2D to 'bump' while sliding on it

I'm doing procedural terrain generation. So far I've created the mesh, and attached a 2D polygon collider to it. The terrain is made up of hills going up and down. After doing so, I put a 2D rigid ...
77 views

### Collision - Per Pixel and Rectangle Based, Combined

UPDATE:i found the error in my calculation the problem was that i needed to consider if the image is rendered flip or not to fix it just need to rub from the opposite side of the sprite I am currently ...
272 views

### How to implement uniform grids

Up until now, I implemented all-against-all collision detection in my games. It worked fine. But I reached a point where implementing this kind of collision detection, makes the game run poorly, ...
164 views

### AABB vs Rectangle

I'm trying to wrap my head around 2D physics and stumbled upon Axis Aligned Bounding Boxes, and I have a couple of questions regarding them. In all AABB structs I could find out there, people prefer ...
99 views

### Map color collision problem

Hello i'm doing a game in WPF, 2D version (top view) I have the map and i'm trying to check for color collision in pixel each time the timer is activated Well...with 1 object it works fine but with ...
174 views

I created my circle vs. rectangle method based on this algorithm: http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection Currently, I have a dynamic ball with ...
284 views

### Circle vs. Rect Collision accuracy problem

The blue ball is dynamic and is supposed to bounce off the walls, as well as the rectangle. Currently, the green rectangle is adding an invisible line to the scene, which doesn't let my ball go where ...
143 views

### Collision method for multiple circles

This is a bouncing ball program. There is 1 dynamic circle and 3 static ones. The static ones are obstacles for the dynamic circle, and the dynamic circle is supposed to bounce off of the static ...
227 views

### Circle to Circle collision - bad accuracy

Circle1 (blue) is moving and its X and Y bounds are the screen (meaning it bounces off the walls). Circle2 (black) is stationary. Circle1(blue) is supposed to bounce off of Circle2 without ...
284 views

### Bounce off of objects

How do I make my ball bounce off objects on the screen? I'm having trouble detecting the collision, as well as calculating the response. The picture below is a good example of how the program should ...
126 views

### What would be a good way to implement Zelda like attack? [closed]

I'm looking for ways to implement "attack" like Gameboy Zelda used. A method I came up with is: Create a rectangle near a player based on the direction the player is facing when every time attack ...
530 views

### 2D Rectangle/Circle Continuous Collision Detection

I'm looking for a fast 2D continuous collision detection algorithm for circles and rotated rects. It needs to determine the time of collision. Both shapes may be moving at high speed, so the ...
248 views

### 2D fighting bounding boxes

I'm prototyping a 2D platformer/brawler game for uni and I'm having some trouble with creating collision/bounding boxes. This is most likely going to end up on a Vita so I do have some library ...
310 views

### Would it be more efficient to handle 2D collision detection with polygons, rather than both squares/polygons?

I'm working on a 2D game engine and I'm trying to get collision detection as efficient as possible. One thing I've noted is that I have a Rectangle Collision collider, a Shape (polygon) collider and a ...
294 views

### Falling Blocks and complex shapes

I currently have a simple Tetris-like game and have come across a problem I cannot solve. Unlike Tetris where there is a single falling shape, I have multiple, potentially interlocking shapes that ...
363 views

### Allowing a player to walk up and down slopes without resistance

I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them ...
215 views

### Finding a normal vector

I'm trying to replace my old integer based movement and collision system with a vector system, because its more precise and more flexible. I want to implement wall sliding, such that if a player hits ...
96 views

### How to cancel out simultaneous collisions in libGosu?

I am working on an Asteroids remake. When the player's bullets hit a large meteor, it should break apart into 2 smaller meteors. This works when the player is only firing one bullet, but when the ...
247 views

### Collision Detection problems for vertically moving platforms

Background My game is a static screen (ie, no scrolling) 2d platformer and my CD routine is split into 2 - after vertical movements, (ie, gravity etc) I check for collisions, and if they are ...
282 views

### C# XNA4 2D Collision Detection

I am working on a 2D engine in Xna and am running in a bit of trouble with Collision implementation. What I want to do is have an interface ICollidable that I can add to GameObjects that are ...
119 views

### simple collision detection 2d match 3 gem over gem

im building simple match 3 game . now i have the parts where i move the gems with the mouse only in the straight X or straight Y up and down and both sides , no 45 degrees movements on grid . now im ...
473 views

### How would I detect if two 2D arrays of any shape collided?

Say there's two or more moveable objects of any shape in 2D plane, each object has its own 2D boolean array to act as a bounds box which can range from 10 to 100 pixels, the program then reads each ...
219 views

### Collision detection with entities/AI

I'm making my first game in Java, a top down 2D RPG. I've handled basic collision detection, rendering and have added an NPC, but I'm stuck on how to handle interaction between the player and the NPC. ...
154 views

### Collision detection-too fast [closed]

I've looked through a few other answers and it seems like I'm doing a dynamic timestep update and I'm checking about 10 pixels before the rectangle to see if it would intersect. However, the updating ...
119 views

### How to handle zooming? (Collision detection and speed are off)

I'm working on a bird's eye view 2D game. I want to zoom in/out based on the entity's speed (similar to GTA 1/2), but I'm struggling with the zooming. To zoom, I simply scale all the entities by the ...
2k views

### How do I make a game tick method?

I've seen in some other simple 2D games that a "tick" method is used to sync game logic and graphics rendering. My main reason for using this is due to my collision detection malfunctioning, since ...
141 views

### scale rotating boundingbox

I want to use basic rectangular collision detection. I have a rotating sprite and a method that calculates the bounding box every time in the Update() method. I simply check for intersection between ...
106 views

### Player getting caught on floor

My player is getting caught on something on the floor. My whole environment is just blocks. I have looked through (and tried to change) just about everything I can think of in my player update method. ...
155 views

### My logic in collision detection in diagonal code correct? [closed]

I made this code to detect collision from the diagonal(top left). I'm trying to find the problem on what I'm doing wrong. Is it necessary to have a diagonal collision for the wall? Player class: ...
390 views

### How was traditional 2D collision detection/resolution being done? [closed]

Just out of pure curiosity, I'm wondering how classic 2D games of the 80s/90s (The Legend of Zelda, Super Mario, Warcraft, ...) approached collision detection/resolution. For some reason I can't ...
140 views

### Breakout style ball-paddle bounce, error at corner

I am trying to make a breakout game where you have a paddle and a ball bounces around breaking bricks. The problem is that if the ball touches the corner of player it goes inside of player. I change ...
85 views

### Mapping of positions on images in different frames

I am looking for a possibility to map different positions on a 2D Image which has different frames. Let's say I have an image, consisting of three frames, which shows a spaceship. The first frame ...