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.
Each component of the game is organized into specific directories that represent functionalities, behaviors, and configurations.
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.
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:
-
Create a Cloudflare Worker: Log in to your Cloudflare account and navigate to the Workers section. Create a new Worker.
-
Upload Files: Upload the necessary files from the
backend/openai-worker
directory to your Cloudflare Worker. -
Configure
wrangler.toml
: Make sure thewrangler.toml
file is correctly configured with your Cloudflare account details and the settings required for your Worker. -
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.
Create or modify files within the src
directory to define new behaviors, components, and utilities for the Oncyber game.
Use the backend/openai-worker
directory to add or update backend services and logic necessary for the game.
To execute any of the available commands below, use the following command in the terminal:
npm install # Install necessary dependencies
Below is a list of the available commands in this project:
Runs ESLint to analyze the code for issues.
npm run lint
Automatically formats the code using Prettier.
npm run format
You can see CONTRIBUTING
Code released under the MIT License.