diff --git a/scripts/app-bundle.js b/scripts/app-bundle.js index 739d60b..09af934 100644 --- a/scripts/app-bundle.js +++ b/scripts/app-bundle.js @@ -19,7 +19,7 @@ define('app',["require", "exports"], function (require, exports) { exports.App = App; }); ; -define('text!app.html',[],function(){return "\n";});; +define('text!app.html',[],function(){return "\r\n";});; define('behaviors/get-variant-value',["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -260,6 +260,7 @@ define('models/settings-model',["require", "exports", "./player-settings-model", this.ballSprite = 'ball.png'; this.portraitHeight = 75; this.portraitPadding = 10; + this.useCorsProxy = true; this.chatEnabled = false; this.gameOverText = "Game Over"; this.gameOverOpacity = 0.5; @@ -339,8 +340,8 @@ define('pages/game',["require", "exports", "./../scenes/cyberball", "./../models exports.GameViewModel = GameViewModel; }); ; -define('text!pages/game.css',[],function(){return "canvas {\n max-width: 100%;\n}\n\n.chat-log {\n border: 1px solid black;\n border-bottom: 0;\n height: 100px;\n overflow-y: auto;\n}\n\n.chat-input {\n display: flex;\n}\n\n.chat-input input {\n flex: 1;\n}\n";});; -define('text!pages/game.html',[],function(){return "\n";});; +define('text!pages/game.css',[],function(){return "canvas {\r\n max-width: 100%;\r\n}\r\n\r\n.chat-log {\r\n border: 1px solid black;\r\n border-bottom: 0;\r\n height: 100px;\r\n overflow-y: auto;\r\n}\r\n\r\n.chat-input {\r\n display: flex;\r\n}\r\n\r\n.chat-input input {\r\n flex: 1;\r\n}\r\n";});; +define('text!pages/game.html',[],function(){return "\r\n";});; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); @@ -409,7 +410,7 @@ define('pages/home',["require", "exports", "aurelia-templating-resources", "aure }()); }); ; -define('text!pages/home.html',[],function(){return "\r\n";});; +define('text!pages/home.html',[],function(){return "\n";});; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); @@ -444,7 +445,7 @@ define('pages/message-test',["require", "exports", "aurelia-templating-resources }()); }); ; -define('text!pages/message-test.html',[],function(){return "\n";});; +define('text!pages/message-test.html',[],function(){return "\r\n";});; define('resources/index',["require", "exports", "aurelia-framework"], function (require, exports, aurelia_framework_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -638,10 +639,10 @@ define('scenes/cyberball',["require", "exports", "enums/leave-trigger", "phaser" this.load.image('ball', "".concat(this.settings.baseUrl, "/").concat(this.settings.ballSprite)); this.load.multiatlas('player', "".concat(this.settings.baseUrl, "/player.json"), 'assets'); if (this.settings.player.portrait) - this.load.image('playerPortrait', 'https://proxy.cors.sh/' + this.settings.player.portrait); + this.load.image('playerPortrait', (this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + this.settings.player.portrait); this.settings.computerPlayers.forEach(function (cpu, i) { if (cpu.portrait) - _this.load.image('cpuPortrait' + i, 'https://proxy.cors.sh/' + cpu.portrait); + _this.load.image('cpuPortrait' + i, (_this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + cpu.portrait); }); }; CyberballScene.prototype.create = function () { diff --git a/scripts/app-bundle.js.map b/scripts/app-bundle.js.map index 6a794b7..9b6482d 100644 --- a/scripts/app-bundle.js.map +++ b/scripts/app-bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/app.ts","../src/app.html","../src/behaviors/get-variant-value.ts","../src/enums/leave-trigger.ts","../src/environment.ts","../src/helpers.ts","../src/main.ts","../src/models/banter-model.ts","../src/models/cpu-model.ts","../src/models/cpu-settings-model.ts","../src/models/player-model.ts","../src/models/player-settings-model.ts","../src/models/settings-model.ts","../src/pages/game.ts","../src/pages/game.css","../src/pages/game.html","../src/pages/home.ts","../src/pages/home.html","../src/pages/message-test.ts","../src/pages/message-test.html","../src/resources/index.ts","../src/resources/phaser-game/phaser-game.ts","../src/resources/value-converters/flag-value-converter.ts","../src/resources/value-converters/integer-array-value-converter.ts","../src/resources/value-converters/integer-value-converter.ts","../src/resources/value-converters/json-value-converter.ts","../src/resources/value-converters/number-value-converter.ts","../src/scenes/cyberball.ts"],"names":[],"mappings":";;;;IAEA;QAAA;QAcA,CAAC;QAXG,6BAAe,GAAf,UAAgB,MAA2B,EAAE,MAAc;YACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YAErB,MAAM,CAAC,KAAK,GAAG,WAAW,CAAC;YAE3B,MAAM,CAAC,GAAG,CAAC;gBACP,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE;gBAC7D,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE;gBACvD,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,oBAAoB,EAAE;aAClF,CAAC,CAAC;QACP,CAAC;QACL,UAAC;IAAD,CAdA,AAcC,IAAA;IAdY,kBAAG;;;ACFhB;;;;;ICAA,SAAgB,eAAe,CAAC,IAAY,EAAE,QAAgB;QAC1D,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAClF,CAAC;IAFD,0CAEC;;;;;;;ICFD,IAAY,YAOX;IAPD,WAAY,YAAY;QACpB,+CAAQ,CAAA;QACR,+CAAQ,CAAA;QACR,+CAAa,CAAA;QACb,qDAAgB,CAAA;QAChB,6DAAoB,CAAA;QACpB,8DAAoB,CAAA;I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,IAAI,EAAE,IAAI,IACP,IAAI,GACR,GAAG,CAAC,CAAC;QACZ,CAAC;QACL,qBAAC;IAAD,CArlBA,AAqlBC,CArlBmC,gBAAM,CAAC,KAAK,GAqlB/C;IArlBY,wCAAc","file":"app-bundle.js","sourcesContent":["import { RouterConfiguration, Router } from 'aurelia-router';\n\nexport class App {\n router: Router;\n\n configureRouter(config: RouterConfiguration, router: Router): void {\n this.router = router;\n\n config.title = 'Cyberball';\n\n config.map([\n { route: ['', 'home'], name: 'home', moduleId: 'pages/home' },\n { route: 'game', name: 'game', moduleId: 'pages/game' },\n { route: 'message-test', name: 'message-test', moduleId: 'pages/message-test' }\n ]);\n }\n}\n","\n","export function getVariantValue(base: number, variance: number): number {\r\n return base + (Phaser.Math.RND.between(0, variance) * Phaser.Math.RND.sign());\r\n}\r\n","export enum LeaveTrigger {\r\n None = 0,\r\n Turn = 1,\r\n Time = 1 << 1,\r\n Ignored = 1 << 2,\r\n OtherLeaver = 1 << 3,\r\n TimeIgnored = 1 << 4\r\n}\r\n","export default {\n debug: true,\n testing: true\n};\n","export function getCaughtBallPosition(player: Phaser.GameObjects.Sprite) {\n return { x: player.x + (player.flipX ? -50 : 50), y: player.y - 15 };\n}\n\nexport function getActiveBallPosition(player: Phaser.GameObjects.Sprite) {\n return { x: player.x + (player.flipX ? 40 : -40), y: player.y - 20 };\n}\n","import {Aurelia} from 'aurelia-framework'\nimport environment from './environment';\n\nexport function configure(aurelia: Aurelia) {\n aurelia.use\n .standardConfiguration()\n .feature('resources');\n\n aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');\n\n if (environment.testing) {\n aurelia.use.plugin('aurelia-testing');\n }\n\n aurelia.start().then(() => aurelia.setRoot());\n}\n","export class BanterModel {\n chance: number;\n delay: number;\n delayVariance: number;\n messages: Array;\n}\n","import { CyberballScene } from 'scenes/cyberball';\r\nimport { CpuSettingsModel } from './cpu-settings-model';\r\nimport { Player } from \"./player-model\";\r\n\r\n// TODO: WIP isolate game logic into more classes.\r\nexport class Cpu extends Player {\r\n public settings: CpuSettingsModel;\r\n\r\n constructor(settings: CpuSettingsModel, gameReference: CyberballScene) {\r\n super(settings, gameReference);\r\n }\r\n}\r\n","import { BanterModel } from './banter-model';\r\nimport { PlayerSettingsModel } from './player-settings-model';\r\n\r\nexport class CpuSettingsModel extends PlayerSettingsModel {\r\n // A set of weights for each possible target, adding up to 100%.\r\n targetPreference: Array = [50, 50];\r\n\r\n throwDelay: number = 500;\r\n throwDelayVariance: number = 200;\r\n\r\n catchDelay: number = 500;\r\n catchDelayVariance: number = 200;\r\n\r\n introductionBanter?: BanterModel;\r\n throwBanter?: BanterModel\r\n catchBanter?: BanterModel\r\n leftOutBanter?: BanterModel\r\n\r\n boredomBanterThreshold?: number;\r\n boredomBanter?: BanterModel;\r\n\r\n leaveTurnChance?: number = 100;\r\n leaveTimeChance?: number = 100;\r\n leaveIgnoredChance?: number = 100;\r\n leaveTimeIgnoredChance?: number = 100;\r\n leaveOtherLeaverChance?: number = 50;\r\n\r\n constructor(init?: Partial) {\r\n super();\r\n\r\n if(init)\r\n Object.assign(this, init);\r\n }\r\n}\r\n","import { getVariantValue } from './../behaviors/get-variant-value';\r\nimport { LeaveTrigger } from 'enums/leave-trigger';\r\nimport { CyberballScene } from './../scenes/cyberball';\r\nimport { PlayerSettingsModel } from './player-settings-model';\r\n\r\n// TODO: WIP isolate game logic into more classes.\r\nexport class Player {\r\n public settings: PlayerSettingsModel;\r\n protected gameReference: CyberballScene\r\n\r\n // State\r\n public hasBall: boolean = false;\r\n public leaveTimeThreshold: number;\r\n public leaveIgnoreTimeThreshold: number;\r\n\r\n // Graphics\r\n protected group: Phaser.Physics.Arcade.Group;\r\n public sprite: Phaser.GameObjects.Sprite;\r\n protected nameText: Phaser.GameObjects.Text;\r\n protected portrait: Phaser.GameObjects.Image;\r\n\r\n constructor(settings: PlayerSettingsModel, gameReference: CyberballScene) {\r\n this.settings = settings;\r\n this.gameReference = gameReference;\r\n }\r\n\r\n public create() {\r\n // Graphics\r\n\r\n let position = this.getPosition();\r\n\r\n this.group = this.gameReference.physics.add.group({ immovable: true, allowGravity: false });\r\n\r\n // TODO: Separate spritesheet and animation from game into separate class?\r\n this.sprite = this.group.create(position.x, position.y, 'player', 'active/1.png');\r\n\r\n if (this.settings.tint)\r\n this.sprite.setTint(parseInt(this.settings.tint.substring(1), 16));\r\n\r\n this.nameText = this.gameReference.add.text(\r\n position.x,\r\n position.y + this.sprite.height / 2 + 10,\r\n this.settings.name,\r\n { fontFamily: 'Arial', color: '#000000' }\r\n ).setOrigin(0.5);\r\n\r\n if (this.settings.portrait) {\r\n let portraitPosition = this.getPortraitPosition();\r\n // TODO: Load portrait in constructor?\r\n this.portrait = this.gameReference.add.image(portraitPosition.x, portraitPosition.y, 'playerPortrait');\r\n }\r\n\r\n // Triggers\r\n\r\n if ((this.settings.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\r\n this.leaveTimeThreshold = Date.now() + getVariantValue(this.settings.leaveTime, this.settings.leaveTimeVariance) * 1000;\r\n }\r\n\r\n if ((this.settings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\r\n this.leaveIgnoreTimeThreshold = Date.now() + getVariantValue(this.settings.leaveTimeIgnored, this.settings.leaveTimeIgnoredVariance) * 1000;\r\n }\r\n }\r\n\r\n // TODO: This feels gross.\r\n protected getPosition(): Phaser.Geom.Point {\r\n let padding = 75;\r\n\r\n if(this.gameReference.settings.hasPortraits)\r\n padding += this.gameReference.settings.portraitHeight + this.gameReference.settings.portraitPadding * 2;\r\n\r\n return new Phaser.Geom.Point(\r\n this.gameReference.sys.canvas.width / 2,\r\n this.gameReference.sys.canvas.height - padding\r\n );\r\n }\r\n\r\n protected getPortraitPosition(): Phaser.Geom.Point {\r\n var position = this.getPosition();\r\n\r\n return new Phaser.Geom.Point(\r\n position.x,\r\n position.y + this.gameReference.settings.portraitHeight / 2 + this.gameReference.settings.portraitPadding * 2 + this.sprite.height / 2 + 10\r\n );\r\n }\r\n}\r\n","import { LeaveTrigger } from \"enums/leave-trigger\";\r\n\r\nexport class PlayerSettingsModel {\r\n name: string;\r\n tint?: string;\r\n\r\n portrait?: string;\r\n\r\n /** Actions that may trigger a leave by this player. */\r\n leaveTrigger?: LeaveTrigger = LeaveTrigger.None;\r\n\r\n /** This player may leave after this many turns. */\r\n leaveTurn?: number = 10;\r\n leaveTurnVariance?: number = 2;\r\n\r\n /** This player may leave after this much time. (Seconds) */\r\n leaveTime?: number = 120;\r\n leaveTimeVariance?: number = 30;\r\n\r\n /** This player may leave after not catching the ball for this many turns. */\r\n leaveIgnored?: number = 10;\r\n leaveIgnoredVariance?: number = 2;\r\n\r\n /** This player may leave after not catching the ball for this much time. (Seconds) */\r\n leaveTimeIgnored?: number = 45;\r\n leaveTimeIgnoredVariance?: number = 15;\r\n\r\n /** This player may leave after this many other players leave. */\r\n leaveOtherLeaver?: number = 2;\r\n\r\n constructor(init?: Partial) {\r\n if(init)\r\n Object.assign(this, init);\r\n }\r\n}\r\n","import { PlayerSettingsModel } from './player-settings-model';\r\nimport { CpuSettingsModel } from './cpu-settings-model';\r\n\r\nexport class SettingsModel {\r\n player: PlayerSettingsModel = new PlayerSettingsModel();\r\n computerPlayers: Array;\r\n\r\n // Gameplay\r\n throwCount: number = 10;\r\n timeLimit: number = 0;\r\n displayTimeLimit: boolean = false;\r\n timeLimitText: string = 'Time Limit:';\r\n ballSpeed: number = 500;\r\n\r\n useSchedule: boolean = false;\r\n scheduleHonorsThrowCount: boolean = false;\r\n schedule: Array = [\r\n 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0\r\n ];\r\n\r\n // Graphics\r\n baseUrl: string = './assets';\r\n\r\n ballSprite: string = 'ball.png';\r\n ballTint?: string;\r\n\r\n portraitHeight: number = 75;\r\n portraitPadding: number = 10;\r\n\r\n get hasPortraits(): boolean | string {\r\n return this.player.portrait || this.computerPlayers.some(cpu => cpu.portrait);\r\n }\r\n\r\n // Misc\r\n chatEnabled: boolean = false;\r\n\r\n gameOverText: string = \"Game Over\";\r\n gameOverOpacity: number = 0.5;\r\n\r\n constructor(init?: Partial) {\r\n Object.assign(this, init);\r\n }\r\n}\r\n\r\nexport const defaultSettings = new SettingsModel({\r\n player: new PlayerSettingsModel({\r\n name: 'Player 1'\r\n }),\r\n computerPlayers: [\r\n new CpuSettingsModel({\r\n name: 'Player 2'\r\n }),\r\n new CpuSettingsModel({\r\n name: 'Player 3'\r\n })\r\n ]\r\n});\r\n","import { CyberballScene } from './../scenes/cyberball';\nimport { defaultSettings, SettingsModel } from './../models/settings-model';\nimport Phaser from 'phaser';\nimport { PhaserGameCustomElement } from 'resources/phaser-game/phaser-game';\n\n// // TODO: Use events to talk to Qualtrics?\n// //setTimeout(() => { window.dispatchEvent(new CustomEvent('complete', { detail: { test: 'test' } }))}, 1000)\n\n\nexport class GameViewModel {\n settings: SettingsModel = defaultSettings;\n\n // Game:\n\n game: PhaserGameCustomElement;\n\n gameWidth = 800;\n gameHeight = 460;\n\n gameConfig: Phaser.Types.Core.GameConfig;\n\n activate(params) {\n if('settings' in params) {\n this.settings = new SettingsModel(JSON.parse(atob(params.settings)));\n }\n\n if('playerName' in params) {\n this.settings.player.name = params.playerName;\n }\n\n if(this.settings.hasPortraits) {\n this.gameHeight += this.settings.portraitHeight * 2 + this.settings.portraitPadding * 4;\n }\n }\n\n bind() {\n this.gameConfig = {\n type: Phaser.AUTO,\n width: this.gameWidth,\n height: this.gameHeight,\n scene: new CyberballScene(this.settings),\n physics: {\n default: 'arcade'\n }\n };\n }\n\n // Chat:\n\n chatMessage: string;\n chatMessages: Array<{sender: string, text: string}> = [];\n\n sendMessage() {\n this.chatMessages.push({\n sender: this.settings.player.name,\n text: this.chatMessage\n });\n\n this.chatMessage = '';\n }\n}\n","canvas {\n max-width: 100%;\n}\n\n.chat-log {\n border: 1px solid black;\n border-bottom: 0;\n height: 100px;\n overflow-y: auto;\n}\n\n.chat-input {\n display: flex;\n}\n\n.chat-input input {\n flex: 1;\n}\n","\n","import {BindingSignaler} from 'aurelia-templating-resources';\r\nimport {autoinject} from 'aurelia-framework';\r\nimport { SettingsModel, defaultSettings } from \"models/settings-model\";\r\nimport { CpuSettingsModel } from 'models/cpu-settings-model';\r\nimport ClipboardJS from 'clipboard';\r\n\r\n@autoinject()\r\nexport class HomeViewModel {\r\n settings: SettingsModel = defaultSettings;\r\n clipboard: ClipboardJS;\r\n\r\n constructor(private signaler: BindingSignaler) {}\r\n\r\n bind() {\r\n this.clipboard = new ClipboardJS('#copy');\r\n }\r\n\r\n unbind() {\r\n this.clipboard.destroy();\r\n }\r\n\r\n addCPU() {\r\n this.settings.computerPlayers.push(new CpuSettingsModel({\r\n name: `Player ${this.settings.computerPlayers.length + 2}`\r\n }));\r\n\r\n this.settings.computerPlayers.forEach(cpu => {\r\n while(cpu.targetPreference.length != this.settings.computerPlayers.length)\r\n cpu.targetPreference.push(0);\r\n });\r\n }\r\n\r\n removeCPU() {\r\n this.settings.computerPlayers.pop();\r\n\r\n this.settings.computerPlayers.forEach(cpu => {\r\n cpu.targetPreference.pop();\r\n });\r\n }\r\n\r\n saveSettings() {\r\n this.signaler.signal('save-settings');\r\n }\r\n\r\n get url() {\r\n let url = document.location.origin + document.location.pathname;\r\n\r\n url += '#game?settings=';\r\n url += btoa(JSON.stringify(this.settings));\r\n\r\n return url;\r\n }\r\n\r\n testGame() {\r\n window.open(this.url);\r\n }\r\n}\r\n","\r\n","import {BindingSignaler} from 'aurelia-templating-resources';\nimport {autoinject} from 'aurelia-framework';\n\n@autoinject()\nexport class MessageTestViewModel {\n messages: Array = [];\n\n constructor(private signaler: BindingSignaler) {}\n\n bind() {\n window.addEventListener('message', (e) => {\n console.log('message', e.data);\n this.messages.push(e.data);\n\n this.signaler.signal('message');\n });\n }\n}\n","\n","import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration) {\n config.globalResources(PLATFORM.moduleName('./phaser-game/phaser-game'));\n}\n","import { customElement, bindable, autoinject, inlineView } from \"aurelia-framework\";\nimport Phaser from 'phaser';\n\n@customElement('phaser-game')\n@autoinject()\n@inlineView('')\nexport class PhaserGameCustomElement {\n @bindable config: Phaser.Types.Core.GameConfig;\n @bindable game: Phaser.Game;\n\n constructor(protected element: Element) {\n\n }\n\n bind() {\n this.config.parent = this.element as HTMLElement;\n this.game = new Phaser.Game(this.config);\n }\n}\n","export class FlagValueConverter {\r\n fromView(value, source, flag) {\r\n return value ? source | flag : source & ~flag;\r\n }\r\n\r\n toView(_value, source, flag) {\r\n return (source & flag) === flag;\r\n }\r\n}\r\n","export class IntegerArrayValueConverter {\n fromView(value: string) {\n // Remove anything but numbers and commas.\n value = value.replace(/[^0-9,]/g, '');\n\n // Remove any trailing comma.\n if(value[value.length - 1] == ',')\n value = value.substr(0, value.length - 1);\n\n return JSON.parse(`[${value}]`);\n }\n\n toView(value: Array) {\n return JSON.stringify(value).substr(1, value.length * 2 - 1);\n }\n}\n","export class IntegerValueConverter {\r\n fromView(value) {\r\n return parseInt(value ?? '0');\r\n }\r\n}\r\n","export class JsonValueConverter {\n toView(value) {\n return JSON.stringify(value, null, 2);\n }\n}\n","export class NumberValueConverter {\r\n fromView(value) {\r\n return parseFloat(value ?? '0');\r\n }\r\n}\r\n","import { Player } from './../models/player-model';\r\nimport { LeaveTrigger } from 'enums/leave-trigger';\r\nimport { SettingsModel } from './../models/settings-model';\r\nimport Phaser from 'phaser';\r\nimport { CpuSettingsModel } from 'models/cpu-settings-model';\r\n\r\nconst textStyle = { fontFamily: 'Arial', color: '#000000' };\r\n\r\n\r\nexport class CyberballScene extends Phaser.Scene {\r\n public settings: SettingsModel;\r\n\r\n // Game Objects:\r\n private player: Player;\r\n\r\n private ballSprite: Phaser.GameObjects.Sprite;\r\n private playerSprite: Phaser.GameObjects.Sprite;\r\n private playerGroup: Phaser.Physics.Arcade.Group;\r\n private cpuSprites: Phaser.GameObjects.Sprite[] = [];\r\n private timeLimitText: Phaser.GameObjects.Text;\r\n\r\n // Gameplay Mechanics:\r\n\r\n private playerHasBall = true;\r\n private ballHeld = true;\r\n private throwTarget: Phaser.GameObjects.Sprite;\r\n\r\n private activeTimeout;\r\n\r\n private absentPlayers: number[] = [];\r\n private showPlayerLeave: boolean = false;\r\n\r\n private gameEnded = false;\r\n\r\n // Stats:\r\n\r\n private throwCount = 0;\r\n private scheduleIndex = 0;\r\n private lastTime: number;\r\n private startTime: number;\r\n\r\n constructor(settings: SettingsModel) {\r\n super({});\r\n\r\n this.settings = settings;\r\n }\r\n\r\n public preload() {\r\n this.load.crossOrigin = 'anonymous';\r\n\r\n // TODO: Load from settings.\r\n this.load.image('ball', `${this.settings.baseUrl}/${this.settings.ballSprite}`);\r\n this.load.multiatlas('player', `${this.settings.baseUrl}/player.json`, 'assets');\r\n\r\n if(this.settings.player.portrait)\r\n this.load.image('playerPortrait', 'https://proxy.cors.sh/' + this.settings.player.portrait);\r\n\r\n this.settings.computerPlayers.forEach((cpu, i) => {\r\n if(cpu.portrait)\r\n this.load.image('cpuPortrait' + i, 'https://proxy.cors.sh/' + cpu.portrait);\r\n });\r\n }\r\n\r\n public create() {\r\n this.cameras.main.setBackgroundColor('#ffffff');\r\n\r\n // Animations:\r\n\r\n this.anims.create({\r\n key: 'active',\r\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'active/', suffix: '.png' })\r\n });\r\n\r\n this.anims.create({\r\n key: 'idle',\r\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'idle/', suffix: '.png' })\r\n });\r\n\r\n this.anims.create({\r\n key: 'throw',\r\n frameRate: 12,\r\n frames: this.anims.generateFrameNames('player', { start: 1, end: 3, prefix: 'throw/', suffix: '.png' })\r\n });\r\n\r\n this.anims.create({\r\n key: 'catch',\r\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'catch/', suffix: '.png' })\r\n });\r\n\r\n // Player:\r\n\r\n let playerPosition = this.getPlayerPosition();\r\n\r\n this.playerGroup = this.physics.add.group({ immovable: true, allowGravity: false });\r\n this.playerSprite = this.playerGroup.create(playerPosition.x, playerPosition.y, 'player', 'active/1.png');\r\n this.playerSprite.setData('settings', this.settings.player);\r\n\r\n if(this.settings.player.tint)\r\n this.playerSprite.setTint(parseInt(this.settings.player.tint.substr(1), 16));\r\n\r\n this.playerSprite.setData('name-object', this.add.text(playerPosition.x, playerPosition.y + this.playerSprite.height / 2 + 10, this.settings.player.name, textStyle).setOrigin(0.5));\r\n\r\n if(this.settings.player.portrait) {\r\n var portraitPosition = this.getPlayerPortraitPosition(this.playerSprite);\r\n var image = this.add.image(portraitPosition.x, portraitPosition.y, 'playerPortrait');\r\n\r\n image.setScale(this.settings.portraitHeight / image.height);\r\n }\r\n\r\n if((this.settings.player.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\r\n this.playerSprite.setData('leaveTime', Date.now() + this.getVariantValue(this.settings.player.leaveTime, this.settings.player.leaveTimeVariance) * 1000);\r\n }\r\n\r\n if((this.settings.player.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\r\n this.playerSprite.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(this.settings.player.leaveTimeIgnored, this.settings.player.leaveTimeIgnoredVariance) * 1000);\r\n }\r\n\r\n // CPU:\r\n\r\n for (let i = 0; i < this.settings.computerPlayers.length; i++) {\r\n let cpuPosition = this.getCPUPosition(i);\r\n let cpuSprite: Phaser.GameObjects.Sprite = this.playerGroup.create(cpuPosition.x, cpuPosition.y, 'player', 'idle/1.png');\r\n\r\n cpuSprite.setData('name-object', this.add.text(cpuPosition.x, cpuPosition.y + cpuSprite.height / 2 + 10, this.settings.computerPlayers[i].name, textStyle).setOrigin(0.5));\r\n\r\n if(this.settings.computerPlayers[i].portrait) {\r\n var portraitPosition = this.getCPUPortraitPosition(i, cpuSprite);\r\n var image = this.add.image(portraitPosition.x, portraitPosition.y, 'cpuPortrait' + i);\r\n\r\n image.setScale(this.settings.portraitHeight / image.height);\r\n }\r\n\r\n cpuSprite.flipX = cpuPosition.x > this.playerSprite.x;\r\n cpuSprite.setData('settings', this.settings.computerPlayers[i]);\r\n\r\n if(this.settings.computerPlayers[i].tint)\r\n cpuSprite.setTint(parseInt(this.settings.computerPlayers[i].tint.substr(1), 16));\r\n\r\n cpuSprite.setInteractive();\r\n cpuSprite.on('pointerdown', (e) => {\r\n if (this.playerHasBall) {\r\n // Ensure player and ball are facing the correct way on touch devices:\r\n this.playerSprite.flipX = this.input.x < this.playerSprite.x;\r\n\r\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\r\n this.ballSprite.x = ballPosition.x;\r\n this.ballSprite.y = ballPosition.y;\r\n\r\n this.throwBall(this.playerSprite, cpuSprite);\r\n }\r\n });\r\n\r\n if((this.settings.computerPlayers[i].leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\r\n cpuSprite.setData('leaveTime', Date.now() + this.getVariantValue(this.settings.computerPlayers[i].leaveTime, this.settings.computerPlayers[i].leaveTimeVariance) * 1000);\r\n }\r\n\r\n if((this.settings.computerPlayers[i].leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\r\n cpuSprite.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(this.settings.computerPlayers[i].leaveTimeIgnored, this.settings.computerPlayers[i].leaveTimeIgnoredVariance) * 1000);\r\n }\r\n\r\n this.cpuSprites.push(cpuSprite);\r\n }\r\n\r\n // Ball:\r\n\r\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\r\n this.ballSprite = this.physics.add.sprite(ballPosition.x, ballPosition.y, 'ball');\r\n\r\n if(this.settings.ballTint)\r\n this.ballSprite.setTint(parseInt(this.settings.ballTint.substr(1), 16));\r\n\r\n this.physics.add.overlap(this.ballSprite, this.playerGroup, (_b, receiver) => {\r\n if (!this.ballHeld && receiver === this.throwTarget)\r\n this.catchBall(receiver as Phaser.GameObjects.Sprite);\r\n });\r\n\r\n // Time Limit:\r\n\r\n this.startTime = Date.now();\r\n this.lastTime = this.startTime;\r\n\r\n if (this.settings.timeLimit > 0 && this.settings.displayTimeLimit) {\r\n this.timeLimitText = this.add.text(this.sys.canvas.width - 10, 10, this.getTimeString(), textStyle);\r\n this.timeLimitText.setOrigin(1, 0);\r\n }\r\n }\r\n\r\n public update() {\r\n if(this.gameEnded)\r\n return;\r\n\r\n if (this.playerHasBall) {\r\n this.playerSprite.play('active');\r\n this.playerSprite.flipX = this.input.x < this.playerSprite.x;\r\n\r\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\r\n this.ballSprite.x = ballPosition.x;\r\n this.ballSprite.y = ballPosition.y;\r\n } else if (!this.ballHeld) {\r\n // Eyes on the ball:\r\n this.playerGroup.getChildren().forEach(c => {\r\n let sprite = c as Phaser.GameObjects.Sprite;\r\n if (sprite.frame.name.includes('idle'))\r\n sprite.flipX = this.ballSprite.x < sprite.x\r\n });\r\n }\r\n\r\n // Player may leave after time has passed:\r\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time &&\r\n Date.now() > this.playerSprite.getData('leaveTime')) {\r\n this.showPlayerLeave = true;\r\n this.postEvent('player-may-leave', {\r\n reason: 'time elapsed'\r\n });\r\n }\r\n // Player may leave after ignored for a time:\r\n else if (!this.playerHasBall && !this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored &&\r\n Date.now() > this.playerSprite.getData('leaveTimeIgnored')) {\r\n this.showPlayerLeave = true;\r\n this.postEvent('player-may-leave', {\r\n reason: 'time ignored'\r\n });\r\n }\r\n\r\n this.cpuSprites.forEach(cpu => {\r\n // CPU shouldn't leave if they:\r\n // - have the ball or are about to catch the ball\r\n // - have already left\r\n if (cpu == this.throwTarget || cpu.getData('absent'))\r\n return;\r\n\r\n let settings = cpu.getData('settings') as CpuSettingsModel;\r\n\r\n // CPU may leave after some time\r\n if((settings.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time &&\r\n Date.now() > cpu.getData('leaveTime')) {\r\n this.leaveGame(cpu, 'time elapsed');\r\n }\r\n // CPU may leave after ignored for a time:\r\n else if ((settings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored &&\r\n Date.now() > cpu.getData('leaveTimeIgnored')) {\r\n this.leaveGame(cpu, 'time ignored');\r\n }\r\n });\r\n\r\n // Time Limit:\r\n\r\n if (this.settings.timeLimit > 0 && this.settings.displayTimeLimit)\r\n this.timeLimitText.setText(this.getTimeString());\r\n\r\n if (this.settings.timeLimit > 0 && Date.now() - this.startTime > this.settings.timeLimit) {\r\n this.postEvent('global-time-limit');\r\n this.gameOver();\r\n }\r\n }\r\n\r\n public gameOver() {\r\n if (this.gameEnded)\r\n return;\r\n\r\n this.gameEnded = true;\r\n\r\n this.postEvent('game-end');\r\n\r\n // Stop future throws:\r\n clearTimeout(this.activeTimeout);\r\n this.playerGroup.children.iterate(child => {\r\n child.removeAllListeners();\r\n return true;\r\n });\r\n\r\n // Draw game over screen:\r\n this.add.rectangle(this.sys.canvas.width / 2, this.sys.canvas.height / 2, this.sys.canvas.width, this.sys.canvas.height, 0xdddddd, this.settings.gameOverOpacity);\r\n this.add.text(this.sys.canvas.width / 2, this.sys.canvas.height / 2, this.settings.gameOverText, textStyle).setOrigin(0.5);\r\n }\r\n\r\n // Mechanics:\r\n\r\n public throwBall(thrower: Phaser.GameObjects.Sprite, receiver: Phaser.GameObjects.Sprite) {\r\n this.postEvent('throw', {\r\n thrower: thrower.getData('settings').name,\r\n receiver: receiver.getData('settings').name,\r\n wait: Date.now() - this.lastTime\r\n });\r\n\r\n this.lastTime = Date.now();\r\n\r\n // Update trackers:\r\n\r\n // Wait until the player throws the ball to reset their ignored timer, so they cannot ignore themselves.\r\n let throwerSettings = thrower.getData('settings');\r\n // TODO: Bug\r\n if((throwerSettings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\r\n receiver.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(throwerSettings.leaveTimeIgnored, throwerSettings.leaveTimeIgnoredVariance) * 1000);\r\n }\r\n\r\n this.playerHasBall = this.ballHeld = false;\r\n this.throwTarget = receiver;\r\n\r\n this.throwCount++;\r\n\r\n // Player animation:\r\n\r\n thrower.play('throw');\r\n thrower.playAfterRepeat('idle');\r\n\r\n // Ball physics:\r\n\r\n let ballTargetPosition = this.getCaughtBallPosition(receiver);\r\n this.physics.moveTo(this.ballSprite, ballTargetPosition.x, ballTargetPosition.y, this.settings.ballSpeed);\r\n }\r\n\r\n public catchBall(receiver: Phaser.GameObjects.Sprite) {\r\n // Update trackers:\r\n\r\n this.ballHeld = true;\r\n receiver.setData('throwsIgnored', 0)\r\n\r\n // Player animation:\r\n\r\n receiver.play('catch');\r\n\r\n // Ball physics:\r\n\r\n let ballPosition = this.getCaughtBallPosition(receiver);\r\n (this.ballSprite.body as Phaser.Physics.Arcade.Body).reset(ballPosition.x, ballPosition.y);\r\n\r\n // Check for leavers:\r\n\r\n // Player may leave after a number of turns:\r\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Turn) === LeaveTrigger.Turn) {\r\n let leaveThrows = this.getVariantValue(this.settings.player.leaveTurn, this.settings.player.leaveTurnVariance);\r\n\r\n if (this.throwCount >= leaveThrows) {\r\n this.showPlayerLeave = true;\r\n this.postEvent('player-may-leave', {\r\n reason: 'throws elapsed'\r\n });\r\n }\r\n }\r\n // Player may leave after ignored for a number of turns:\r\n else if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Ignored) === LeaveTrigger.Ignored) {\r\n let leaveThrows = this.getVariantValue(this.settings.player.leaveIgnored, this.settings.player.leaveIgnoredVariance);\r\n let playerThrowsIgnored = this.playerSprite.getData('throwsIgnored') ?? 0;\r\n\r\n if(this.playerSprite != receiver)\r\n this.playerSprite.setData('throwsIgnored', ++playerThrowsIgnored);\r\n\r\n if (playerThrowsIgnored >= leaveThrows) {\r\n this.showPlayerLeave = true;\r\n this.postEvent('player-may-leave', {\r\n reason: 'throws ignored'\r\n });\r\n }\r\n }\r\n\r\n this.cpuSprites.forEach(cpu => {\r\n // CPU shouldn't leave if they:\r\n // - have the ball\r\n // - have already left\r\n if (cpu == receiver || cpu.getData('absent'))\r\n return;\r\n\r\n let settings = cpu.getData('settings') as CpuSettingsModel;\r\n let throwsIgnored = (cpu.getData('throwsIgnored') ?? 0) + 1;\r\n cpu.setData('throwsIgnored', throwsIgnored);\r\n\r\n // CPU may leave after a number of turns:\r\n if((settings.leaveTrigger & LeaveTrigger.Turn) === LeaveTrigger.Turn) {\r\n let leaveThrows = this.getVariantValue(settings.leaveTurn, settings.leaveTurnVariance);\r\n\r\n if (this.throwCount >= leaveThrows && this.checkChance(settings.leaveTurnChance))\r\n this.leaveGame(cpu, 'throws elapsed');\r\n }\r\n // CPU may leave after ignored for a number of turns:\r\n else if((settings.leaveTrigger & LeaveTrigger.Ignored) === LeaveTrigger.Ignored) {\r\n let leaveThrows = this.getVariantValue(settings.leaveIgnored, settings.leaveIgnoredVariance);\r\n\r\n if (throwsIgnored >= leaveThrows && this.checkChance(settings.leaveIgnoredChance))\r\n this.leaveGame(cpu, 'throws ignored');\r\n }\r\n });\r\n\r\n // The game ends at the end of the schedule or when reaching the throw count.\r\n\r\n if (\r\n (this.settings.useSchedule && this.scheduleIndex === this.settings.schedule.length) ||\r\n (this.settings.useSchedule && this.settings.scheduleHonorsThrowCount && this.throwCount >= this.settings.throwCount) ||\r\n (!this.settings.useSchedule && this.throwCount >= this.settings.throwCount)\r\n ) {\r\n this.postEvent('throw-count-met');\r\n this.gameOver();\r\n return;\r\n }\r\n\r\n // Prepare for next throw:\r\n\r\n if (receiver === this.playerSprite) {\r\n this.playerHasBall = true;\r\n } else {\r\n let settings = receiver.getData('settings') as CpuSettingsModel;\r\n\r\n this.activeTimeout = setTimeout(() => {\r\n receiver.play('active');\r\n\r\n ballPosition = this.getActiveBallPosition(receiver);\r\n this.ballSprite.x = ballPosition.x;\r\n this.ballSprite.y = ballPosition.y;\r\n\r\n this.activeTimeout = setTimeout(() => {\r\n if (this.settings.useSchedule) {\r\n // Skip self and absent players in schedule.\r\n while(this.settings.schedule[this.scheduleIndex] === this.playerGroup.getChildren().indexOf(receiver) &&\r\n !this.absentPlayers.includes(this.settings.schedule[this.scheduleIndex]))\r\n this.scheduleIndex++\r\n\r\n this.throwBall(receiver, this.playerGroup.getChildren()[this.settings.schedule[this.scheduleIndex]] as Phaser.GameObjects.Sprite)\r\n this.scheduleIndex++;\r\n } else {\r\n let random = Math.random() * 100;\r\n\r\n // A psuedo-random target is selected by subtracting the target preference chance from the random number until 0 is reached\r\n for (var i = 0; i < settings.targetPreference.length; i++) {\r\n random -= settings.targetPreference[i];\r\n\r\n if (random <= 0) {\r\n // Exclude self\r\n if (i >= this.playerGroup.getChildren().indexOf(receiver))\r\n i++\r\n\r\n this.throwBall(receiver, this.playerGroup.getChildren()[i] as Phaser.GameObjects.Sprite);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }, this.getVariantValue(settings.throwDelay, settings.throwDelayVariance));\r\n }, this.getVariantValue(settings.catchDelay, settings.catchDelayVariance))\r\n }\r\n }\r\n\r\n public leaveGame(player: Phaser.GameObjects.Sprite, reason: string = '') {\r\n let nameObject = player.getData('name-object') as Phaser.GameObjects.Text;\r\n let playerIndex = this.playerGroup.getChildren().indexOf(player);\r\n\r\n this.absentPlayers.push(playerIndex);\r\n player.setData('absent', true);\r\n\r\n nameObject.setText([nameObject.text, 'has left the game.']);\r\n\r\n // Deactivate player object\r\n\r\n player.removeAllListeners();\r\n player.setVisible(false);\r\n\r\n this.postEvent('leave', {\r\n leaver: player.getData('settings').name,\r\n reason: reason\r\n });\r\n\r\n // Redistribute throw target weights:\r\n\r\n console.log('pindex', playerIndex);\r\n\r\n this.settings.computerPlayers.forEach((cpu, i) => {\r\n if(this.absentPlayers.includes(i + 1))\r\n return;\r\n\r\n console.log('distribute before', i, cpu.targetPreference);\r\n\r\n let targetIndex = playerIndex > (i + 1) ? playerIndex - 1 : playerIndex;\r\n let targetWeight = cpu.targetPreference[targetIndex];\r\n cpu.targetPreference[targetIndex] = 0;\r\n let total = cpu.targetPreference.reduce((acc, cur) => acc + cur);\r\n\r\n for(let k = 0; k < cpu.targetPreference.length; k++) {\r\n if (cpu.targetPreference[k] == 0)\r\n continue;\r\n\r\n cpu.targetPreference[k] += cpu.targetPreference[k] / total * targetWeight;\r\n }\r\n\r\n console.log('distribute after', i, cpu.targetPreference);\r\n });\r\n\r\n // If there is only one player left, end the game:\r\n if (this.absentPlayers.length >= this.settings.computerPlayers.length) {\r\n this.gameOver();\r\n return;\r\n }\r\n\r\n // Check if this triggers other players leaving:\r\n\r\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.OtherLeaver) === LeaveTrigger.OtherLeaver) {\r\n console.log(this.absentPlayers.length, this.settings.player.leaveOtherLeaver);\r\n if (this.absentPlayers.length >= this.settings.player.leaveOtherLeaver) {\r\n this.showPlayerLeave = true;\r\n this.postEvent('player-may-leave', {\r\n reason: 'other leavers'\r\n });\r\n }\r\n }\r\n\r\n this.cpuSprites.forEach(cpu => {\r\n let settings = cpu.getData('settings') as CpuSettingsModel;\r\n\r\n // CPU shouldn't leave if they:\r\n // - have the ball\r\n // - have already left\r\n if (cpu == this.throwTarget || cpu.getData('absent'))\r\n return;\r\n\r\n if((settings.leaveTrigger & LeaveTrigger.OtherLeaver) === LeaveTrigger.OtherLeaver) {\r\n if (this.absentPlayers.length >= settings.leaveOtherLeaver && this.checkChance(settings.leaveOtherLeaverChance))\r\n this.leaveGame(cpu, 'other leavers');\r\n }\r\n });\r\n }\r\n\r\n // Helpers:\r\n\r\n getCPUPosition(i: number): Phaser.Geom.Point {\r\n // TODO: Increase padding when portaits are enabled.\r\n let padding = 75;\r\n let extraPadding = this.settings.hasPortraits ? this.settings.portraitHeight + this.settings.portraitPadding * 2 : 0;\r\n\r\n if(this.settings.computerPlayers.length === 1) {\r\n return new Phaser.Geom.Point(\r\n this.sys.canvas.width / 2,\r\n padding + extraPadding\r\n );\r\n }\r\n\r\n return new Phaser.Geom.Point(\r\n // Evenly divide the width of the screen by the number of players.\r\n ((this.sys.canvas.width - (padding * 2)) / (this.settings.computerPlayers.length - 1)) * i + padding,\r\n // First and last player are closer in the middle, others stand along the edge.\r\n i === 0 || i === this.settings.computerPlayers.length - 1\r\n ? (this.sys.canvas.height / 2)\r\n : padding + extraPadding\r\n );\r\n }\r\n\r\n getCPUPortraitPosition(i: number, sprite: Phaser.GameObjects.Sprite): Phaser.Geom.Point {\r\n let position = this.getCPUPosition(i);\r\n\r\n return new Phaser.Geom.Point(\r\n position.x,\r\n position.y - this.settings.portraitHeight + this.settings.portraitPadding * 2 - sprite.height / 2\r\n );\r\n }\r\n\r\n getPlayerPosition(): Phaser.Geom.Point {\r\n let padding = 75;\r\n\r\n if(this.settings.hasPortraits)\r\n padding += this.settings.portraitHeight + this.settings.portraitPadding * 2;\r\n\r\n return new Phaser.Geom.Point(\r\n this.sys.canvas.width / 2,\r\n this.sys.canvas.height - padding\r\n );\r\n }\r\n\r\n getPlayerPortraitPosition(sprite: Phaser.GameObjects.Sprite): Phaser.Geom.Point {\r\n var position = this.getPlayerPosition();\r\n\r\n return new Phaser.Geom.Point(\r\n position.x,\r\n position.y + this.settings.portraitHeight / 2 + this.settings.portraitPadding * 2 + sprite.height / 2 + 10\r\n );\r\n }\r\n\r\n // TODO: This is invalid if the sprites are changed.\r\n getCaughtBallPosition(target: Phaser.GameObjects.Sprite) {\r\n return new Phaser.Geom.Point(target.x + (target.flipX ? -50 : 50), target.y - 15);\r\n }\r\n\r\n // TODO: This is invalid if the sprites are changed.\r\n getActiveBallPosition(target: Phaser.GameObjects.Sprite) {\r\n return new Phaser.Geom.Point(target.x + (target.flipX ? 40 : -40), target.y - 20);\r\n }\r\n\r\n getVariantValue(base: number, variance: number): number {\r\n return base + (Phaser.Math.RND.between(0, variance) * Phaser.Math.RND.sign());\r\n }\r\n\r\n checkChance(chance: number): boolean {\r\n return Phaser.Math.RND.between(0, 100) <= chance;\r\n }\r\n\r\n getTimeString(): string {\r\n let timeRemaining = this.settings.timeLimit - (Date.now() - this.startTime);\r\n let time = new Date(timeRemaining < 0 ? 0 : timeRemaining);\r\n\r\n return `${this.settings.timeLimitText} ${time.getUTCMinutes()}:${time.getUTCSeconds() < 10 ? '0' : ''}${time.getUTCSeconds()}`;\r\n }\r\n\r\n postEvent(type: string, data: any = {}): void {\r\n console.log('post event: ' + type, data);\r\n\r\n window.parent.postMessage({\r\n type: type,\r\n ...data\r\n }, '*');\r\n }\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/app.ts","../src/app.html","../src/behaviors/get-variant-value.ts","../src/enums/leave-trigger.ts","../src/environment.ts","../src/helpers.ts","../src/main.ts","../src/models/banter-model.ts","../src/models/cpu-model.ts","../src/models/cpu-settings-model.ts","../src/models/player-model.ts","../src/models/player-settings-model.ts","../src/models/settings-model.ts","../src/pages/game.ts","../src/pages/game.css","../src/pages/game.html","../src/pages/home.ts","../src/pages/home.html","../src/pages/message-test.ts","../src/pages/message-test.html","../src/resources/index.ts","../src/resources/phaser-game/phaser-game.ts","../src/resources/value-converters/flag-value-converter.ts","../src/resources/value-converters/integer-array-value-converter.ts","../src/resources/value-converters/integer-value-converter.ts","../src/resources/value-converters/json-value-converter.ts","../src/resources/value-converters/number-value-converter.ts","../src/scenes/cyberball.ts"],"names":[],"mappings":";;;;IAEA;QAAA;QAcA,CAAC;QAXG,6BAAe,GAAf,UAAgB,MAA2B,EAAE,MAAc;YACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YAErB,MAAM,CAAC,KAAK,GAAG,WAAW,CAAC;YAE3B,MAAM,CAAC,GAAG,CAAC;gBACP,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,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AC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,oCAAW,GAAX,UAAY,MAAc;YACtB,OAAO,gBAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC;QACrD,CAAC;QAED,sCAAa,GAAb;YACI,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5E,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;YAE3D,OAAO,UAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,cAAI,IAAI,CAAC,aAAa,EAAE,cAAI,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAG,IAAI,CAAC,aAAa,EAAE,CAAE,CAAC;QACnI,CAAC;QAED,kCAAS,GAAT,UAAU,IAAY,EAAE,IAAc;YAAd,qBAAA,EAAA,SAAc;YAClC,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC;YAEzC,MAAM,CAAC,MAAM,CAAC,WAAW,YACrB,IAAI,EAAE,IAAI,IACP,IAAI,GACR,GAAG,CAAC,CAAC;QACZ,CAAC;QACL,qBAAC;IAAD,CAtlBA,AAslBC,CAtlBmC,gBAAM,CAAC,KAAK,GAslB/C;IAtlBY,wCAAc","file":"app-bundle.js","sourcesContent":["import { RouterConfiguration, Router } from 'aurelia-router';\r\n\r\nexport class App {\r\n router: Router;\r\n\r\n configureRouter(config: RouterConfiguration, router: Router): void {\r\n this.router = router;\r\n\r\n config.title = 'Cyberball';\r\n\r\n config.map([\r\n { route: ['', 'home'], name: 'home', moduleId: 'pages/home' },\r\n { route: 'game', name: 'game', moduleId: 'pages/game' },\r\n { route: 'message-test', name: 'message-test', moduleId: 'pages/message-test' }\r\n ]);\r\n }\r\n}\r\n","\r\n","export function getVariantValue(base: number, variance: number): number {\r\n return base + (Phaser.Math.RND.between(0, variance) * Phaser.Math.RND.sign());\r\n}\r\n","export enum LeaveTrigger {\r\n None = 0,\r\n Turn = 1,\r\n Time = 1 << 1,\r\n Ignored = 1 << 2,\r\n OtherLeaver = 1 << 3,\r\n TimeIgnored = 1 << 4\r\n}\r\n","export default {\r\n debug: true,\r\n testing: true\r\n};\r\n","export function getCaughtBallPosition(player: Phaser.GameObjects.Sprite) {\r\n return { x: player.x + (player.flipX ? -50 : 50), y: player.y - 15 };\r\n}\r\n\r\nexport function getActiveBallPosition(player: Phaser.GameObjects.Sprite) {\r\n return { x: player.x + (player.flipX ? 40 : -40), y: player.y - 20 };\r\n}\r\n","import {Aurelia} from 'aurelia-framework'\r\nimport environment from './environment';\r\n\r\nexport function configure(aurelia: Aurelia) {\r\n aurelia.use\r\n .standardConfiguration()\r\n .feature('resources');\r\n\r\n aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');\r\n\r\n if (environment.testing) {\r\n aurelia.use.plugin('aurelia-testing');\r\n }\r\n\r\n aurelia.start().then(() => aurelia.setRoot());\r\n}\r\n","export class BanterModel {\r\n chance: number;\r\n delay: number;\r\n delayVariance: number;\r\n messages: Array;\r\n}\r\n","import { CyberballScene } from 'scenes/cyberball';\r\nimport { CpuSettingsModel } from './cpu-settings-model';\r\nimport { Player } from \"./player-model\";\r\n\r\n// TODO: WIP isolate game logic into more classes.\r\nexport class Cpu extends Player {\r\n public settings: CpuSettingsModel;\r\n\r\n constructor(settings: CpuSettingsModel, gameReference: CyberballScene) {\r\n super(settings, gameReference);\r\n }\r\n}\r\n","import { BanterModel } from './banter-model';\r\nimport { PlayerSettingsModel } from './player-settings-model';\r\n\r\nexport class CpuSettingsModel extends PlayerSettingsModel {\r\n // A set of weights for each possible target, adding up to 100%.\r\n targetPreference: Array = [50, 50];\r\n\r\n throwDelay: number = 500;\r\n throwDelayVariance: number = 200;\r\n\r\n catchDelay: number = 500;\r\n catchDelayVariance: number = 200;\r\n\r\n introductionBanter?: BanterModel;\r\n throwBanter?: BanterModel\r\n catchBanter?: BanterModel\r\n leftOutBanter?: BanterModel\r\n\r\n boredomBanterThreshold?: number;\r\n boredomBanter?: BanterModel;\r\n\r\n leaveTurnChance?: number = 100;\r\n leaveTimeChance?: number = 100;\r\n leaveIgnoredChance?: number = 100;\r\n leaveTimeIgnoredChance?: number = 100;\r\n leaveOtherLeaverChance?: number = 50;\r\n\r\n constructor(init?: Partial) {\r\n super();\r\n\r\n if(init)\r\n Object.assign(this, init);\r\n }\r\n}\r\n","import { getVariantValue } from './../behaviors/get-variant-value';\r\nimport { LeaveTrigger } from 'enums/leave-trigger';\r\nimport { CyberballScene } from './../scenes/cyberball';\r\nimport { PlayerSettingsModel } from './player-settings-model';\r\n\r\n// TODO: WIP isolate game logic into more classes.\r\nexport class Player {\r\n public settings: PlayerSettingsModel;\r\n protected gameReference: CyberballScene\r\n\r\n // State\r\n public hasBall: boolean = false;\r\n public leaveTimeThreshold: number;\r\n public leaveIgnoreTimeThreshold: number;\r\n\r\n // Graphics\r\n protected group: Phaser.Physics.Arcade.Group;\r\n public sprite: Phaser.GameObjects.Sprite;\r\n protected nameText: Phaser.GameObjects.Text;\r\n protected portrait: Phaser.GameObjects.Image;\r\n\r\n constructor(settings: PlayerSettingsModel, gameReference: CyberballScene) {\r\n this.settings = settings;\r\n this.gameReference = gameReference;\r\n }\r\n\r\n public create() {\r\n // Graphics\r\n\r\n let position = this.getPosition();\r\n\r\n this.group = this.gameReference.physics.add.group({ immovable: true, allowGravity: false });\r\n\r\n // TODO: Separate spritesheet and animation from game into separate class?\r\n this.sprite = this.group.create(position.x, position.y, 'player', 'active/1.png');\r\n\r\n if (this.settings.tint)\r\n this.sprite.setTint(parseInt(this.settings.tint.substring(1), 16));\r\n\r\n this.nameText = this.gameReference.add.text(\r\n position.x,\r\n position.y + this.sprite.height / 2 + 10,\r\n this.settings.name,\r\n { fontFamily: 'Arial', color: '#000000' }\r\n ).setOrigin(0.5);\r\n\r\n if (this.settings.portrait) {\r\n let portraitPosition = this.getPortraitPosition();\r\n // TODO: Load portrait in constructor?\r\n this.portrait = this.gameReference.add.image(portraitPosition.x, portraitPosition.y, 'playerPortrait');\r\n }\r\n\r\n // Triggers\r\n\r\n if ((this.settings.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\r\n this.leaveTimeThreshold = Date.now() + getVariantValue(this.settings.leaveTime, this.settings.leaveTimeVariance) * 1000;\r\n }\r\n\r\n if ((this.settings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\r\n this.leaveIgnoreTimeThreshold = Date.now() + getVariantValue(this.settings.leaveTimeIgnored, this.settings.leaveTimeIgnoredVariance) * 1000;\r\n }\r\n }\r\n\r\n // TODO: This feels gross.\r\n protected getPosition(): Phaser.Geom.Point {\r\n let padding = 75;\r\n\r\n if(this.gameReference.settings.hasPortraits)\r\n padding += this.gameReference.settings.portraitHeight + this.gameReference.settings.portraitPadding * 2;\r\n\r\n return new Phaser.Geom.Point(\r\n this.gameReference.sys.canvas.width / 2,\r\n this.gameReference.sys.canvas.height - padding\r\n );\r\n }\r\n\r\n protected getPortraitPosition(): Phaser.Geom.Point {\r\n var position = this.getPosition();\r\n\r\n return new Phaser.Geom.Point(\r\n position.x,\r\n position.y + this.gameReference.settings.portraitHeight / 2 + this.gameReference.settings.portraitPadding * 2 + this.sprite.height / 2 + 10\r\n );\r\n }\r\n}\r\n","import { LeaveTrigger } from \"enums/leave-trigger\";\r\n\r\nexport class PlayerSettingsModel {\r\n name: string;\r\n tint?: string;\r\n\r\n portrait?: string;\r\n\r\n /** Actions that may trigger a leave by this player. */\r\n leaveTrigger?: LeaveTrigger = LeaveTrigger.None;\r\n\r\n /** This player may leave after this many turns. */\r\n leaveTurn?: number = 10;\r\n leaveTurnVariance?: number = 2;\r\n\r\n /** This player may leave after this much time. (Seconds) */\r\n leaveTime?: number = 120;\r\n leaveTimeVariance?: number = 30;\r\n\r\n /** This player may leave after not catching the ball for this many turns. */\r\n leaveIgnored?: number = 10;\r\n leaveIgnoredVariance?: number = 2;\r\n\r\n /** This player may leave after not catching the ball for this much time. (Seconds) */\r\n leaveTimeIgnored?: number = 45;\r\n leaveTimeIgnoredVariance?: number = 15;\r\n\r\n /** This player may leave after this many other players leave. */\r\n leaveOtherLeaver?: number = 2;\r\n\r\n constructor(init?: Partial) {\r\n if(init)\r\n Object.assign(this, init);\r\n }\r\n}\r\n","import { PlayerSettingsModel } from './player-settings-model';\nimport { CpuSettingsModel } from './cpu-settings-model';\n\nexport class SettingsModel {\n player: PlayerSettingsModel = new PlayerSettingsModel();\n computerPlayers: Array;\n\n // Gameplay\n throwCount: number = 10;\n timeLimit: number = 0;\n displayTimeLimit: boolean = false;\n timeLimitText: string = 'Time Limit:';\n ballSpeed: number = 500;\n\n useSchedule: boolean = false;\n scheduleHonorsThrowCount: boolean = false;\n schedule: Array = [\n 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0\n ];\n\n // Graphics\n baseUrl: string = './assets';\n\n ballSprite: string = 'ball.png';\n ballTint?: string;\n\n portraitHeight: number = 75;\n portraitPadding: number = 10;\n\n get hasPortraits(): boolean | string {\n return this.player.portrait || this.computerPlayers.some(cpu => cpu.portrait);\n }\n\n // Misc\n useCorsProxy: boolean = true;\n\n chatEnabled: boolean = false;\n\n gameOverText: string = \"Game Over\";\n gameOverOpacity: number = 0.5;\n\n constructor(init?: Partial) {\n Object.assign(this, init);\n }\n}\n\nexport const defaultSettings = new SettingsModel({\n player: new PlayerSettingsModel({\n name: 'Player 1'\n }),\n computerPlayers: [\n new CpuSettingsModel({\n name: 'Player 2'\n }),\n new CpuSettingsModel({\n name: 'Player 3'\n })\n ]\n});\n","import { CyberballScene } from './../scenes/cyberball';\r\nimport { defaultSettings, SettingsModel } from './../models/settings-model';\r\nimport Phaser from 'phaser';\r\nimport { PhaserGameCustomElement } from 'resources/phaser-game/phaser-game';\r\n\r\n// // TODO: Use events to talk to Qualtrics?\r\n// //setTimeout(() => { window.dispatchEvent(new CustomEvent('complete', { detail: { test: 'test' } }))}, 1000)\r\n\r\n\r\nexport class GameViewModel {\r\n settings: SettingsModel = defaultSettings;\r\n\r\n // Game:\r\n\r\n game: PhaserGameCustomElement;\r\n\r\n gameWidth = 800;\r\n gameHeight = 460;\r\n\r\n gameConfig: Phaser.Types.Core.GameConfig;\r\n\r\n activate(params) {\r\n if('settings' in params) {\r\n this.settings = new SettingsModel(JSON.parse(atob(params.settings)));\r\n }\r\n\r\n if('playerName' in params) {\r\n this.settings.player.name = params.playerName;\r\n }\r\n\r\n if(this.settings.hasPortraits) {\r\n this.gameHeight += this.settings.portraitHeight * 2 + this.settings.portraitPadding * 4;\r\n }\r\n }\r\n\r\n bind() {\r\n this.gameConfig = {\r\n type: Phaser.AUTO,\r\n width: this.gameWidth,\r\n height: this.gameHeight,\r\n scene: new CyberballScene(this.settings),\r\n physics: {\r\n default: 'arcade'\r\n }\r\n };\r\n }\r\n\r\n // Chat:\r\n\r\n chatMessage: string;\r\n chatMessages: Array<{sender: string, text: string}> = [];\r\n\r\n sendMessage() {\r\n this.chatMessages.push({\r\n sender: this.settings.player.name,\r\n text: this.chatMessage\r\n });\r\n\r\n this.chatMessage = '';\r\n }\r\n}\r\n","canvas {\r\n max-width: 100%;\r\n}\r\n\r\n.chat-log {\r\n border: 1px solid black;\r\n border-bottom: 0;\r\n height: 100px;\r\n overflow-y: auto;\r\n}\r\n\r\n.chat-input {\r\n display: flex;\r\n}\r\n\r\n.chat-input input {\r\n flex: 1;\r\n}\r\n","\r\n","import {BindingSignaler} from 'aurelia-templating-resources';\r\nimport {autoinject} from 'aurelia-framework';\r\nimport { SettingsModel, defaultSettings } from \"models/settings-model\";\r\nimport { CpuSettingsModel } from 'models/cpu-settings-model';\r\nimport ClipboardJS from 'clipboard';\r\n\r\n@autoinject()\r\nexport class HomeViewModel {\r\n settings: SettingsModel = defaultSettings;\r\n clipboard: ClipboardJS;\r\n\r\n constructor(private signaler: BindingSignaler) {}\r\n\r\n bind() {\r\n this.clipboard = new ClipboardJS('#copy');\r\n }\r\n\r\n unbind() {\r\n this.clipboard.destroy();\r\n }\r\n\r\n addCPU() {\r\n this.settings.computerPlayers.push(new CpuSettingsModel({\r\n name: `Player ${this.settings.computerPlayers.length + 2}`\r\n }));\r\n\r\n this.settings.computerPlayers.forEach(cpu => {\r\n while(cpu.targetPreference.length != this.settings.computerPlayers.length)\r\n cpu.targetPreference.push(0);\r\n });\r\n }\r\n\r\n removeCPU() {\r\n this.settings.computerPlayers.pop();\r\n\r\n this.settings.computerPlayers.forEach(cpu => {\r\n cpu.targetPreference.pop();\r\n });\r\n }\r\n\r\n saveSettings() {\r\n this.signaler.signal('save-settings');\r\n }\r\n\r\n get url() {\r\n let url = document.location.origin + document.location.pathname;\r\n\r\n url += '#game?settings=';\r\n url += btoa(JSON.stringify(this.settings));\r\n\r\n return url;\r\n }\r\n\r\n testGame() {\r\n window.open(this.url);\r\n }\r\n}\r\n","\n","import {BindingSignaler} from 'aurelia-templating-resources';\r\nimport {autoinject} from 'aurelia-framework';\r\n\r\n@autoinject()\r\nexport class MessageTestViewModel {\r\n messages: Array = [];\r\n\r\n constructor(private signaler: BindingSignaler) {}\r\n\r\n bind() {\r\n window.addEventListener('message', (e) => {\r\n console.log('message', e.data);\r\n this.messages.push(e.data);\r\n\r\n this.signaler.signal('message');\r\n });\r\n }\r\n}\r\n","\r\n","import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework';\r\n\r\nexport function configure(config: FrameworkConfiguration) {\r\n config.globalResources(PLATFORM.moduleName('./phaser-game/phaser-game'));\r\n}\r\n","import { customElement, bindable, autoinject, inlineView } from \"aurelia-framework\";\r\nimport Phaser from 'phaser';\r\n\r\n@customElement('phaser-game')\r\n@autoinject()\r\n@inlineView('')\r\nexport class PhaserGameCustomElement {\r\n @bindable config: Phaser.Types.Core.GameConfig;\r\n @bindable game: Phaser.Game;\r\n\r\n constructor(protected element: Element) {\r\n\r\n }\r\n\r\n bind() {\r\n this.config.parent = this.element as HTMLElement;\r\n this.game = new Phaser.Game(this.config);\r\n }\r\n}\r\n","export class FlagValueConverter {\r\n fromView(value, source, flag) {\r\n return value ? source | flag : source & ~flag;\r\n }\r\n\r\n toView(_value, source, flag) {\r\n return (source & flag) === flag;\r\n }\r\n}\r\n","export class IntegerArrayValueConverter {\r\n fromView(value: string) {\r\n // Remove anything but numbers and commas.\r\n value = value.replace(/[^0-9,]/g, '');\r\n\r\n // Remove any trailing comma.\r\n if(value[value.length - 1] == ',')\r\n value = value.substr(0, value.length - 1);\r\n\r\n return JSON.parse(`[${value}]`);\r\n }\r\n\r\n toView(value: Array) {\r\n return JSON.stringify(value).substr(1, value.length * 2 - 1);\r\n }\r\n}\r\n","export class IntegerValueConverter {\r\n fromView(value) {\r\n return parseInt(value ?? '0');\r\n }\r\n}\r\n","export class JsonValueConverter {\r\n toView(value) {\r\n return JSON.stringify(value, null, 2);\r\n }\r\n}\r\n","export class NumberValueConverter {\r\n fromView(value) {\r\n return parseFloat(value ?? '0');\r\n }\r\n}\r\n","import { Player } from './../models/player-model';\nimport { LeaveTrigger } from 'enums/leave-trigger';\nimport { SettingsModel } from './../models/settings-model';\nimport Phaser from 'phaser';\nimport { CpuSettingsModel } from 'models/cpu-settings-model';\n\nconst textStyle = { fontFamily: 'Arial', color: '#000000' };\n\n\nexport class CyberballScene extends Phaser.Scene {\n public settings: SettingsModel;\n\n // Game Objects:\n private player: Player;\n\n private ballSprite: Phaser.GameObjects.Sprite;\n private playerSprite: Phaser.GameObjects.Sprite;\n private playerGroup: Phaser.Physics.Arcade.Group;\n private cpuSprites: Phaser.GameObjects.Sprite[] = [];\n private timeLimitText: Phaser.GameObjects.Text;\n\n // Gameplay Mechanics:\n\n private playerHasBall = true;\n private ballHeld = true;\n private throwTarget: Phaser.GameObjects.Sprite;\n\n private activeTimeout;\n\n private absentPlayers: number[] = [];\n private showPlayerLeave: boolean = false;\n\n private gameEnded = false;\n\n // Stats:\n\n private throwCount = 0;\n private scheduleIndex = 0;\n private lastTime: number;\n private startTime: number;\n\n constructor(settings: SettingsModel) {\n super({});\n\n this.settings = settings;\n }\n\n public preload() {\n this.load.crossOrigin = 'anonymous';\n\n // TODO: Load from settings.\n this.load.image('ball', `${this.settings.baseUrl}/${this.settings.ballSprite}`);\n this.load.multiatlas('player', `${this.settings.baseUrl}/player.json`, 'assets');\n\n if(this.settings.player.portrait)\n this.load.image('playerPortrait', (this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + this.settings.player.portrait);\n\n this.settings.computerPlayers.forEach((cpu, i) => {\n if(cpu.portrait)\n this.load.image('cpuPortrait' + i, (this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + cpu.portrait);\n });\n }\n\n public create() {\n this.cameras.main.setBackgroundColor('#ffffff');\n\n // Animations:\n\n this.anims.create({\n key: 'active',\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'active/', suffix: '.png' })\n });\n\n this.anims.create({\n key: 'idle',\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'idle/', suffix: '.png' })\n });\n\n this.anims.create({\n key: 'throw',\n frameRate: 12,\n frames: this.anims.generateFrameNames('player', { start: 1, end: 3, prefix: 'throw/', suffix: '.png' })\n });\n\n this.anims.create({\n key: 'catch',\n frames: this.anims.generateFrameNames('player', { start: 1, end: 1, prefix: 'catch/', suffix: '.png' })\n });\n\n // Player:\n\n let playerPosition = this.getPlayerPosition();\n\n this.playerGroup = this.physics.add.group({ immovable: true, allowGravity: false });\n this.playerSprite = this.playerGroup.create(playerPosition.x, playerPosition.y, 'player', 'active/1.png');\n this.playerSprite.setData('settings', this.settings.player);\n\n if(this.settings.player.tint)\n this.playerSprite.setTint(parseInt(this.settings.player.tint.substr(1), 16));\n\n this.playerSprite.setData('name-object', this.add.text(playerPosition.x, playerPosition.y + this.playerSprite.height / 2 + 10, this.settings.player.name, textStyle).setOrigin(0.5));\n\n if(this.settings.player.portrait) {\n var portraitPosition = this.getPlayerPortraitPosition(this.playerSprite);\n var image = this.add.image(portraitPosition.x, portraitPosition.y, 'playerPortrait');\n\n image.setScale(this.settings.portraitHeight / image.height);\n }\n\n if((this.settings.player.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\n this.playerSprite.setData('leaveTime', Date.now() + this.getVariantValue(this.settings.player.leaveTime, this.settings.player.leaveTimeVariance) * 1000);\n }\n\n if((this.settings.player.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\n this.playerSprite.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(this.settings.player.leaveTimeIgnored, this.settings.player.leaveTimeIgnoredVariance) * 1000);\n }\n\n // CPU:\n\n for (let i = 0; i < this.settings.computerPlayers.length; i++) {\n let cpuPosition = this.getCPUPosition(i);\n let cpuSprite: Phaser.GameObjects.Sprite = this.playerGroup.create(cpuPosition.x, cpuPosition.y, 'player', 'idle/1.png');\n\n cpuSprite.setData('name-object', this.add.text(cpuPosition.x, cpuPosition.y + cpuSprite.height / 2 + 10, this.settings.computerPlayers[i].name, textStyle).setOrigin(0.5));\n\n if(this.settings.computerPlayers[i].portrait) {\n var portraitPosition = this.getCPUPortraitPosition(i, cpuSprite);\n var image = this.add.image(portraitPosition.x, portraitPosition.y, 'cpuPortrait' + i);\n\n image.setScale(this.settings.portraitHeight / image.height);\n }\n\n cpuSprite.flipX = cpuPosition.x > this.playerSprite.x;\n cpuSprite.setData('settings', this.settings.computerPlayers[i]);\n\n if(this.settings.computerPlayers[i].tint)\n cpuSprite.setTint(parseInt(this.settings.computerPlayers[i].tint.substr(1), 16));\n\n cpuSprite.setInteractive();\n cpuSprite.on('pointerdown', (e) => {\n if (this.playerHasBall) {\n // Ensure player and ball are facing the correct way on touch devices:\n this.playerSprite.flipX = this.input.x < this.playerSprite.x;\n\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\n this.ballSprite.x = ballPosition.x;\n this.ballSprite.y = ballPosition.y;\n\n this.throwBall(this.playerSprite, cpuSprite);\n }\n });\n\n if((this.settings.computerPlayers[i].leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time) {\n cpuSprite.setData('leaveTime', Date.now() + this.getVariantValue(this.settings.computerPlayers[i].leaveTime, this.settings.computerPlayers[i].leaveTimeVariance) * 1000);\n }\n\n if((this.settings.computerPlayers[i].leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\n cpuSprite.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(this.settings.computerPlayers[i].leaveTimeIgnored, this.settings.computerPlayers[i].leaveTimeIgnoredVariance) * 1000);\n }\n\n this.cpuSprites.push(cpuSprite);\n }\n\n // Ball:\n\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\n this.ballSprite = this.physics.add.sprite(ballPosition.x, ballPosition.y, 'ball');\n\n if(this.settings.ballTint)\n this.ballSprite.setTint(parseInt(this.settings.ballTint.substr(1), 16));\n\n this.physics.add.overlap(this.ballSprite, this.playerGroup, (_b, receiver) => {\n if (!this.ballHeld && receiver === this.throwTarget)\n this.catchBall(receiver as Phaser.GameObjects.Sprite);\n });\n\n // Time Limit:\n\n this.startTime = Date.now();\n this.lastTime = this.startTime;\n\n if (this.settings.timeLimit > 0 && this.settings.displayTimeLimit) {\n this.timeLimitText = this.add.text(this.sys.canvas.width - 10, 10, this.getTimeString(), textStyle);\n this.timeLimitText.setOrigin(1, 0);\n }\n }\n\n public update() {\n if(this.gameEnded)\n return;\n\n if (this.playerHasBall) {\n this.playerSprite.play('active');\n this.playerSprite.flipX = this.input.x < this.playerSprite.x;\n\n let ballPosition = this.getActiveBallPosition(this.playerSprite);\n this.ballSprite.x = ballPosition.x;\n this.ballSprite.y = ballPosition.y;\n } else if (!this.ballHeld) {\n // Eyes on the ball:\n this.playerGroup.getChildren().forEach(c => {\n let sprite = c as Phaser.GameObjects.Sprite;\n if (sprite.frame.name.includes('idle'))\n sprite.flipX = this.ballSprite.x < sprite.x\n });\n }\n\n // Player may leave after time has passed:\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time &&\n Date.now() > this.playerSprite.getData('leaveTime')) {\n this.showPlayerLeave = true;\n this.postEvent('player-may-leave', {\n reason: 'time elapsed'\n });\n }\n // Player may leave after ignored for a time:\n else if (!this.playerHasBall && !this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored &&\n Date.now() > this.playerSprite.getData('leaveTimeIgnored')) {\n this.showPlayerLeave = true;\n this.postEvent('player-may-leave', {\n reason: 'time ignored'\n });\n }\n\n this.cpuSprites.forEach(cpu => {\n // CPU shouldn't leave if they:\n // - have the ball or are about to catch the ball\n // - have already left\n if (cpu == this.throwTarget || cpu.getData('absent'))\n return;\n\n let settings = cpu.getData('settings') as CpuSettingsModel;\n\n // CPU may leave after some time\n if((settings.leaveTrigger & LeaveTrigger.Time) === LeaveTrigger.Time &&\n Date.now() > cpu.getData('leaveTime')) {\n this.leaveGame(cpu, 'time elapsed');\n }\n // CPU may leave after ignored for a time:\n else if ((settings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored &&\n Date.now() > cpu.getData('leaveTimeIgnored')) {\n this.leaveGame(cpu, 'time ignored');\n }\n });\n\n // Time Limit:\n\n if (this.settings.timeLimit > 0 && this.settings.displayTimeLimit)\n this.timeLimitText.setText(this.getTimeString());\n\n if (this.settings.timeLimit > 0 && Date.now() - this.startTime > this.settings.timeLimit) {\n this.postEvent('global-time-limit');\n this.gameOver();\n }\n }\n\n public gameOver() {\n if (this.gameEnded)\n return;\n\n this.gameEnded = true;\n\n this.postEvent('game-end');\n\n // Stop future throws:\n clearTimeout(this.activeTimeout);\n this.playerGroup.children.iterate(child => {\n child.removeAllListeners();\n return true;\n });\n\n // Draw game over screen:\n this.add.rectangle(this.sys.canvas.width / 2, this.sys.canvas.height / 2, this.sys.canvas.width, this.sys.canvas.height, 0xdddddd, this.settings.gameOverOpacity);\n this.add.text(this.sys.canvas.width / 2, this.sys.canvas.height / 2, this.settings.gameOverText, textStyle).setOrigin(0.5);\n }\n\n // Mechanics:\n\n public throwBall(thrower: Phaser.GameObjects.Sprite, receiver: Phaser.GameObjects.Sprite) {\n this.postEvent('throw', {\n thrower: thrower.getData('settings').name,\n receiver: receiver.getData('settings').name,\n wait: Date.now() - this.lastTime\n });\n\n this.lastTime = Date.now();\n\n // Update trackers:\n\n // Wait until the player throws the ball to reset their ignored timer, so they cannot ignore themselves.\n let throwerSettings = thrower.getData('settings');\n\n // BUG: Leave time does not reset https://github.com/CuddleBunny/osu-cyberball/issues/30\n if((throwerSettings.leaveTrigger & LeaveTrigger.TimeIgnored) === LeaveTrigger.TimeIgnored) {\n receiver.setData('leaveTimeIgnored', Date.now() + this.getVariantValue(throwerSettings.leaveTimeIgnored, throwerSettings.leaveTimeIgnoredVariance) * 1000);\n }\n\n this.playerHasBall = this.ballHeld = false;\n this.throwTarget = receiver;\n\n this.throwCount++;\n\n // Player animation:\n\n thrower.play('throw');\n thrower.playAfterRepeat('idle');\n\n // Ball physics:\n\n let ballTargetPosition = this.getCaughtBallPosition(receiver);\n this.physics.moveTo(this.ballSprite, ballTargetPosition.x, ballTargetPosition.y, this.settings.ballSpeed);\n }\n\n public catchBall(receiver: Phaser.GameObjects.Sprite) {\n // Update trackers:\n\n this.ballHeld = true;\n receiver.setData('throwsIgnored', 0)\n\n // Player animation:\n\n receiver.play('catch');\n\n // Ball physics:\n\n let ballPosition = this.getCaughtBallPosition(receiver);\n (this.ballSprite.body as Phaser.Physics.Arcade.Body).reset(ballPosition.x, ballPosition.y);\n\n // Check for leavers:\n\n // Player may leave after a number of turns:\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Turn) === LeaveTrigger.Turn) {\n let leaveThrows = this.getVariantValue(this.settings.player.leaveTurn, this.settings.player.leaveTurnVariance);\n\n if (this.throwCount >= leaveThrows) {\n this.showPlayerLeave = true;\n this.postEvent('player-may-leave', {\n reason: 'throws elapsed'\n });\n }\n }\n // Player may leave after ignored for a number of turns:\n else if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.Ignored) === LeaveTrigger.Ignored) {\n let leaveThrows = this.getVariantValue(this.settings.player.leaveIgnored, this.settings.player.leaveIgnoredVariance);\n let playerThrowsIgnored = this.playerSprite.getData('throwsIgnored') ?? 0;\n\n if(this.playerSprite != receiver)\n this.playerSprite.setData('throwsIgnored', ++playerThrowsIgnored);\n\n if (playerThrowsIgnored >= leaveThrows) {\n this.showPlayerLeave = true;\n this.postEvent('player-may-leave', {\n reason: 'throws ignored'\n });\n }\n }\n\n this.cpuSprites.forEach(cpu => {\n // CPU shouldn't leave if they:\n // - have the ball\n // - have already left\n if (cpu == receiver || cpu.getData('absent'))\n return;\n\n let settings = cpu.getData('settings') as CpuSettingsModel;\n let throwsIgnored = (cpu.getData('throwsIgnored') ?? 0) + 1;\n cpu.setData('throwsIgnored', throwsIgnored);\n\n // CPU may leave after a number of turns:\n if((settings.leaveTrigger & LeaveTrigger.Turn) === LeaveTrigger.Turn) {\n let leaveThrows = this.getVariantValue(settings.leaveTurn, settings.leaveTurnVariance);\n\n if (this.throwCount >= leaveThrows && this.checkChance(settings.leaveTurnChance))\n this.leaveGame(cpu, 'throws elapsed');\n }\n // CPU may leave after ignored for a number of turns:\n else if((settings.leaveTrigger & LeaveTrigger.Ignored) === LeaveTrigger.Ignored) {\n let leaveThrows = this.getVariantValue(settings.leaveIgnored, settings.leaveIgnoredVariance);\n\n if (throwsIgnored >= leaveThrows && this.checkChance(settings.leaveIgnoredChance))\n this.leaveGame(cpu, 'throws ignored');\n }\n });\n\n // The game ends at the end of the schedule or when reaching the throw count.\n\n if (\n (this.settings.useSchedule && this.scheduleIndex === this.settings.schedule.length) ||\n (this.settings.useSchedule && this.settings.scheduleHonorsThrowCount && this.throwCount >= this.settings.throwCount) ||\n (!this.settings.useSchedule && this.throwCount >= this.settings.throwCount)\n ) {\n this.postEvent('throw-count-met');\n this.gameOver();\n return;\n }\n\n // Prepare for next throw:\n\n if (receiver === this.playerSprite) {\n this.playerHasBall = true;\n } else {\n let settings = receiver.getData('settings') as CpuSettingsModel;\n\n this.activeTimeout = setTimeout(() => {\n receiver.play('active');\n\n ballPosition = this.getActiveBallPosition(receiver);\n this.ballSprite.x = ballPosition.x;\n this.ballSprite.y = ballPosition.y;\n\n this.activeTimeout = setTimeout(() => {\n if (this.settings.useSchedule) {\n // Skip self and absent players in schedule.\n while(this.settings.schedule[this.scheduleIndex] === this.playerGroup.getChildren().indexOf(receiver) &&\n !this.absentPlayers.includes(this.settings.schedule[this.scheduleIndex]))\n this.scheduleIndex++\n\n this.throwBall(receiver, this.playerGroup.getChildren()[this.settings.schedule[this.scheduleIndex]] as Phaser.GameObjects.Sprite)\n this.scheduleIndex++;\n } else {\n let random = Math.random() * 100;\n\n // A psuedo-random target is selected by subtracting the target preference chance from the random number until 0 is reached\n for (var i = 0; i < settings.targetPreference.length; i++) {\n random -= settings.targetPreference[i];\n\n if (random <= 0) {\n // Exclude self\n if (i >= this.playerGroup.getChildren().indexOf(receiver))\n i++\n\n this.throwBall(receiver, this.playerGroup.getChildren()[i] as Phaser.GameObjects.Sprite);\n\n break;\n }\n }\n }\n }, this.getVariantValue(settings.throwDelay, settings.throwDelayVariance));\n }, this.getVariantValue(settings.catchDelay, settings.catchDelayVariance))\n }\n }\n\n public leaveGame(player: Phaser.GameObjects.Sprite, reason: string = '') {\n let nameObject = player.getData('name-object') as Phaser.GameObjects.Text;\n let playerIndex = this.playerGroup.getChildren().indexOf(player);\n\n this.absentPlayers.push(playerIndex);\n player.setData('absent', true);\n\n nameObject.setText([nameObject.text, 'has left the game.']);\n\n // Deactivate player object\n\n player.removeAllListeners();\n player.setVisible(false);\n\n this.postEvent('leave', {\n leaver: player.getData('settings').name,\n reason: reason\n });\n\n // Redistribute throw target weights:\n\n console.log('pindex', playerIndex);\n\n this.settings.computerPlayers.forEach((cpu, i) => {\n if(this.absentPlayers.includes(i + 1))\n return;\n\n console.log('distribute before', i, cpu.targetPreference);\n\n let targetIndex = playerIndex > (i + 1) ? playerIndex - 1 : playerIndex;\n let targetWeight = cpu.targetPreference[targetIndex];\n cpu.targetPreference[targetIndex] = 0;\n let total = cpu.targetPreference.reduce((acc, cur) => acc + cur);\n\n for(let k = 0; k < cpu.targetPreference.length; k++) {\n if (cpu.targetPreference[k] == 0)\n continue;\n\n cpu.targetPreference[k] += cpu.targetPreference[k] / total * targetWeight;\n }\n\n console.log('distribute after', i, cpu.targetPreference);\n });\n\n // If there is only one player left, end the game:\n if (this.absentPlayers.length >= this.settings.computerPlayers.length) {\n this.gameOver();\n return;\n }\n\n // Check if this triggers other players leaving:\n\n if(!this.showPlayerLeave && (this.settings.player.leaveTrigger & LeaveTrigger.OtherLeaver) === LeaveTrigger.OtherLeaver) {\n console.log(this.absentPlayers.length, this.settings.player.leaveOtherLeaver);\n if (this.absentPlayers.length >= this.settings.player.leaveOtherLeaver) {\n this.showPlayerLeave = true;\n this.postEvent('player-may-leave', {\n reason: 'other leavers'\n });\n }\n }\n\n this.cpuSprites.forEach(cpu => {\n let settings = cpu.getData('settings') as CpuSettingsModel;\n\n // CPU shouldn't leave if they:\n // - have the ball\n // - have already left\n if (cpu == this.throwTarget || cpu.getData('absent'))\n return;\n\n if((settings.leaveTrigger & LeaveTrigger.OtherLeaver) === LeaveTrigger.OtherLeaver) {\n if (this.absentPlayers.length >= settings.leaveOtherLeaver && this.checkChance(settings.leaveOtherLeaverChance))\n this.leaveGame(cpu, 'other leavers');\n }\n });\n }\n\n // Helpers:\n\n getCPUPosition(i: number): Phaser.Geom.Point {\n // TODO: Increase padding when portaits are enabled.\n let padding = 75;\n let extraPadding = this.settings.hasPortraits ? this.settings.portraitHeight + this.settings.portraitPadding * 2 : 0;\n\n if(this.settings.computerPlayers.length === 1) {\n return new Phaser.Geom.Point(\n this.sys.canvas.width / 2,\n padding + extraPadding\n );\n }\n\n return new Phaser.Geom.Point(\n // Evenly divide the width of the screen by the number of players.\n ((this.sys.canvas.width - (padding * 2)) / (this.settings.computerPlayers.length - 1)) * i + padding,\n // First and last player are closer in the middle, others stand along the edge.\n i === 0 || i === this.settings.computerPlayers.length - 1\n ? (this.sys.canvas.height / 2)\n : padding + extraPadding\n );\n }\n\n getCPUPortraitPosition(i: number, sprite: Phaser.GameObjects.Sprite): Phaser.Geom.Point {\n let position = this.getCPUPosition(i);\n\n return new Phaser.Geom.Point(\n position.x,\n position.y - this.settings.portraitHeight + this.settings.portraitPadding * 2 - sprite.height / 2\n );\n }\n\n getPlayerPosition(): Phaser.Geom.Point {\n let padding = 75;\n\n if(this.settings.hasPortraits)\n padding += this.settings.portraitHeight + this.settings.portraitPadding * 2;\n\n return new Phaser.Geom.Point(\n this.sys.canvas.width / 2,\n this.sys.canvas.height - padding\n );\n }\n\n getPlayerPortraitPosition(sprite: Phaser.GameObjects.Sprite): Phaser.Geom.Point {\n var position = this.getPlayerPosition();\n\n return new Phaser.Geom.Point(\n position.x,\n position.y + this.settings.portraitHeight / 2 + this.settings.portraitPadding * 2 + sprite.height / 2 + 10\n );\n }\n\n // TODO: This is invalid if the sprites are changed.\n getCaughtBallPosition(target: Phaser.GameObjects.Sprite) {\n return new Phaser.Geom.Point(target.x + (target.flipX ? -50 : 50), target.y - 15);\n }\n\n // TODO: This is invalid if the sprites are changed.\n getActiveBallPosition(target: Phaser.GameObjects.Sprite) {\n return new Phaser.Geom.Point(target.x + (target.flipX ? 40 : -40), target.y - 20);\n }\n\n getVariantValue(base: number, variance: number): number {\n return base + (Phaser.Math.RND.between(0, variance) * Phaser.Math.RND.sign());\n }\n\n checkChance(chance: number): boolean {\n return Phaser.Math.RND.between(0, 100) <= chance;\n }\n\n getTimeString(): string {\n let timeRemaining = this.settings.timeLimit - (Date.now() - this.startTime);\n let time = new Date(timeRemaining < 0 ? 0 : timeRemaining);\n\n return `${this.settings.timeLimitText} ${time.getUTCMinutes()}:${time.getUTCSeconds() < 10 ? '0' : ''}${time.getUTCSeconds()}`;\n }\n\n postEvent(type: string, data: any = {}): void {\n console.log('post event: ' + type, data);\n\n window.parent.postMessage({\n type: type,\n ...data\n }, '*');\n }\n}\n"]} \ No newline at end of file diff --git a/src/models/settings-model.ts b/src/models/settings-model.ts index 83637ab..e5c9376 100644 --- a/src/models/settings-model.ts +++ b/src/models/settings-model.ts @@ -32,6 +32,8 @@ export class SettingsModel { } // Misc + useCorsProxy: boolean = true; + chatEnabled: boolean = false; gameOverText: string = "Game Over"; diff --git a/src/pages/home.html b/src/pages/home.html index bdfcadf..6720093 100644 --- a/src/pages/home.html +++ b/src/pages/home.html @@ -315,6 +315,13 @@

Gameplay

+

Misc

+ +
+ + +
+ diff --git a/src/scenes/cyberball.ts b/src/scenes/cyberball.ts index 669ce45..d52c60c 100644 --- a/src/scenes/cyberball.ts +++ b/src/scenes/cyberball.ts @@ -53,11 +53,11 @@ export class CyberballScene extends Phaser.Scene { this.load.multiatlas('player', `${this.settings.baseUrl}/player.json`, 'assets'); if(this.settings.player.portrait) - this.load.image('playerPortrait', 'https://proxy.cors.sh/' + this.settings.player.portrait); + this.load.image('playerPortrait', (this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + this.settings.player.portrait); this.settings.computerPlayers.forEach((cpu, i) => { if(cpu.portrait) - this.load.image('cpuPortrait' + i, 'https://proxy.cors.sh/' + cpu.portrait); + this.load.image('cpuPortrait' + i, (this.settings.useCorsProxy ? 'https://proxy.cors.sh/' : '') + cpu.portrait); }); }