Tagged Questions
0
votes
1answer
48 views
SFX Played Once per Collision or Hit
I have a question about using Box2D (engine for LibGDX used to make realistic physics). I observed on the code that I've made for the physics here below:
@Override
public boolean touchUp(int screenX, ...
1
vote
2answers
152 views
Collision checking problem on a Tiled map
I'm working on a pacman styled dungeon crawler, using the free oryx sprites. I've created the map using Tiled, separating the floor, walls and treasure in three different layers. After importing the ...
4
votes
4answers
368 views
Point of contact of 2 OBBs?
I'm working on the physics for my GTA2-like game so I can learn more about game physics.
The collision detection and resolution are working great.
I'm now just unsure how to compute the point of ...
3
votes
3answers
91 views
How to choose cell to put entity in in an uniform grid used for broad phase collision detection?
I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes.
Regarding the ...
3
votes
1answer
57 views
Moving the jBullet collision body to with the player object
I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a ...
3
votes
1answer
322 views
How a “Collision System” should be implemented?
My game is written using a entity system approach using Artemis Framework. Right know my collision detection is called from the Movement System but i'm wondering if it's a proper way to do collision ...
0
votes
2answers
87 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 ...
0
votes
1answer
90 views
Platform game collisions with Block
I am trying to create a platform game and doing wrong collision detection with the blocks.
Here's my code
// Variables
GTimer jump = new GTimer(1000);
boolean onground = true;
// The update method
...
1
vote
1answer
82 views
Fixing a collision detection bug in Slick2D
My game has a bug with collision detection.
If you go against the wall and tap forward/back sometimes the game thinks the speed you travelled at is 0 and the game doesn't know how to get you out of ...
0
votes
1answer
110 views
jBullet Collision/Physics not working as expected
Below is the code for one of my objects in the game I am creating (yes although this is a cube, I am not making anything remotely like MineCraft), and my issue is I while the cube will display and is ...
1
vote
5answers
343 views
Error in my Separating Axis Theorem collision code
EDIT 2: Made some more alterations, now the one area i'm still confused on is: how to work out the vector to project on the separation axes? My projectOnto(..) method has some huge gaps now and i know ...
0
votes
1answer
302 views
Making an efficient collision detection system
I'm very new to game development (just started 3 months ago) and I'm learning through creating a game engine. It's located here. In terms of collision, I know only brute-force detection, in which ...
1
vote
1answer
149 views
Color based collision detection
I am making a game where you fly a ship around some randomly generated planets. Since I am using a for loop to draw over 5000 planets, using the rectangle class or an oval-type class for this is not ...
0
votes
0answers
66 views
Platformer Collision Error [closed]
I am currently working on a relatively simple platform game that has an odd bug.You start the game by falling onto the ground (you spawn a few blocks above the ground), but when you land your feet get ...
0
votes
2answers
113 views
Circle physics and collision using vectors
This is a problem I've been having, When making a set number of filled circles at random locations on a JPanel and applying a gravity (a negative change in the y), each of the circles collide. I want ...
2
votes
3answers
155 views
OpenGL Get Rotated X and Y of quad
I am developing a game in 2D using LWJGL library.
So far I have a rotating box. I have done basic Rectangle collision, but it doesn't work for rotated rectangles.
Does OpenGL have a function that ...
3
votes
1answer
330 views
Circle-Rectangle collision in a tile map game
I am making a 2D tile map based putt-putt game.
I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
1
vote
1answer
245 views
Java 2D Tile Collision
I have been working on a way to do collision detection forever, and just can't figure it out. Here's my simple 2D array:
for (int x = 0; x < 16; x++) {
for (int y = 0; y < 16; y++) {
...
0
votes
2answers
265 views
Collision between sprites in game programming?
I've since just started coding for an android game using eclipse. I've read Beginning Android Game Programming and various other e-books. Recently, I've encountered a problem with collision between ...
0
votes
2answers
71 views
sprite animation system height recalculating has some issues
Basically, the way it works is that it update the frame to show every let's say 24 ticks and every time the frame update, it recalculates the height and width of the new sprite to render so that my ...
2
votes
1answer
152 views
Colored Collision Detection
Several years ago, i made a fast collision detection for 2D, it was just checking a bullets front-pixel's color to check if it were to hit something. Lets say the target rgb color is (124,200,255) ...
0
votes
1answer
113 views
Gravity stops when side-collision detected [closed]
Please, look at this GIF:
The label on the animation says "Move button is pressed, then released". And you can see when it's pressed (and player's getCenterY() is above wall getCenterY()), gravity ...
0
votes
0answers
137 views
Java Collision Detection of a Slope using a Gradient
Im testing out collision detection for a game, The ball is traveling and i need to know when the ball hits a sloped line.
For this example i have used the whole screen, with a sloped line going from ...
1
vote
1answer
118 views
Game Engine Collision Handler
I'm making a collision handler for a Java game engine. I made an interface called Collidable. I have a method called onCollision which takes the parameter of my Engine Game Object.
public void ...
1
vote
2answers
269 views
Java: Tile-based Collision Detection with Rectangles
There are a few tile-based collision detection questions out there, but none seemed to suit my need.
I guess I really would like to know why this method for collision detection isn't working.
It ...
0
votes
1answer
254 views
Android Touch Event Collision Detection
I'm relatively new to both Java and Android, so hopefully the problem I'm having is stemming from something pretty minor that I've overlooked.
I've got a (very early stage) game that I've started ...
-1
votes
2answers
144 views
Collision detection not working properly
I have some problems with collisions, the collision detection only works either on one x "line", or on one y "line".
Example
Heres the collision code:
public void checkCollision() {
for (int i ...
0
votes
2answers
193 views
How can I improve this collision detection logic?
I’m trying to make an android game and I’m having a bit of trouble getting the collision detection to work. It works sometimes but my conditions aren’t specific enough and my program gets it wrong. ...
0
votes
2answers
565 views
Breakout ball collision detection, bouncing against the walls
I'm currently trying to program a breakout game to distribute it as an example game for my own game engine. http://game-engine-for-java.googlecode.com/
But the problem here is that I can't get the ...
1
vote
5answers
446 views
Collision detection - player gets stuck in platform when jumping
So I'm having some problems with my collision detection with my platformer. Take the image below as an example.
When I'm running right I am unable to go through the platform, but when I hold my ...
0
votes
0answers
116 views
way to do if(x > x2) x = x2 with rotation?
Alright, so I got this walking code, and some collision detection, now the collision detection returns a Vector3f of the closest point on the triangle that the projected position is at (pos + move), ...
0
votes
1answer
110 views
Better way to go up/down slope based on yaw?
Alright, so I got a bit of movement code and I'm thinking I'm going to need to manually input when to go up/down a slope. All I got to work with is the slope's normal, and vector, and My current and ...
0
votes
2answers
145 views
Matrix loading problems with jbullet and lwjgl
The following code does not load the matrix correctly from jbullet.
//box is a RigidBody
Transform trans = new Transform();
trans = box.getMotionState().getWorldTransform(trans);
float[] matrix = new ...
2
votes
1answer
1k views
Java - 2d Array Tile Map Collision
How would I go about making certain tiles in my array collide with my player? Like say I want every number 2 in the array to collide. I am reading my array from a txt file if that matters and I am ...
3
votes
5answers
454 views
Should my game handle collisions in the Player object?
I'm making a 2D platform game. Right now I'm just working on making a very generic Player class. I'm wondering if it would be more efficient/better practice to have an ActionListener within the Player ...
2
votes
2answers
181 views
Snake game - collision detection causing new position of apple to be rendered multiple times
I have a collision method implemented through the use of slick2d. When ever the snake collides with the apple, it causes the apple to be rendered in multiple places before the snake moves further ...
1
vote
0answers
317 views
Problems with moving 2D circle/box collision detection
This is my first game ever and I'm a newbie in computer physics.
I've got this code for the collision detection and it works fine for BOTTOM and TOP collision.It miss the collision detection with the ...
0
votes
2answers
771 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 ...
4
votes
4answers
296 views
More efficient in range checking
I am going to use a specific example in my question, but overall it is pretty general. I use java and libgdx.
I have a ship that moves through space. In space there is debris that the ship can ...
-5
votes
4answers
991 views
How to implement a 2d collision detection for Android
I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below:
...
2
votes
1answer
201 views
improving speed of 2d ball collision
I am making a game which has many balls bouncing around the screen (around 200-300 balls in a small area). One thing I am trying to do is improve the performance of the collision detection and ...
1
vote
0answers
277 views
Collision Problems in Pacman Clone
I am working on a Pacman clone. I am using Java for the project. I have been having problems with collisions, and allowing the player to pass through objects. Note that the tile size (and player) is ...
1
vote
1answer
340 views
Polygon Collision Detection Android
I am starting to try and figure out polygon collision detection in my Android game. I am currently doing pixel level collision detection and it just seems to be too slow (though it works). I was ...
0
votes
2answers
229 views
Pong - Changing the Ball's Y location depending on where it hits the paddle
I'm making my first game in, Pong, and I'm trying to make the ball's Y increase or decrease, depending on where it impacts the paddle. After implementing the code below, the ball only goes down, but ...
1
vote
4answers
601 views
Which Side Was Hit?
I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
5
votes
2answers
1k views
How to handle pixel-perfect collision detection with rotation?
Does anyone have any ideas how to go about achieving rotational pixel-perfect collision detection with Bitmaps in Android? Or in general for that matter? I have pixel arrays currently but I don't know ...
3
votes
2answers
1k views
Breakout Collision: Detecting the side of collision
I am writing a breakout clone (my first game) and am totally stuck as to how I figure out which side of the brick was hit.
I have a collision detection method that looks like this:
...
0
votes
1answer
279 views
Java Tile Collision Detection not accurate enough
How can I make my isometric tile collision detection more accurate, I'm using the Rectangle class from java to detect collisions but because it's a rectangle it overlaps other rectangles which means ...
1
vote
2answers
376 views
Android pong clone, having trouble getting the paddle to stop at the screen edge
Well, I'm obviously very new to game dev and android. I've got a ball bouncing around (successfully detecting screen edge collision so that the bitmap stays within screen) and a paddle that the user ...
2
votes
1answer
456 views
How to move a 2d sprite to a target location while avoiding obstacles?
How can I get a 2d sprite to move to a position clicked on the screen, without bumping into other objects? I'm programming in java using the android API library
I have created a surface view and ...