Code Monkey home page Code Monkey logo

galojs's Introduction

GaloJs

GaloJs is a modern implementation of the classic game Tic Tac Toe, built using Cocos2d v3.17.2. It features a client-server architecture where the game client is developed with Cocos2d and communicates with a REST API server.

Features

  • Classic Tic Tac Toe gameplay.
  • Cross-platform support for web and Windows.
  • Modern JavaScript integration with Cocos2d.
  • Client-server architecture for easy game state management and updates.

Prerequisites

Before installing GaloJs, ensure you have the following installed:

  • Git
  • Python 2.7 or later
  • Node.js
  • CMake

Installing Cocos2d

GaloJs requires Cocos2d v3.17.2. Follow these steps to install Cocos2d:

git clone https://github.com/cocos2d/cocos2d-x.git
cd cocos2d-x
git checkout v3
python download-deps.py
git config --global url.https://github.com/.insteadOf git://github.com/
git submodule update --init
python setup.py

Installing GaloJs

After setting up Cocos2d, you can install GaloJs by following these steps:

git clone https://github.com/if-shouldrs/GaloJs
cd GaloJs
npm install

Setting the Server URL

To configure the REST API server URL for GaloJs, you will need to modify the project.json file located in the cocos directory. Follow these steps:

  1. Open the cocos/project.json file in your preferred text editor.

  2. Locate the vars field within the JSON structure.

  3. Inside the vars object, modify the api key with the URL of your REST API server. For example:

    "vars": {
        "api": "http://your-server-url-here.com"
    }
  4. Save your changes. The game will now use this URL to communicate with the REST API server.

Building and Running

To build and launch GaloJs, use one of the following commands:

  • Web Version

    • Build and Launch: npm run build
    • Publish: npm run release - artifacts in /cocos/publish/html5
  • Windows Version

    • Build and Launch: npm run win32
    • Publish: npm run win32-build - artifacts in cocos/build/bin/GaloJs/Release

Project Structure

  • src/: Contains the modern JavaScript code for the game logic and UI.
  • cocos/src/: Contains the transpiled JavaScript code compatible with Cocos2d for multi-platform support.

License

GaloJs is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See the LICENSE file in the project repository for the full license text.

galojs's People

Contributors

if-shouldrs 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.