Short range scan error in Trk21
An odd Using key …
appears every time a short-range scan is performed:
Using key: [8, 4]
---------------
. . . . . . . .
. . . . . . . .
. . . . . . . *
. . . . . . . .
. . . . . . . .
* . . . . . . .
. * . . . . . .
. E . . . . . .
---------------
STARDATE: 3600 CONDITION: YELLOW
QUADRANT: 4 - 8 SECTOR: 2 - 8
ENERGY: 3000 PHOTON TORPEDOS: 10
KLINGONS: 23
Logged as issue #2.
This is a simple fix, a debugging statement left at line 38 in Galaxy.groovy needed to be removed.
33 final int getAt(
final Coords2d keyCoords) {
35 assert keyCoords != null && board != null && keyCoords.isValid()
36 final ArrayList key = [ keyCoords.first(), keyCoords.last() ]
38 println "Using key: $key"
Weapons fire
It's not much of a war game if you can't shoot the enemy.
Enhancement: Phaser fire
Logged as enhancement issue #3.
Firing a phaser should:
- Reduce the target's available energy by the hit amount.
- Remove the target from the game if it's energy <= 0.
- Inform the user of the weapon's effectiveness.
- Tell the user they've won the game when the last target is destroyed.
Note: Some of these items may be deferred until torpedo firing is implemented, or moved into their own enhancement.
Enhancement: Torpedo fire
Logged as enhancement issue #4.
Firing a torpedo should:
- Display a track until either:
- it hits the target, or
- it leaves the sector.
- Remove the target from the game if the torpedo hits it, where a target can be any game object, i.e.
- An enemy ship.
- A star base.
- A star.
- Tell the user they've won the game when the last target is destroyed.
Note: Some of these items may be implemented as part of issue #3.
19-FEB-2019 👈
Top of page
👉 23-FEB-2019
© 2020 Terry Ebdon.
Find me coding on GitHub, networking on LinkedIn, answering questions on
Stack Exchange and hanging out on
twitter.