source-code/
break-the-web
Public
codeCodeinfoIssues 0call_splitPull Requestsplay_circleActions
break-the-web/src/game/events.ts
typescript13 lines287 B
export const EventBus = new EventTarget();

export interface ElementDropData {
    id: string;
    text: string;
    x: number;
    y: number;
}

export const emitElementDrop = (data: ElementDropData) => {
    EventBus.dispatchEvent(new CustomEvent('elementDrop', { detail: data }));
};

About

Interact with the web page itself using HTML5 Drag-and-Drop to pull inputs and images directly into the Phaser physics engine. Alter the website state through bi-directional communication between React and Phaser, unlocking a glitchy horror mode. The game is built using React, Phaser 3, Zustand for state management, and Vanilla CSS.

ReactPhaser 3TypeScriptZustandVite

Contributors

1