You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Charles Hollingsworth b1342a8d72 Created README file 2 years ago
public It works, mostly! 3 years ago
.gitignore Removed accidentally added files, added .gitignore 3 years ago
README.md Created README file 2 years ago
index.js First attempt at getting cross-player communication working 3 years ago
package.json Added start script 2 years ago

README.md

2squares

Simple JavaScript two-player “game” to hone my WebSockets and interact.js skills

This is a simple node.js “game” that I wrote in order to familiarize myself with WebSockets programming in node.js, as well as the interact.js framework for draggable user interfaces. It is a “game” in a very loose sense that Wittgenstein would probably barely acknowledge as the weird distant cousin in the family resemblance referred to by the word. The first person to navigate to the URL (localhost:8080 by default) automatically becomes Player 1, and the second becomes Player 2. Each player can only manipulate their own square, and each should see the other player’s square move in something vaguely resembling real time.

That’s it. There’s no gameplay, no scoring, just the very basics of a two-player gamelike application. It would probably not be too difficult to take this as a starting point and progress to a simple Pong-like game. There are also multiple issues: different screen sizes aren’t really accounted for, so if one player is on a computer and the other is on a phone, each may see the other player’s square move in unusual ways. There’s no attempt to account for network failure; once you’re disconnected, that’s it. The only way to reset the game is to restart the node application. I wasn’t going for polished; I just wanted to learn the basics. Nevertheless, I think I succeeded, and I feel comfortable moving from here to more serious multi-person interactive web applications.