Skip to content

Cocos2d frontend for a simple tic-tac-toe application. Uses node.js to transpile ES6 to what cocos2d v3 supports.

License

Notifications You must be signed in to change notification settings

if-shouldrs/GaloJs

Repository files navigation

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.

About

Cocos2d frontend for a simple tic-tac-toe application. Uses node.js to transpile ES6 to what cocos2d v3 supports.

Resources

License

Stars

Watchers

Forks