Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hats #46

Open
wants to merge 6 commits into
base: winter-show-2020
Choose a base branch
from
Open

Hats #46

wants to merge 6 commits into from

Conversation

augustluhrs
Copy link
Contributor

okay bit of a doozy with this one. right now it just works by sending a socket.emit to the server if the user presses h on the keyboard.

the big issue i ran into was i thought that the user was getting an update of client info on that regular 'userPositions' emit from server.js, but (as the name suggests), in index.js and yorb.js it only deals with the positions. So i had to rework where the clients object was getting updated in yorb.js and index.js, so that a new hat message would update existing users but also be there for when new users joined.

I can go back and see if there's a better way of doing this as most of it was bushwhacking until i got it to work, i'm sure i could redesign it now that i know more about it. i also wonder if we can just update all the relevant info from that one userPositions message (i.e. keep a global client list as opposed to unique otherclient lists per user), or if that would be too slow.

also i tried removing the extra commits and ended up making it worse haha... my bad, i'll figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant