## #StackBounty: #collision-detection #raycasting #voxels Intersection of thick line with a grid

### Bounty: 50

There is a popular paper, and numerous examples, on how to efficiently perform collision detection for a line with a grid. However, I’m drawing up blanks on how to do the same thing but with a line that has thickness.

In my game, I’m considering adding projectiles that are not infinitly thin (for example, a giant plasma ball launcher), and I need to figure out which cells along a grid that it collides with. Initially I thought it’d be as simple as just using the Minkowski Sum method of adding the width/height of the projectile to each cell of the grid, and then treating the projectile as infinity thin line along a bloated-overlapping-grid, but that doesn’t look like it’s going to work with the existing algorithm.

Are there any other papers/algorithms that describe how to accomplish this? Or is there a way to modify the existing algorithm to accomplish this? Or are there any tricks to implementing this indirectly?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!

## #StackBounty: #collision-detection #godot Godot 3.2 Bomb explosion doesn't affect player or npc

### Bounty: 50

I finished the Godot 2D game tutorial Dodge the Creeps, and i’m adding a few additional features to reinforce the things learned and make more interesting the base game.

Basically i added a Scene with a area2d as root node with a collisionShape2d,a 2 timers for the Bomb scene.

The bomb appears randomlly in the main scene, for a few seconds is supposed to be ticking and then explodes.

My problem is that neither the player or the creeps( the npc enemies) are being removed from the scene.
They don’t interact at all,

This is the code for the Bomb.tscn scene:

``````extends Node

# Area collison disabled until animation finishes
\$CollisionShape2D.disabled = true
# Bomb ticking animation
\$AnimatedSprite.animation = "bomb"
# Until BombTimer times out we change animation and activate collisionArea
\$BombTimer.start()

func _on_BombTimer_timeout():
# Change animation sprite
\$AnimatedSprite.animation = "explosion"
# Enable Collision area
\$CollisionShape2D.disabled = false
# Start timer to remove bomb object
\$RemoveTimer.start()

func _on_RemoveTimer_timeout():
queue_free()
``````

The code for the creep/mob when hit by the bomb:

``````func _on_Mob_body_shape_entered(body_id, body, body_shape, local_shape):
\$CollisionShape2D.set_deferred("disabled", true)
queue_free()
``````

The code for collision detection for the player when is hit:

``````func _on_Player_body_entered(body):
hide()  # Player disappears after being hit
emit_signal("hit")
\$CollisionShape2D.set_deferred("disabled", true)
``````

If the creep/mob touches the player the game is over, but if the bombs explodes nothing happens.
What i’m missing in the code?

Get this bounty!!!