# Catcaster TO DO Eli & Valentine Catcaster spel extra documentatie - 24fps: https://www.techsmith.com/blog/frame-rate-beginners-guide/ - disk heeft straal van 120 dus mocht de kat starten van het centrum van de disk en hij beweegt continu naar rechts/links, dan zal hij er na 5 sec afvallen aangezien fps = 24 & stapgrootte = 1 - TO DO TO DO • [CC1] When a controller selects “Play on single screen” or “Play on multi-screen” the CatCaster game starts on all the screens involved. • [CC2] When a controller scans a QR code of a screen in game mode it will join the running game (this could be a multi-screen game). • [CC3] When a controller joins a game it establishes WebRTC data channels to the screens involved. We use the websocket to the server as our signaling channel to set up the WebRTC connection. • [CC4] The cat is spawned at a random planet (of a random screen in multi-screen mode), similar to when a cat died and is re-spawned (see further). • [CC5] The id of the controller should be visible somewhere on or above the cat. • [CC6] Cats should be distinguishable, e.g., by different colors. • [CC7] When a screen starts the CatCaster game it generates between one and three planets. (To make it interesting a single screen game should probably generate three planets.) • [CC8] A planet is a disk of which the center is fixed but the distribution of weight/cats will make the disk tilt in that direction. • [CC9] Cats which do not try to move in a certain direction will slide. • [CC10] Cats which slide off a disk die and re-spawn on a random planet. (The player should be able to recognize its cat. To give the player more time this could be animated, and during this re-spawning period the cat cannot slide off its new planet.) • [CC11] The planets/disks can be very simply represented by an oval. • [CC12] The portals are situated where the straight lines from the center of the different disks connect to their neighbors (Voronoi). • [CC13] Portals can be simply marked by marking an arc on the disk. • [CC14] If a cat is close enough to a portal (on the edge of the disk) then shaking the controller in the direction of the other planet will cast the cat from one planet to the other. (The shaking does not necessarily need to be in the right direction.) • [CC15] There is a lot of choice in tuning parameters, these should all be in a separate configuration file (or at least in a designated place). • [CC16] A controller sends the orientation data directly to the screen where its cat is on using the WebRTC connection to the particular screen. • [CC17] A screen determines the positions of all the cats on that screen. • [CC18] If a cat switches screens then the old screen passes the cat onto the new screen and informs the controller to send data to the new screen. • [CC19] The WebRTC connection between the controller and the screens can be set into a UDP kind of mode by specifying dataChannelOptions = { ordered: false, maxRetransmit: 0 }. • [CC20] If necessary a timestamp/counter can be added to the packages such that the screen can ignore old packages must they arrive out of order. (The screen needs to store the previous value of the timestamp/counter to decide this. Do not compare the timestamp of the controller with the time of the screen.) • [CC21] We are assuming the number of screens and the number of controllers allows us to connect everything to everything. • [CC22] For debugging mode the CatCaster game should be playable on a single screen using the keyboard attached to the computer. This mode could e.g. by activated by pressing x after which a cat is spawned which can be controlled by the arrow keys and space bar. • [CC23] Construct a formula to take into account the weight of the cats and how your planet tilts. (Think of easy unit tests.) • [CC24] Construct a formula on how the sensor data from a controller is used to move a cat on a tilted planet. (Think of easy unit tests.) • [CC25] Construct a formula to detect if a cat is close enough to a portal.