simpja / Breakout-Phaser

Breakout game using the phaser game library for things like physics and collision detection.
https://pong-ping.vercel.app
1 stars 0 forks source link

Breakout-Phaser

What is it?

Using a local webserver you can easily create an instance of the classic ping pong game and use other devices as controllers!

How do you do it?

How does it work?

A node.js script (server.js) uses the express library to create a local web server from your machine.
Websites created on this server will be available for devices on the same Wi-Fi using the ip address of your unit on the network and the port defined in the server script.
Using socket.io, web socket connections are created between clients using the website hosted from the server, and the server itself.
These sockets are created so that designated controller sub-pages on the website will emit events through the socket connection if the value of a slider is changed.
The server takes these values and updates the player objects on the game screen through another socket.