The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
72 views

Quick algorithm to identify undrawn rectangles inside a map

I already have a working algorithm for this but it's home-made and there is some redundancy in the things it checks, so I'm looking for a fast algorithm (or the name of it) that would detect undrawn ...
0
votes
3answers
77 views

If player leaves a rectangle take him back to his previous position

Okay, I'm making a game. The map contains all the blocks/buildings/structures etc... The map is bordered by a rectangle. So what I want is if the player attempts to exit the rectangle he goes back to ...
0
votes
3answers
71 views

How to find the total bounds rectangle around a list of rectagles

Rectangle object: a simple data structure of 4 floats (w,h,x,y). I have an array of 2 or more rectangles and want to create a rectangle that surrounds all of them: The result rectangle, calculated ...
3
votes
2answers
515 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 ...
0
votes
1answer
76 views

How can I determine if an object hit the top of a tile rectangle in MonoGame? [duplicate]

I've been implementing an AI system in my 2D game using MonoGame. In some situations when a collision between two objects occurs, I need the NPC to move in different directions depending on the ...
0
votes
2answers
332 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 ...
1
vote
1answer
338 views

Get screen bounds of 3D object

I'm trying to draw a 2D plane that has minimum dimensions to contain a 3D model (a sphere). How do I calculate the minimum size and position of the rectangle to completely cover a 3D model on screen?
2
votes
2answers
113 views

Intersection of a point and rectangle

I have a mouse cordinates in 2D game (x and y) and a rectangle (x,y, width,height). How to find if the point is in the rectangle? I do not have any code to post here. I'm just searching for help.
0
votes
2answers
230 views

How to properly translate a point by a matrix?

I wrote a simple Matrix class and it has methods like rotate, translate, etc. They all seem to be working, but whenever I try to translate a rectangle using the matrix, the translation axis seem to be ...
2
votes
1answer
166 views

Getting a uint color array from a portion of a Texture2D

I'm currently using the Farseer tools to create a body from a Texture2D. However, my texture is a spritesheet and I need to get the uint array containing the colors from a portion of the full ...
1
vote
2answers
509 views

Find the Contact Normal of Rectangle Collision

It seems a lot of people have asked similar questions on this site, and every time it seems like a whole bunch of answers that don't work are given. Basically, I have two rectangles (AABBs) that ...
2
votes
3answers
963 views

Creating Rectangle-based buttons with OnClick events

As the title implies, I want a Button class with an OnClick event handler. It should fire off connected events when it is clicked. This is as far as I've made it: public class Button { public ...
-4
votes
1answer
164 views

Can't add rectangles into rectangle list [closed]

When i run this code, it gives me "Object reference not set to an instance of an object." here clickableArea.Add(temp); here is the entire class using System; using System.Collections.Generic; ...
0
votes
2answers
187 views

Draw Rectangle To All Dimensions of Image

I have some rudimentary collision code: public class Collision { static boolean isColliding = false; static Rectangle player; static Rectangle female; public static void collision(){ Rectangle ...
2
votes
1answer
243 views

Reacting to rectangle on rectangle collisions

I don't know how to react to collisions between two axis aligned rectangles that have x, y, width and height values (x and y are from the centre of the box) to make them simply not overlap. I figured ...
3
votes
2answers
7k views

a simple 2D rectangle collision algorithm that also determines which sides that the rectangles collide?

I initially tried out implementing rectangular intersection, which works well. However, when I have to apply the physics system, such as velocity, acceleration, and directional vectors, I would have ...
-1
votes
1answer
164 views

Find a Rectangle by coordinates - XNA

I have 2 coordinates (X,Y). I have also a 10x10 array. By these coordinates I have to find the rectangle in which is my pointer at the moment. How could I handle it?
-2
votes
2answers
193 views

C# XNA 4.0 Rectangle Rotation Collision

I can easily rotate my sprite, but how could I rotate my rectangle for my collision (Thinking of using the Separating Axis Theorem, But I have no clue how to apply it) Help or Example would be ...
4
votes
1answer
174 views

XNA4 - Trouble updating part of a Texture2D

I have a big Color[] ColorMap in memory (1280x720), and I have a Texture2D that I've uploaded this ColorMap to. I update parts of the in-memory ColorMap, and want to upload those changed parts to the ...
0
votes
2answers
3k views

Android Java rectangle collision detection not working

I had been hard coding a collision detection system which was buggy. Then I came across using rectangles for collsion detection. So I put it all in and it does not work, I put a log in and it never ...
3
votes
1answer
1k views

Create a rectangle struct to be rotated and have a .Intersects() function

In my XNA program, I am trying to swing a sword. The sword starts at an angle of 180 degrees, then rotates (clockwise) to an angle of 90 degrees. The Rectangle struct that XNA provides, Rectangle ...
6
votes
1answer
913 views

XNA Platformer Collision: PerPixel vs Rectangle

I'm writing a platformer engine with XNA and was wondering what method for handling collisions I should use. Would I be seeing some performance issues if I were to try and have PerPixel collisions? ...
5
votes
4answers
1k views

Find the closest point along a rectangle, given an another point and direction

Given a rectangle, and a point with a vector direction towards the rectangle. How can I find the closest point on the outside of that rectangle to the point in question?