01-26-2021, 04:48 PM
(This post was last modified: 01-27-2021, 07:40 AM by slimy_asparagus.)
I have made the most progress implementing Battleship with large pieces. I attach a .lud file. In principle this seems a really straightforward approach. However I am facing a number of issues.
1. The look of the pieces is not functional.
2. Depending on the graphics metadata the hiddenness may be broken.
3. I can't seem to get the "shooting" phase to work as I expect. This issue apparently has nothing to do with large pieces.
The attached file replaces the "tile" implementation with simple "piece" definitions as I think that is most illustrative.
So the five ship types are all 1 square large whereas they should be 5,4,3,3,2 respectively.
For 1. I think it would be best if a ship looked like a number of squares in a line with each square of the ship having the appropriate letter code on it. This is what I was trying to implement when I replace (piece...) with the commented out (tile ...) definitions.
Also with the proposed graphics metadata and (tile....) piece definitions the hiddenness is broken.
I have no idea why the shooting phase is not working. The idea was that
a.) The player would select a hidden square occupied by an opponent's piece.
b.) That square would be unhidden.
c.) Some sort of marker would be placed. (I would probably like to be a little bit more sophisticated than a Dot, but it would do for now.)
EDIT: The attachment was missing. Fixed.
If this is too much to answer, then please could we focus on the first two questions (which are clearly linked). Once that is fixed I could produce a more narrowly focussed test case for the last part.
Afterthought: Is the problem with the shooting phase because I forgot to add a stacking parameter set to true?
1. The look of the pieces is not functional.
2. Depending on the graphics metadata the hiddenness may be broken.
3. I can't seem to get the "shooting" phase to work as I expect. This issue apparently has nothing to do with large pieces.
The attached file replaces the "tile" implementation with simple "piece" definitions as I think that is most illustrative.
So the five ship types are all 1 square large whereas they should be 5,4,3,3,2 respectively.
For 1. I think it would be best if a ship looked like a number of squares in a line with each square of the ship having the appropriate letter code on it. This is what I was trying to implement when I replace (piece...) with the commented out (tile ...) definitions.
Also with the proposed graphics metadata and (tile....) piece definitions the hiddenness is broken.
I have no idea why the shooting phase is not working. The idea was that
a.) The player would select a hidden square occupied by an opponent's piece.
b.) That square would be unhidden.
c.) Some sort of marker would be placed. (I would probably like to be a little bit more sophisticated than a Dot, but it would do for now.)
EDIT: The attachment was missing. Fixed.
If this is too much to answer, then please could we focus on the first two questions (which are clearly linked). Once that is fixed I could produce a more narrowly focussed test case for the last part.
Afterthought: Is the problem with the shooting phase because I forgot to add a stacking parameter set to true?