moltzaum / rock-paper-scissors Goto Github PK
View Code? Open in Web Editor NEWPrototype for Game Networking
Prototype for Game Networking
It would be nice to document basic implementation, usage, or motivation in making this project.
The idea is to add something moderately interactive.
So, have text that says "Locked in!" and greys out the buttons, or have text that says "Opponent has locked in!"
Not sure if I really want to implement this. This is just a silly prototype for fun and these changes don't add anything of signficant value.
How to make the window resizeable: love.window.setMode(800, 600, { resizable = true, vsync = true })
Easy, right? Not so fast!
The window being resized should recalculate the layout and any objects with coordinates. Defining bounds on the window probably makes sense. What do other applications even do in this case? I've never tried to break it.
Reason 1: it would allow the basic button to actually use the "pressed" image.
Reason 2: if a user clicks without releasing and the game match is displayed, this might be somewhat jarring to experience
Just to avoid using global variables. Every scene should have access to every other scene.
If a client leaves, it's partner is left in the match still. Adding more communication signals seems appropriate.
client 1
MATCH_END [match_id] -> Server
client 2
MATCH_END <- Server
This appears to work well enough. This is an optimistic protocol where you assume messages reach. Even in the matchmaking protocol where I implement an ACK response, there is no timeout associated with it.
The conclusion for this project would require setting up a server, and working on game distribution next. I made a .app file for MacOSX, but it does not make sense to distrubte without the server set up.
It should be pretty easy to do this, even if the server I make is just temporary.
There appears to be a bug that randomly, and rarely, occurs at times where the server can't unpack a "rock paper scissors" game signal. As noted in the README, the application is not robustly tested over the network, but this applies to the application as a whole as well unfortunately.
I'm glad with the final result. The clicking is very satisfying and I have something that works. Working on this project makes me look forward to trying out Defold to compare.
When a button is pressed with a quick tap, a draw may not occur in-between the press and release, so the image is never updated.
Like below:
love.draw()
button:press()
button:release()
love.draw()
As far as I'm aware, there is no queue for drawing images. A potential solution is to write the button using love.update(dt)
logic, though I feel like this is more resource-intensive and would prefer a solution that keeps the love.mousepressed
and love.mousereleased
events.
Currently just print "you won!" or "you lost!" to the terminal.
The server has an internal match_id
value it uses to index matches between two clients. If the server sends the match ID to the client, the client can provide the match ID when restarting. Alternatively, the server can be made to look up the match based on the client's identity.
After a certain point of inactivity matches should expire. The client won't be able to reconnect in this case for obvoius reasons.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.