Skip to content

Commit 3f4e758

Browse files
committed
simulation: return target object and not its position
1 parent 68c73ce commit 3f4e758

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/hyperspace/library/simulation.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@
6060
player (circle-X-any-circle bullet players)]
6161
(cond
6262
(> counter max-cycle) [world nil]
63-
planet [world (:position planet)]
64-
player [(kill-player world player) (:position player)]
63+
planet [world planet]
64+
player [(kill-player world player) player]
6565
:else (recur bullet (+ counter 1)))))))

test/hyperspace/test/library/simulation.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(ns hyperspace.test.library.sumulation
1+
(ns hyperspace.test.library.simulation
22
(:use [hyperspace.library.simulation]
33
[hyperspace.test.checkers]
44
[midje.sweet])
@@ -51,6 +51,6 @@
5151
result-player2 (assoc player2-fixture :status :dead)
5252
result-world (assoc two-player-world-fixture :players [player-fixture result-player2])]
5353
(fire two-player-world-fixture player-fixture heading 10)
54-
=> [result-world (:position player2-fixture)])
54+
=> [result-world player2-fixture])
5555
;; TODO: test shot to planet
5656
(fire world-fixture player-fixture 0 10) => [world-fixture nil])

0 commit comments

Comments
 (0)