Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gameloop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ BEGIN TRANSACTION;
UPDATE mobs SET x = x + cos(dir) * 0.5, y = y + sin(dir) * 0.5 WHERE kind = 'bullet';

-- Delete bullets that are out of bounds
DELETE FROM mobs WHERE x < 0 OR x >= (select max(x) from map) OR y < 0 OR y >= (select max(y) from map) AND kind = 'bullet';
DELETE FROM mobs WHERE (x < 0 OR x >= (select max(x) from map) OR y < 0 OR y >= (select max(y) from map)) AND kind = 'bullet';

-- Delete bullets that hit walls
DELETE FROM mobs b WHERE EXISTS (SELECT 1 FROM map m WHERE m.x = CAST(b.x AS INT) AND m.y = CAST(b.y AS INT) AND m.tile = '#') AND kind = 'bullet';
Expand Down