0
votes
0answers
29 views

Collision detection bug in java applet [closed]

In my maze game applet I'm having a little bug. Collision detection works but sometimes my character can go into walls. More precisely it detects collision and moves the character into the wall. It ...
0
votes
1answer
50 views

Collision bug with gravity in slick2D

I have fixed some of the previous problem. The collision when running into a corner(a wall on two sides) however is still not working. When the player runs into a corner he just falls down and out of ...
0
votes
1answer
51 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
1
vote
3answers
187 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
0
votes
0answers
62 views

Ray-Triangle Intersection Detection using Barycentric Coordinates

I am attempting to convert the algorithm from http://www.cbloom.com/3d/techdocs/fast_ray_tri.txt to java code, but my solution does not function correctly. The only intentional change I made was for ...
0
votes
2answers
134 views

How do i make collision detection more effective?

In the game i am developing, there are 220 circles that are not moving. One of the circles is moving and in every update, it iterates through an ArrayList that contains all the circles and check if it ...
2
votes
1answer
205 views

How do I efficiently collide and match groups of coloured circles?

I am new to game programming and working on clone of this game in libgdx. The game has some static balls and one ball that moves. I want to check if the moving ball collides with any static ones, but ...
1
vote
1answer
95 views

Collision between player and heightmap

Im programming a small project, an opengl height map. It is build of triangles, which points are fit to the right y position (read out of an image). The player is represanted by a cuboid. (p1, p2, ...
0
votes
2answers
297 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
2
votes
1answer
136 views

libgdx collision detection / bounding the object

i am trying to get collision detection so i am drawing a red rectangle to see if it is working, and when i do the code below in the update method. to check if it is going to work. the position is not ...
0
votes
3answers
238 views

How to optimize collision detection

I am developing a 2D Java Game with LibGDX. This is what it kinda looks like (simplified): The big black circle is the player, which you can move by tilting the smartphone. The red circles and blue ...
0
votes
1answer
84 views

Collision intermittently fails when multiple bullets on screen

I'm building a very simple Java game where a player rectangle fires bullet rectangles at enemy rectangles. When a single bullet is on screen, it always correctly collides with enemies. When multiple ...
0
votes
2answers
215 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 ...
1
vote
0answers
62 views

java slick2d - gettileproperty returns true when it shouldn't

I'm trying to implement some collision detection to a test game i've been making. I've used TiledMap to create the map and set a property on one of the tiles to blocked=true This tile is then drawn on ...
0
votes
1answer
63 views

JBox2D bodies don't collide?

I have two objects. A dynamic player and a static ground object. It was working for a while until I did some refactoring and suddenly my play falls right through my ground object. Is there anything ...
1
vote
1answer
73 views

Preventing rapid inversions of boolean on Collision detection

I know this is both a strange question and a stupid question. But this is an issue I have dealt with in every single game I've made, and I have yet but to find a solution. I can't be the only one ...
2
votes
1answer
37 views

Saving resource

I'm trying to develope a simple platformer on Java, I was wondering if is it better to handle the collissions in a level (player with floor, player with enemy ecc...) by a level handler class which ...
0
votes
1answer
79 views

JBullet - Detecting when 2 objects collide?

How can I detect when 2 collision objects collide with JBullet? Currently, all body types are going to be of type RigidBody. I have quite literally been trying to find the answer of this for over 2 ...
0
votes
1answer
94 views

Java Game Gravity Collision Detection Working Incorrectly

I have searched for this question but was unable to turn up any results - I am making a Java platform game (I have created many top-down games, but nothing with gravity like a platformer) and I have ...
1
vote
1answer
128 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...
0
votes
1answer
327 views

How do I handle collision response between many different types of game objects?

I am looking for a way to avoid the dreaded switch or if/else scenarios between numerous game object types when a collision takes place in a game. For example: You have a list of game objects which ...
0
votes
1answer
230 views

Top-down player collision with walls

I am having trouble trying to think of how I am going to approach collisions in my game. My idea which sucked in the beginning because it would reduce performance dramatically has failed which was ...
1
vote
1answer
138 views

Pixel Perfect collision detection on rotated bitmaps [duplicate]

I have two bitmaps which are being drawn onto a canvas using a matrix canvas.drawBitmap(bitmap, matrix, paint); first to work out if I need to check for a collision i am using eucilidean vectors ...
2
votes
3answers
924 views

libgdx - collision detection with tiled map java

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to ...
1
vote
1answer
100 views

How to make platforms spawn without touching other platforms

So I am making a doodle jump like game where there are platforms scrolling by but right now how I have platforms spawning is completely random. I would like the platforms to be spread apart so they ...
0
votes
0answers
122 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, ...
0
votes
1answer
121 views

Strange collision in Breakout [closed]

My Breakout game works fine so far, but I struggle with the collision detection... Well... just with the collision from the ball with the brick... Here's the relevant code: List<Brick> ...
2
votes
1answer
414 views

Libgdx - Collision position - Box2D

I'm actually developping my own game but i'm facing a little problem. I trying to figured out how to get the position of a fixture (collision) between two entities. For example this : ...
-1
votes
1answer
193 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 ...
1
vote
0answers
60 views

Does anyone know a good knockback algorithm? [closed]

I was just wondering if someone had a good knock back algorithm for a top down shooter game. I was hoping for not as much as a knock back but more of a push. that would be great.
-1
votes
2answers
117 views

Java Tilemap Collision

I have tilemaps represented by values from 0 to 4. How can I make the player collide with tiles represented by 3 and stop the player from passing through it ? Here is my code for the player and ...
2
votes
1answer
221 views

Collision detection in libgdx

I am currently writing a little zelda like game and have a little bit of a problem with collision detection. It works but the the character stands to far away from the object. Here is my player ...
0
votes
2answers
187 views

How to get surrounding tiles in a tile array

I've created a tiled map that holds two layers, one for the tile type, and the other for whether it is solid or not. I plan on creating very big maps, and checking every tile seems like it would slow ...
0
votes
1answer
201 views

2D Tiled Map - Small tiles or big tiles with pixel-precise movement

I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ...
0
votes
1answer
101 views

Passing through edges of AABB collision

When I move, I grab the tile in front of the player, but when the player is colliding between two tiles, I grab the wrong tile due to rounding error. I made a video explaining what I mean. As you can ...
0
votes
1answer
206 views

AABB collision detection not detecting in some cases

I'm using simple AABBs in a tile based world, and for some reason the algorithm does not detect collisions when moving towards the left and then down. I actually upload a video to YouTube to ...
0
votes
1answer
187 views

Circle-Rectangle collision velocity adjustment

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 ...
0
votes
1answer
288 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 ...
0
votes
1answer
171 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 ...
2
votes
1answer
242 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 ...
0
votes
0answers
34 views

2D collision beetween a sprite and an array of sprites [duplicate]

I am creating a simple Android jumper (think Doodle Jump or Abduction) using libGDX so I can get started in game programming. My problem is that I need to figure out a way to check for collision ...
0
votes
1answer
340 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 ...
2
votes
1answer
157 views

JBox2D Polygon Collisions Acting Strange

I have been playing around with JBox2D and Slick2D and made a little demo with a ground object, a box object, and two different polygons. The problem I am facing is that the collision-detection for ...
0
votes
1answer
155 views

LWJGL Java 2D collision when lagging

I'm using a tile based collision, but when the game is lagging (the lag isn't the problem) the collision fails and the player falls through tiles. This is the movement/collision detection code of my ...
3
votes
1answer
364 views

How do I detect a tile map collision's direction? [duplicate]

I'm implementing collision detection with the map for my platformer. I have a method that generates a polygon on every tile and checks if the player hits it -- that's all fine. The problem is that ...
0
votes
2answers
2k views

Java collision detection with rectangles

I'm trying to get the collision between two squares. I've made a Rectangle object that overlays each one and updates the position every tick. Then I made a collision method that checks whether they ...
0
votes
0answers
228 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 ...
0
votes
1answer
306 views

Having to check collisions twice per game tic

I have vertically moving elevators (3 solid tiles wide) and static solid tiles. Each are separate entities and therefore have their own respective collision routines (to check for, and resolve, ...
1
vote
1answer
831 views

Moving bounding box in 3D using Libgdx

How do i go about moving a bounding box in libgdx? I want to make the bounding box capture my character and move with him. So ideally i want to be able to copy my vector 3 from my model instance and ...
1
vote
2answers
724 views

How to check for cube collisions?

I want a method, which takes two "ObjectBox" objects (A "ObjectBox" has .getX() .getY() .getZ() .getSizeX() .getSizeY() .getSizeZ() methods) as a parameter and return true if the two Boxes are ...