Skip to content

Commit

Permalink
fix: use bullet position to fire bullets
Browse files Browse the repository at this point in the history
didn't realize this wasn't even being used!

A bit problemmatic - standing too close to a wall means you can't fire
up :/
  • Loading branch information
russmatney committed May 30, 2024
1 parent e58dc1c commit a5803e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dino/players/romeo/SSRomeo.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ text = "[center]state"
scroll_active = false

[node name="BulletPosition" type="Marker2D" parent="."]
position = Vector2(8, -8)
position = Vector2(8, -12)

[node name="Jet" type="AnimatedSprite2D" parent="."]
visible = false
Expand Down
5 changes: 4 additions & 1 deletion src/dino/weapons/bow/Bow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func fire_arrow():
aim_vector = Vector2.RIGHT

var arrow = arrow_scene.instantiate()
arrow.position = global_position
var pos = global_position
if actor and actor.bullet_position:
pos = actor.bullet_position.global_position
arrow.position = pos
arrow.add_collision_exception_with(actor)

U.add_child_to_level(self, arrow)
Expand Down
5 changes: 4 additions & 1 deletion src/dino/weapons/gun/Gun.gd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func fire_bullet():
aim_vector = Vector2.RIGHT

var bullet = bullet_scene.instantiate()
bullet.position = global_position
var pos = global_position
if actor and actor.bullet_position:
pos = actor.bullet_position.global_position
bullet.position = pos
bullet.add_collision_exception_with(actor)

U.add_child_to_level(self, bullet)
Expand Down

0 comments on commit a5803e5

Please sign in to comment.