Questions tagged [collision]

The intersection of one or more objects or concepts, such as communications packets or function names. For questions about collision detection (in computer graphics) use the [collision-detection] tag instead.

May be used to describe graphical elements (as in a game setting), networking (when multiple packets arrive at the same location simultaneously), RF communication when transmissions overlap and interrupt one another or in programming when disparate functions have similar naming conventions (see also namespace).

For questions about collision detection (in computer graphics) use instead.


Related tags

3094 questions
0
votes
1 answer

Collisions in processing

My game is a shooting game for school. I need help on the collision between my bullet and my enemy. I have placed the bullet class with my player but for some reason it keeps on passing through it and not disappearing. The first example below shows…
Cuptius
  • 11
  • 2
0
votes
1 answer

Stop building momentum when running into a wall. (2D Top-Down)

So my movement isn't instant. You accelerate and decelerate. I use two floats starting at 0, going to 1, to calculate my movement speed. Here it is: private void Update() { float moveTowardsX = 0; float moveTowardsY = 0; // Adjust…
0
votes
0 answers

How can I add methods to floats and integers?

I am trying to make a game that has collision in python (not pygame) I need to add the width of a turtle to the xcor of another. But the xcor of the other turtle is classified as a method. This prevents me of doing what i need to do. I tried the…
0
votes
0 answers

Collision blocks not rendering on tilemap

First off, sorry if this is a basic question as I am still pretty new to the Javascript language. I used the 'Tiled' software to develop a Tilemap for a scrolling 2D platformer (this was done following a tutorial). In the tutorial, the collision…
0
votes
0 answers

How to detect collision?

I’m doing a maze where I need to detect a collisions of the balloon and the walls.The maze is created in tkinter. I created the walls with c.create_line. And I have no idea how to write the code for the collision since I have 70 walls. I’ve tried…
Alea
  • 1
0
votes
0 answers

How to fix the bug in rectangle-circle collision detection?

I've a user controlled rectangle div and a circle div which when met need to bounce away. I've used the below logic to achieve it, where x and y are the positions and w and h are the width and height: function collisionDetection(rect, circle) { //a…
Nikhat
  • 41
  • 9
0
votes
1 answer

How to get the location of the point where 2 objects collided in 2D UNITY

I am making a game in unity where you launch a ball into enemies and on collision they get damaged. I want to add a particle effect at the point where the 2 objects collide but I cant figure out how to get the location. Here is the collision script…
Flimzy
  • 11
  • 2
0
votes
0 answers

Unity enemy alert, Move object outside of the screen to screen boundary, Axis collision

image sample I'm making a game with enemy alert feature. My problem is how to know the collision point to axis or screen boundary which will be the position I have to put the enemy indicator. Note: Using only Vector2 or manual mathematical formula…
0
votes
0 answers

Snapping Objects to hit boxes after an intersection in java

I'm working on a game for a game jam, and can't get my collision system to work. The way it's supposed to work is when an the player intersects with a wall hitbox it moves the player towards the last position until it no longer intersects. This…
0
votes
2 answers

Stopping player's movement upon clicking dialogue - Unity

I have a problem where when I click the dialogue while passing through an NPC or while moving, the character will continue moving in the direction of the joystick before it is set active to false. I have tried setting the horizontal and vertical…
0
votes
0 answers

I want to get the right collision whenever my player touches the box

import pygame from sys import exit import random pygame.init() WIDTH, HEIGHT = 800, 400 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("My game!") fps = pygame.time.Clock() active = True test_font =…
0
votes
1 answer

How can I make my player stop when he hits the floor

I am working on a google chrome dinosaur chrome clone using an SDL template and I have an issue where the character is not stopping once he hits the floor. My code logic is supposed to work like this, I have a bool called "onFloor" that tells the…
0
votes
2 answers

How to make falling object hit certain object in Java Processing

How do you get a certain object to hit another object? I am making a game where trash is falling from the sky, you are meant to drag and drop the trash into the correct bins. How do I make it so when you drag it into the regional area of the bin is,…
Eiken
  • 3
  • 2
0
votes
0 answers

It is impossible to implement accurate collisions in 3D SpriteRenderers? Is Billboard incompatible with rigidbodies?

I've been having difficulty implementing enemies with a billboarding system for a while: For a new project I'm reusing some animated sprites from an old static camera shooter game I made. It consisted of shooting projectiles and hitting enemies…
0
votes
2 answers

Collision response between two 2d circles

I am trying to write a sim in which two circles will collide and then bounce apart in an elastic collision. Each circle has a position, velocity, mass, and radius. I already have the collision detection worked out, but I do not know how to ensure…
Matt
  • 1
  • 1