mooball
    Preparing search index...

    Interface GameCallbacks

    interface GameCallbacks {
        onCollisionDiscVsDisc?(
            discId1: number,
            discPlayerId1: number,
            discId2: number,
            discPlayerId2: number,
            customData?: any,
        ): any;
        onCollisionDiscVsPlane?(
            discId: number,
            discPlayerId: number,
            planeId: number,
            customData?: any,
        ): any;
        onCollisionDiscVsSegment?(
            discId: number,
            discPlayerId: number,
            segmentId: number,
            customData?: any,
        ): any;
        onGameEnd?(winningTeamId: number, customData?: any): any;
        onGameTick?(customData?: any): any;
        onKickOff?(customData?: any): any;
        onPlayerBallKick?(playerId: number, customData?: any): any;
        onPositionsReset?(customData?: any): any;
        onTeamGoal?(
            teamId: number,
            goalId: number,
            goal: Goal,
            ballDiscId: number,
            ballDisc: Disc,
            customData?: any,
        ): any;
        onTimeIsUp?(customData?: any): any;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Called just after a collision has happened between two discs.

      Parameters

      • discId1: number

        Id of the first collided disc.

      • discPlayerId1: number

        The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.

      • discId2: number

        Id of the second collided disc.

      • discPlayerId2: number

        The player's id that the second disc belongs to. If the disc is not a player's disc, this value will be null.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a collision has happened between a disc and a plane.

      Parameters

      • discId: number

        Id of the collided disc.

      • discPlayerId: number

        The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.

      • planeId: number

        Id of the collided plane.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a collision has happened between a disc and a segment.

      Parameters

      • discId: number

        Id of the collided disc.

      • discPlayerId: number

        The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.

      • segmentId: number

        Id of the collided segment.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has ended.

      Parameters

      • winningTeamId: number

        Id of the team that won the game.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a game tick has occurred. This will run a lot of times per second. Be careful not to make too many calculations here, otherwise the game might slow down.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a kick-off event has occurred.

      Parameters

      • OptionalcustomData: any

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the ball has been kicked.

      Parameters

      • playerId: number

        Id of the player who kicked the ball.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the player positions have been reset. This event happens just after a new game has been started or a goal has been scored. The player positions are reset to their corresponding spawn points defined in the current room's Stadium object.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a goal has been scored.

      Parameters

      • teamId: number

        Id of the team that scored the goal.

      • goalId: number

        Id of the goal object that the ball went in.

      • goal: Goal

        The goal object that the ball went in.

      • ballDiscId: number

        Id of the ball disc that caused the goal.

      • ballDisc: Disc

        The ball disc that caused the goal.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has ended by timeout.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.