Implement traps system: add Trap, Landmine, and EventHorizon classes with collision detection and interaction logic; integrate trap handling in the game scene and enemy AI.
This commit is contained in:
@@ -26,7 +26,7 @@ class WeaponHandler
|
||||
weapon.attack(direction)
|
||||
elsif Gosu.button_down?(Gosu::MS_LEFT)
|
||||
player_x, player_y = $bus.get(:player_position)
|
||||
mouse_x, mouse_y = $bus.get(:mouse_position)
|
||||
mouse_x, mouse_y = $bus.get(:mouse_pos)
|
||||
direction = Math.atan2(mouse_y - player_y, mouse_x - player_x)
|
||||
weapon.attack(direction)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user