Hacker News new | ask | show | jobs
by ArtWomb 2181 days ago
Nice! I think you could do a port of the classic Milton Bradley board game "You sunk my Battleship!" with this ;)

https://en.wikipedia.org/wiki/Battleship_(game)

2 comments

Interesting that you say this. I am thinking of running a python course online, and have programmed a 200-line battleship game with TkInter, since I think it is game that is engaging even when you play against a fairly straightforward computer adversary. I had a lot of fun playing my own game, even when programming it was so simple.
This framework is based on a game loop that runs an update on each frame which is more intended for real-time controls. I think a turn-based game like battleship is a different paradigm.
You always have to update every frame -- UI, sounds, animations, etc -- the question is whether you update your game simulation every frame. But really, you don't want to link your simulation-updates to your frame updates anyways, real time or not, because then you get weird behaviors like different framerates producing different physics (I believe it was quake that famously let's you jump further if your framerate is higher).
afaik pretty much all games work like that on a deep level? And it's an industry standard for game engines to expose their interface in that way.

Anyway, it's in the README:

""24a2 can also run a function [...] when a dot is clicked on.""

So it would be pretty easy to make that.