Week3 Live Planet
Assignments: Improve on the example, send a different type of event to the server and to the clients. This could be a collaborative drawing program or a means to control other people’s experience.
This project is a collaboration with Stacy.
Idea
We were having this idea of adding spaces to an online chat room. One way is to make a planet that people can ‘walk’ on. You can either get into groups or find a quiet corner. It’s also very cool to call your friends and say something like ‘Hey! I’m at 55°‘.
How it work
When a person makes any actions (including get into this website), everyone will receive this actions and excute it.
Here’s are all the socket listeners on client:
- Login: first connect to server and receive all existing people.
- Join: add the new joining people.
- Move: receiving other people’s movement.
- Chat: receiving chat messages.
- Quit: somebody exit the planet.
Result
Seems pretty good.
-
Try it on Glitch: https://live-planet.glitch.me/
-
Source Code: https://github.com/jasongao97/live-web/tree/master/week3
Attribution
- Animal Pictures are from https://www.kenney.nl/assets/animal-pac
- Planet is designed by Freepik