Git Product home page Git Product logo

rock-paper-scissors's People

Contributors

moltzaum avatar

Watchers

 avatar

rock-paper-scissors's Issues

Add README.md

It would be nice to document basic implementation, usage, or motivation in making this project.

Add more to the game scene?

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.

Make the window resizeable

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.

Activate buttons on release instead of on press

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

Make a scene manager?

Just to avoid using global variables. Every scene should have access to every other scene.

End active match for opposing player and address memory leaks

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.

Share the result with family and friends

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.

Project Summary

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.

bug: fast clicking results in button press not being drawn

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.

Give the client the ability to reconnect to a match if the client is closed

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.