node-haxball
Version:
The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can
25 lines (20 loc) • 1.34 kB
JavaScript
module.exports = function(API){
const { OperationType, VariableType, ConnectionState, AllowFlags, Direction, CollisionFlags, CameraFollow, BackgroundType, GamePlayState, BanEntryType, Callback, Utils, Room, Replay, Query, Library, RoomConfig, Plugin, Renderer, Errors, Language, EventFactory, Impl } = API;
Object.setPrototypeOf(this, RoomConfig.prototype);
RoomConfig.call(this, { // Every roomConfig should have a unique name.
name: "collisions",
version: "0.1",
author: "abc",
description: `This roomConfig only logs messages in console when a collision happens. We will improve this later.`,
allowFlags: AllowFlags.CreateRoom | AllowFlags.JoinRoom // We allow this roomConfig to be activated on both CreateRoom and JoinRoom.
});
this.onCollisionDiscVsDisc = function(discId1, discPlayerId1, discId2, discPlayerId2, customData){
console.log("Disc vs disc collision : ", discPlayerId1, discId1, discPlayerId2, discId2);
};
this.onCollisionDiscVsSegment = function(discId, discPlayerId, segmentId, customData){
console.log("Disc vs segment collision : ", discPlayerId, discId, segmentId);
};
this.onCollisionDiscVsPlane = function(discId, discPlayerId, planeId, customData){
console.log("Disc vs plane collision : ", discPlayerId, discId, planeId);
};
};