Code Monkey home page Code Monkey logo

iks-nolik's Introduction

๐ŸŽฒ iks-nolik

Note

The multiplayer edition Tic-Tac-Toe game, made using Java SWING.

  • Sanjar Zayniev

๐Ÿ’ซ Client

Author: Sanjar Zayniev

Dependencies:

  • Java SWING
  • OpenJDK 17.0.8
  • OpenJDK Runtime Environment
  • OpenJDK 64-Bit Server VM
  • Assets like icons and sound effects

๐Ÿš€ How to Run?

Using terminal:

$ java src/Client.java

Important

You should configure your environment. There are many imports from internal modules, you should specify your classpath. Otherwise, it will not run properly. It is better to use some IDE which will do it for you.

๐Ÿ”“ Login Screen

Simple, minimalistic. It can handle exceptions:

โœ… Successful login:

Game frame

The game will not start until the opponent connects. X is the mark of the current player, Wait... status text sent by the server and sanjar is the name of the current user.

Note

The server should be started before the client.

Tip

You wanna play with your friend, and you are not in the same network? No problem, install ngrok or jprq, open tunnel. Change server host and port from Settings.java and enjoy! (Dragunov).

Server

Contributor: Abduaziz Ziyodov

Dependencies:

  • PostgreSQL (16)
  • OpenJDK 17.0.8
  • OpenJDK Runtime Environment
  • OpenJDK 64-Bit Server VM
  • PostgreSQL Driver For Java (*.jar file)
  • Java SWING

๐Ÿš€ How to Run?

Using terminal:

$ java src/Server.java

If Postgres driver does not exist on your Java classpath, you should specify it:

$ java -cp lib/postgresql-42.7.0.jar src/Server.java

TCP(not UDP) server is running on host localhost and port 2121:

Tip

Instead of running Client.java, you can use tools like netcat or telnet. But you will not have a beautiful GUI.

If a client connects:

Important

If the game ends, you need to restart both Server.java and Client.java.

Note

Server will control the entire game, GUI should handle and represent it. There are several types of server-side events to control the game:

  • wait - blocks client interaction with GUI.
  • your_move - unblocks a client.
  • your_mark - after successful login, the server will send the client's mark (X or O).
  • opponent_moved - event for synchronizing current players board with opponent's.
  • valid_move and invalid_move - status of last move.
  • victory and defeat - each of the clients will get their own (e.g. if (1) gets victory, (2) should get defeat).
  • draw - friendship.

iks-nolik's People

Contributors

abduazizziyodov avatar sanjarzayniev avatar

Stargazers

Mokhirboy avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.