Connect 4 Multiplayer App

klaw (@klaw)

11587

2

0

About This Space

This is a variation on the Connect 4 App that will enable multiplayer support.


Last updated on March 7, 2020

Forked from: /klaw/connect-4-app/

Public Permissions:   View   Open/Fork   Run   Comment  

Connect 4 Base

This is the base connect 4 module that is shipped with the Profound.js installation. However this time I am going to try to implement a sort of online multiplayer. The plan is that the game will be stored in a table, and the client side will make a webservice call to check if there is an updated game state and will submit the screen to retrieve the update.

I will implement a system where the players must log in with a valid noderun account, and the first 2 validated users will be placed into the game and any additional users will be told the game is full. I may implement a polling webservice that will replace users into the game as players leave the game. I will also need to implement a system that will remove players from the game when their client stops reporting polling webservice requests.

The next steps for improvement would be to make a chat box, or a lobby where users can browse for games.

Notes:

To retrieve the user ID I should use pjs.getUser();

To store the games I can use the JSON data type in the table to store a JSON object that contains the complete game state, including all players at that game.

The table would only need an ID (which can be any text value it does not need to be a number) and the JSON field.

I can make a hard coded mod list and some mod commands, like clear all games which would be typed directly as the table name

Comments

Write Preview Markdown: bold italic code link
Post
12

4 years ago

Where do you find the room name?

4 years ago

The room name would be chosen by the players. So if you had a friend you wanted to play with you would decide upon a room name together, and would type the name into the room selection screen.

More Spaces By klaw (@klaw)

Filters:

Popular Recent

Have some fun with this Connect 4 application!

11378

1

8

Expanded version of the Grid template to add additional paging buttons and modify how the data is supplied to the Grid widget.

10561

0

3

A Rich Display File application that stored the focus in a hidden field and uses that field to apply focus when the screen is re-drawn.

8627

0

2

This app consumes a web service and display the information in a grid

7726

0

0

This app consumes a web service and display the information in a grid

7629

0

0

This interactive app prompts the user for key fields to lookup a database record and displays the results

7549

0

0

This interactive app prompts the user for key fields to lookup a database record and displays the results

7529

0

0

A simple Rich Display app that shows how to focus a widget via JavaScript

7310

0

0

This interactive app prompts the user for key fields to lookup a database record and displays the results

7199

0

0

This app consumes a web service and display the information in a grid

7176

0

0

This is a full database maintenance CRUD application with view, change, add, and delete capabilities

7027

0

0

This is a full database maintenance CRUD application with view, change, add, and delete capabilities

6932

0

0