Skip to content

This project is a warehouse of components designed to implement various functionalities within the Oncyber platform. These components can be used to enhance and customize spaces or levels in Oncyber.

License

Notifications You must be signed in to change notification settings

numengames/numinia-oncyber

Repository files navigation

numinia-oncyber

Oncyber Component Warehouse

This project is a warehouse of components designed to implement various functionalities within the Oncyber platform. These components can be used to enhance and customize spaces or levels in Oncyber.

Project Structure

Each component of the game is organized into specific directories that represent functionalities, behaviors, and configurations.

src

This directory contains the core of the game's frontend logic, including behaviors, common components, and utilities.

  • behaviors/teleport: Handles teleportation behaviors within the game.
    • all-in-one.ts: Aggregated teleport behavior logic.
    • ImplementationGuideOverlay.tsx: Overlay component for implementation guidance.
    • main.ts: Main entry point for teleport behaviors.
    • TeleportBehavior.ts: Defines teleport behavior functionality.
  • behaviors/redirect: Handles redirection behaviors within the game.
    • all-in-one.ts: Aggregated redirect behavior logic.
    • ImplementationGuideOverlay.tsx: Overlay component for implementation guidance related to redirect.
    • main.ts: Main entry point for redirect behaviors.
    • RedirectBehavior.ts: Defines the redirect behavior functionality.
  • common/components: Commonly used components across the game.
    • TeleportAction.ts: Component handling teleport actions.
    • RedirectAction.ts: Component handling redirection actions.
  • common/effects: Visual effects used in the game.
    • FadeIn.ts, FadeOut.ts: Components for fade-in and fade-out effects.
  • common/interactions: Manage in game interactions.
    • InteractionDirector.ts: Manages interactions within the game.
  • common/store: State management components for the game.
    • App.tsx: Main application component.
    • AppStore.ts: Store for managing application state.
    • Styles.tsx: Styling components for the application.
  • common/utils: Utility functions and helper classes.
    • isValidUrl.ts: Utility to validate URLs.
  • oo-oncyber.d.ts: TypeScript declaration file for Oncyber-specific types.

backend/openai-worker (Optional in case you need a backend)

This directory contains the optional server logic and backend functions necessary to interact with the OpenAI API and other backend services. This part of the project is dependent on Cloudflare Workers.

To use the backend functionalities, you will need to upload the files in this directory to Cloudflare by creating a Cloudflare Worker. Here’s how you can do it:

  1. Create a Cloudflare Worker: Log in to your Cloudflare account and navigate to the Workers section. Create a new Worker.

  2. Upload Files: Upload the necessary files from the backend/openai-worker directory to your Cloudflare Worker.

  3. Configure wrangler.toml: Make sure the wrangler.toml file is correctly configured with your Cloudflare account details and the settings required for your Worker.

  4. Deploy: Deploy the Worker using the Cloudflare dashboard or the Wrangler CLI.

Files included:

  • controller.js: Main controller to handle requests.
  • proxy.js: Proxy configuration.
  • redirect.js, roles.js, routes.js: Additional backend functionalities.
  • service.js: Handles service-related tasks.
  • worker.js: Worker configuration.
  • wrangler.toml: Configuration file for Cloudflare Workers.

Usage

1. Defining Behaviors and Components

Create or modify files within the src directory to define new behaviors, components, and utilities for the Oncyber game.

2. Implementing Backend Services

Use the backend/openai-worker directory to add or update backend services and logic necessary for the game.

Running Commands

To execute any of the available commands below, use the following command in the terminal:

npm install             # Install necessary dependencies

Available Commands

Below is a list of the available commands in this project:

lint

Runs ESLint to analyze the code for issues.

npm run lint

format

Automatically formats the code using Prettier.

npm run format

Contributing

You can see CONTRIBUTING

📜 License

Code released under the MIT License.

About

This project is a warehouse of components designed to implement various functionalities within the Oncyber platform. These components can be used to enhance and customize spaces or levels in Oncyber.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published