Re: Earwax
@149
You mean you want get_tile to raise an error if negative coordinates are passed? I can certainly do that, if that's what you want. Shouldn't you be checking for that in your own code though?
@148
I feel like this could be better achieved by subclassing:
class MyLevel(Level):
self.state = 'stationary'
def __attrs_post_init__(self) -> None:
self.action(...)(self.forwards)
self.action(...)(self.backwards)
def forwards(self) -> None: if self.state == 'backwards': # Complain def backwards(self) -> None: if self.state == 'forwards': # Complain
@147
Honestly, I'm glad you're using the game board class. I wrote it for Lucky 13, then never touched it since. You write as many board games as you like!
So without GameBoard.populated_points, how else would you drag out a list of all the tiles?
I mean, say you were writing something like snakes and ladders, wouldn't it make sense to generate your board, then do something like:
for x in range(num_snakes):
snake_start_index: int = randint(1, len(board.populated_points) - 1)
snake_end_index: int = randint(0, snake_start_index)
generate_snake(board.get_tile(board.populated_points[snake_start_index]), board.get_tile(board.populated_points[snake_end_index]))
...
Why would you need to update the tile and the point? You shouldn't be touching points. They are just there so you've got a record of what points have been generated by GameBoard.populate.
In the strange case of the double call to populate, honestly I just did what worked at the time.
It sounds like you've got much more experience with board games than I do, so I'm happy to listen to any and all suggestions you can throw at me.
Would it make sense to only call populate when the level is pushed? I initially thought the tiles should be cleared when the level is popped, but that's a terrible idea, because you might want the ability to go back to that board the way it was when it was last left. If you've got mini games or whatever.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector