this post was submitted on 23 Dec 2023
8 points (100.0% liked)

programming

131 readers
12 users here now

  1. Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.

  2. Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.

  3. Be kind, keep struggle sessions focused on the topic of programming.

founded 8 months ago
MODERATORS
 

I have being wanting to experiment to recreate the game battleship as a website, I have already made some proyects with JSPs (Jakarta).

At first i thought of using htmx and go because i like the idea of building the interface in the backend, the thing is i'm a little stuck is server-client comunication, for example when the server notifies the client that it is their turn. I saw the concepts of server side events and i don't know if there is another way that i haven't thought.

Thank you for reading this

all 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 8 months ago

I have decided to try to do the project in Godot and in a future make it work through web assembly, I will use the tips for other projects i have in mind, than you all❤️

[–] [email protected] 1 points 8 months ago

I would attempt to avoid frameworks as much as possible early on. They abstract away what you're actually doing into simpler 'magic' shorthand.

As for your specific question, if it's an http api you're planning to use, fetch works well. I can't speak to websockets.

[–] [email protected] 1 points 8 months ago

I recommend doing front end only unless your goal is to learn full stack. Games are great when they're purely front end and it will be simpler to use only one language and one domain of knowledge.

If your goal is to learn full stack then I recommend using simple libraries/frameworks for both. For back end, a simple express server (if you prefer JavaScript) that will contain the game's state and make changes based on requests to its routes. For the front end, something very simple that doesn't get in the way of DOM manipulation. Like jQuery. If you want a simple theme as well, bootstrap can help you and it integrates with jQuery.