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,UAAUS,OAAO,QAC1Bqd,EACGvd,uBAAuB,aAAa,GACpCP,UAAUK,IAAI,UACjByd,EACGvd,uBAAuB,cAAc,GACrCP,UAAUS,OAAO,UACpBqd,EAAc9d,UAAUS,OAAO,QAE/Bob,GAAOgD,KAAK5C,IACZqC,EAAWte,UAAUS,OAAO,UAC5B2b,EAAS1E,oBAAoB,QAASkH,GACtCd,EAAcpG,oBAAoB,QAASkH,IAE7CxC,EAASvb,iBAAiB,QAAS+d,GACnCd,EAAcjd,iBAAiB,QAAS+d,GAjD1CE,I","sources":["webpack://pikachu-volleyball/./src/resources/js/assets_path.js","webpack://pikachu-volleyball/./src/resources/js/rand.js","webpack://pikachu-volleyball/./src/resources/js/utils/serialize.js","webpack://pikachu-volleyball/./src/resources/js/utils/input_conversion.js","webpack://pikachu-volleyball/./src/resources/js/replay/replay_saver.js","webpack://pikachu-volleyball/./src/resources/js/utils/hash_code.js","webpack://pikachu-volleyball/./src/resources/js/ui.js","webpack://pikachu-volleyball/./src/resources/js/physics.js","webpack://pikachu-volleyball/./src/resources/js/cloud_and_wave.js","webpack://pikachu-volleyball/./src/resources/js/view.js","webpack://pikachu-volleyball/./src/resources/js/keyboard.js","webpack://pikachu-volleyball/./src/resources/js/audio.js","webpack://pikachu-volleyball/./src/resources/js/pikavolley.js","webpack://pikachu-volleyball/./src/resources/js/main.js"],"sourcesContent":["/**\n * Manages the paths (file locations) of the game assets.\n */\n'use strict';\n\nexport const ASSETS_PATH = {\n SPRITE_SHEET: '../resources/assets/images/sprite_sheet.json',\n TEXTURES: {},\n SOUNDS: {},\n};\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\nTEXTURES.PIKACHU = (i, j) => `pikachu/pikachu_${i}_${j}.png`;\nTEXTURES.BALL = (s) => `ball/ball_${s}.png`;\nTEXTURES.NUMBER = (n) => `number/number_${n}.png`;\n\nTEXTURES.SKY_BLUE = 'objects/sky_blue.png';\nTEXTURES.MOUNTAIN = 'objects/mountain.png';\nTEXTURES.GROUND_RED = 'objects/ground_red.png';\nTEXTURES.GROUND_LINE = 'objects/ground_line.png';\nTEXTURES.GROUND_LINE_LEFT_MOST = 'objects/ground_line_leftmost.png';\nTEXTURES.GROUND_LINE_RIGHT_MOST = 'objects/ground_line_rightmost.png';\nTEXTURES.GROUND_YELLOW = 'objects/ground_yellow.png';\nTEXTURES.NET_PILLAR_TOP = 'objects/net_pillar_top.png';\nTEXTURES.NET_PILLAR = 'objects/net_pillar.png';\nTEXTURES.SHADOW = 'objects/shadow.png';\nTEXTURES.BALL_HYPER = 'ball/ball_hyper.png';\nTEXTURES.BALL_TRAIL = 'ball/ball_trail.png';\nTEXTURES.BALL_PUNCH = 'ball/ball_punch.png';\nTEXTURES.CLOUD = 'objects/cloud.png';\nTEXTURES.WAVE = 'objects/wave.png';\n\nTEXTURES.SACHISOFT = 'messages/common/sachisoft.png';\nTEXTURES.READY = 'messages/common/ready.png';\nTEXTURES.GAME_END = 'messages/common/game_end.png';\n\nTEXTURES.MARK = 'messages/ja/mark.png';\nTEXTURES.POKEMON = 'messages/ja/pokemon.png';\nTEXTURES.PIKACHU_VOLLEYBALL = 'messages/ja/pikachu_volleyball.png';\nTEXTURES.FIGHT = 'messages/ja/fight.png';\nTEXTURES.WITH_COMPUTER = 'messages/ja/with_computer.png';\nTEXTURES.WITH_FRIEND = 'messages/ja/with_friend.png';\nTEXTURES.GAME_START = 'messages/ja/game_start.png';\n\nTEXTURES.SITTING_PIKACHU = 'sitting_pikachu.png';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\nSOUNDS.BGM = '../resources/assets/sounds/bgm.mp3';\nSOUNDS.PIPIKACHU = '../resources/assets/sounds/WAVE140_1.wav';\nSOUNDS.PIKA = '../resources/assets/sounds/WAVE141_1.wav';\nSOUNDS.CHU = '../resources/assets/sounds/WAVE142_1.wav';\nSOUNDS.PI = '../resources/assets/sounds/WAVE143_1.wav';\nSOUNDS.PIKACHU = '../resources/assets/sounds/WAVE144_1.wav';\nSOUNDS.POWERHIT = '../resources/assets/sounds/WAVE145_1.wav';\nSOUNDS.BALLTOUCHESGROUND = '../resources/assets/sounds/WAVE146_1.wav';\n","/**\n * This module contains random number generator used for the game\n */\n'use strict';\n/** @typedef {function():number} RNG */\n\n/** @type {RNG} custom RNG (random number generator) function which generates a random number in [0, 1] */\nlet customRng = null;\n\n/**\n * Return random integer in [0, 32767]\n *\n * The machine code of the original game use \"_rand()\" function in Visual Studio 1988 Library.\n * I could't find out how this function works exactly.\n * But, anyhow, it should be a funtion that generate a random number.\n * I decided to use custom rand function which generates random integer in [0, 32767]\n * which follows rand() function in Visual Studio 2017 Library.\n *\n * By default, it uses the function \"Math.random\" for generating a random number.\n * A custom RNG function can used by setting the \"customRng\" as the custom RNG function.\n *\n * @return {number} random integer\n */\nexport function rand() {\n if (customRng === null) {\n return Math.floor(32768 * Math.random());\n }\n return Math.floor(32768 * customRng());\n}\n\n/**\n * Set custom RNG function\n * @param {RNG} rng\n */\nexport function setCustomRng(rng) {\n customRng = rng;\n}\n\n/**\n *\n * @return {number} random integer\n */\nexport function true_rand() {\n return Math.floor(32768 * Math.random());\n}\n","// Copied from: https://github.com/fraunhoferfokus/JSum/blob/master/README.md\n// And just add the \"export\" keyword on the function definition\n// The license is below the code.\n\n/**\n * Stringifies a JSON object (not any randon JS object).\n *\n * It should be noted that JS objects can have members of\n * specific type (e.g. function), that are not supported\n * by JSON.\n *\n * @param {Object} obj JSON object\n * @returns {String} stringified JSON object.\n */\nexport function serialize(obj) {\n if (Array.isArray(obj)) {\n return JSON.stringify(obj.map((i) => serialize(i)));\n } else if (typeof obj === 'object' && obj !== null) {\n return Object.keys(obj)\n .sort()\n .map((k) => `${k}:${serialize(obj[k])}`)\n .join('|');\n }\n\n return obj;\n}\n\n/*\nGNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\nCopyright (C) 2007 Free Software Foundation, Inc. \nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n\n Preamble\n\nThe GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\nThe licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\nWhen we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\nDevelopers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\nA secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate. Many developers of free software are heartened and\nencouraged by the resulting cooperation. However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\nThe GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community. It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server. Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\nAn older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals. This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\nThe precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n0. Definitions.\n\n\"This License\" refers to version 3 of the GNU Affero General Public License.\n\n\"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n\"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\nTo \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\nA \"covered work\" means either the unmodified Program or a work based\non the Program.\n\nTo \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\nTo \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\nAn interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n1. Source Code.\n\nThe \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\nA \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\nThe \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\nThe \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\nThe Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\nThe Corresponding Source for a work in source code form is that\nsame work.\n\n2. Basic Permissions.\n\nAll rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\nYou may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\nConveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\nNo covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\nWhen you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n4. Conveying Verbatim Copies.\n\nYou may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\nYou may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n5. Conveying Modified Source Versions.\n\nYou may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\na) The work must carry prominent notices stating that you modified\nit, and giving a relevant date.\n\nb) The work must carry prominent notices stating that it is\nreleased under this License and any conditions added under section\n7. This requirement modifies the requirement in section 4 to\n\"keep intact all notices\".\n\nc) You must license the entire work, as a whole, under this\nLicense to anyone who comes into possession of a copy. This\nLicense will therefore apply, along with any applicable section 7\nadditional terms, to the whole of the work, and all its parts,\nregardless of how they are packaged. This License gives no\npermission to license the work in any other way, but it does not\ninvalidate such permission if you have separately received it.\n\nd) If the work has interactive user interfaces, each must display\nAppropriate Legal Notices; however, if the Program has interactive\ninterfaces that do not display Appropriate Legal Notices, your\nwork need not make them do so.\n\nA compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n6. Conveying Non-Source Forms.\n\nYou may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\na) Convey the object code in, or embodied in, a physical product\n(including a physical distribution medium), accompanied by the\nCorresponding Source fixed on a durable physical medium\ncustomarily used for software interchange.\n\nb) Convey the object code in, or embodied in, a physical product\n(including a physical distribution medium), accompanied by a\nwritten offer, valid for at least three years and valid for as\nlong as you offer spare parts or customer support for that product\nmodel, to give anyone who possesses the object code either (1) a\ncopy of the Corresponding Source for all the software in the\nproduct that is covered by this License, on a durable physical\nmedium customarily used for software interchange, for a price no\nmore than your reasonable cost of physically performing this\nconveying of source, or (2) access to copy the\nCorresponding Source from a network server at no charge.\n\nc) Convey individual copies of the object code with a copy of the\nwritten offer to provide the Corresponding Source. This\nalternative is allowed only occasionally and noncommercially, and\nonly if you received the object code with such an offer, in accord\nwith subsection 6b.\n\nd) Convey the object code by offering access from a designated\nplace (gratis or for a charge), and offer equivalent access to the\nCorresponding Source in the same way through the same place at no\nfurther charge. You need not require recipients to copy the\nCorresponding Source along with the object code. If the place to\ncopy the object code is a network server, the Corresponding Source\nmay be on a different server (operated by you or a third party)\nthat supports equivalent copying facilities, provided you maintain\nclear directions next to the object code saying where to find the\nCorresponding Source. Regardless of what server hosts the\nCorresponding Source, you remain obligated to ensure that it is\navailable for as long as needed to satisfy these requirements.\n\ne) Convey the object code using peer-to-peer transmission, provided\nyou inform other peers where the object code and Corresponding\nSource of the work are being offered to the general public at no\ncharge under subsection 6d.\n\nA separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\nA \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n\"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\nIf you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\nThe requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\nCorresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n7. Additional Terms.\n\n\"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\nWhen you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\nNotwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\na) Disclaiming warranty or limiting liability differently from the\nterms of sections 15 and 16 of this License; or\n\nb) Requiring preservation of specified reasonable legal notices or\nauthor attributions in that material or in the Appropriate Legal\nNotices displayed by works containing it; or\n\nc) Prohibiting misrepresentation of the origin of that material, or\nrequiring that modified versions of such material be marked in\nreasonable ways as different from the original version; or\n\nd) Limiting the use for publicity purposes of names of licensors or\nauthors of the material; or\n\ne) Declining to grant rights under trademark law for use of some\ntrade names, trademarks, or service marks; or\n\nf) Requiring indemnification of licensors and authors of that\nmaterial by anyone who conveys the material (or modified versions of\nit) with contractual assumptions of liability to the recipient, for\nany liability that these contractual assumptions directly impose on\nthose licensors and authors.\n\nAll other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\nIf you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\nAdditional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n8. Termination.\n\nYou may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\nHowever, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\nMoreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\nTermination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n9. Acceptance Not Required for Having Copies.\n\nYou are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n10. Automatic Licensing of Downstream Recipients.\n\nEach time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\nAn \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\nYou may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n11. Patents.\n\nA \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\nA contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\nEach contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\nIn the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\nIf you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\nIf, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\nA patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\nNothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n12. No Surrender of Others' Freedom.\n\nIf conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n13. Remote Network Interaction; Use with the GNU General Public License.\n\nNotwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software. This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\nNotwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n14. Revised Versions of this License.\n\nThe Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time. Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\nIf the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\nLater license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n15. Disclaimer of Warranty.\n\nTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n16. Limitation of Liability.\n\nIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n17. Interpretation of Sections 15 and 16.\n\nIf the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\nHow to Apply These Terms to Your New Programs\n\nIf you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\nTo do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n\nCopyright (C) \n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source. For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code. There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\nYou should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n.\n*/\n","import { PikaUserInput } from '../physics.js';\n\n/**\n * Convert PikaUserInput object to a 5-bit number.\n *\n * Input is converted to 5-bit number (so fit in 1 byte = 8 bits).\n * input.xDirection: 2bits. 0: 00, 1: 01, -1: 11.\n * input.yDirection: 2bits. 0: 00, 1: 01, -1: 11.\n * input.powerHit: 1bits. 0: 0, 1: 1.\n * The bits order is input.powerHit, input.yDirection, input.xDirection.\n *\n * @param {PikaUserInput} input PikaUserInput object\n * @return {number} 5-bit number\n */\nexport function convertUserInputTo5bitNumber(input) {\n let n = 0;\n switch (input.xDirection) {\n case 1:\n n += 1;\n break;\n case -1:\n n += (1 << 1) + 1;\n break;\n }\n switch (input.yDirection) {\n case 1:\n n += 1 << 2;\n break;\n case -1:\n n += (1 << 3) + (1 << 2);\n break;\n }\n switch (input.powerHit) {\n case 1:\n n += 1 << 4;\n break;\n }\n return n;\n}\n\n/**\n * Convert 5-bit number to PikaUserInput object\n * @param {number} n 5-bit number\n */\nexport function convert5bitNumberToUserInput(n) {\n const input = new PikaUserInput();\n switch (n % (1 << 2)) {\n case 0:\n input.xDirection = 0;\n break;\n case 1:\n input.xDirection = 1;\n break;\n case 3:\n input.xDirection = -1;\n break;\n }\n switch ((n >>> 2) % (1 << 2)) {\n case 0:\n input.yDirection = 0;\n break;\n case 1:\n input.yDirection = 1;\n break;\n case 3:\n input.yDirection = -1;\n break;\n }\n input.powerHit = n >>> 4;\n return input;\n}\n","import { saveAs } from 'file-saver';\nimport { serialize } from '../utils/serialize.js';\nimport { getHashCode } from '../utils/hash_code.js';\nimport { convertUserInputTo5bitNumber } from '../utils/input_conversion.js';\n\n/** @typedef {import('../physics.js').PikaUserInput} PikaUserInput */\n/** @typedef {{speed: string, winningScore: number}} Options options communicated with the peer */\n\n/**\n * Classs representing replay saver\n */\nclass ReplaySaver {\n constructor() {\n this.frameCounter = 0;\n this.roomID = ''; // used for set RNGs\n this.nicknames = ['', '']; // [0]: room creator's nickname, [1]: room joiner's nickname\n this.partialPublicIPs = ['', '']; // [0]: room creator's partial public IP address, [1]: room joiner's partial public IP address\n this.inputs = []; // number[], the number in the array represents player1, player2 input\n this.options = [[0, { speed: 'fast', winningScore: 15 }]]; // [frameCounter, options][];\n this.chats = []; // [frameCounter, playerIndex (1 or 2), chatMessage][]\n }\n\n /**\n * Record room ID for RNGs to be used for replay\n * @param {string} roomID\n */\n recordRoomID(roomID) {\n this.roomID = roomID;\n }\n\n /**\n * Record nicknames\n * @param {string} roomCreatorNickname\n * @param {string} roomJoinerNickname\n */\n recordNicknames(roomCreatorNickname, roomJoinerNickname) {\n this.nicknames[0] = roomCreatorNickname;\n this.nicknames[1] = roomJoinerNickname;\n }\n\n /**\n * Record partial public ips\n * @param {string} roomCreatorPartialPublicIP\n * @param {string} roomJoinerPartialPublicIP\n */\n recordPartialPublicIPs(\n roomCreatorPartialPublicIP,\n roomJoinerPartialPublicIP\n ) {\n this.partialPublicIPs[0] = roomCreatorPartialPublicIP;\n this.partialPublicIPs[1] = roomJoinerPartialPublicIP;\n }\n\n /**\n * Record user inputs\n * @param {PikaUserInput} player1Input\n * @param {PikaUserInput} player2Input\n */\n recordInputs(player1Input, player2Input) {\n const usersInputNumber =\n (convertUserInputTo5bitNumber(player1Input) << 5) +\n convertUserInputTo5bitNumber(player2Input);\n this.inputs.push(usersInputNumber);\n this.frameCounter++;\n }\n\n cleanRecord() {\n this.inputs = [];\n this.frameCounter = 0;\n }\n\n /**\n * Record game options\n * @param {Options} options\n */\n recordOptions(options) {\n this.options.push([this.frameCounter, options]);\n }\n\n /**\n * Record a chat message\n * @param {string} chatMessage\n * @param {number} whichPlayerSide 1 or 2\n */\n recordChats(chatMessage, whichPlayerSide) {\n this.chats.push([this.frameCounter, whichPlayerSide, chatMessage]);\n }\n\n /**\n * Save as a file\n */\n saveAsFile() {\n const pack = {\n version: 'p2p-online',\n roomID: this.roomID,\n nicknames: this.nicknames,\n partialPublicIPs: this.partialPublicIPs,\n chats: this.chats,\n options: this.options,\n inputs: this.inputs,\n hash: 0,\n };\n\n // This is for making it annoying to modify/fabricate the replay file.\n // I'm worried about fabricating the replay file and distributing it even if it is unlikely.\n // I doubt about the effect of inserting a hash code. But It would be better than doing nothing.\n const hash = getHashCode(serialize(pack));\n pack.hash = hash;\n\n const packWithComment = {\n _comment:\n 'Replay Viewer at: https://gorisanson.github.io/pikachu-volleyball-p2p-online/en/replay/',\n pack: pack,\n };\n\n const blob = new Blob([JSON.stringify(packWithComment)], {\n type: 'text/plain;charset=utf-8',\n });\n const d = new Date();\n // The code removing illegal characters in Windows by replace method is from:\n // https://stackoverflow.com/a/42210346/8581025\n const filename = `${d.getFullYear()}${('0' + (d.getMonth() + 1)).slice(\n -2\n )}${('0' + d.getDate()).slice(-2)}_${('0' + d.getHours()).slice(-2)}${(\n '0' + d.getMinutes()\n ).slice(-2)}_${this.nicknames[0]}_${this.partialPublicIPs[0].replace(\n '.*.*',\n ''\n )}_vs_${this.nicknames[1]}_${this.partialPublicIPs[1].replace(\n '.*.*',\n ''\n )}.txt`.replace(/[/\\\\?%*:|\"<>]/g, '_');\n saveAs(blob, filename, { autoBom: true });\n }\n}\n\nexport const replaySaver = new ReplaySaver();\n","/**\n * Get hashCode for the string.\n * Refered from: https://stackoverflow.com/a/7616484/8581025\n * (original source: https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/)\n *\n * @param {string} s\n */\nexport function getHashCode(s) {\n let hash = 0;\n for (let i = 0; i < s.length; i++) {\n hash = (hash << 5) - hash + s.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n}\n","/**\n * Manages event listeners relevant to the UI (menu bar, buttons, etc.) of the web page\n */\n'use strict';\n\nimport { replaySaver } from './replay/replay_saver.js';\n\n/** @typedef {import('./pikavolley.js').PikachuVolleyball} PikachuVolleyball */\n/** @typedef {import('pixi.js-legacy').Ticker} Ticker */\nexport var SkillTypeForPlayer1Available = [\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n];\nexport var SkillTypeForPlayer2Available = [\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n true,\n];\nexport var capability = {\n serve: false,\n fancy: true,\n block: true,\n diving: true,\n anti_block: true,\n early_ball: false,\n jump: false,\n};\nexport var delay = 0; // 3 is good\nexport var defense = 4; // mid, mid_mirror, mirror, predict, close\n\nconst level = [\n [false, false, false, false, false, false, true, 10, 0], // 新手\n [false, false, false, false, false, false, false, 10, 0], // 練下前殺\n [false, false, false, true, false, false, false, 8, 1], // 練平殺\n [false, false, true, true, true, false, false, 8, 3], // 練上殺\n [false, false, true, true, true, false, false, 4, 2], // 練穿越下前殺\n [false, false, true, true, true, false, false, 4, 1], // 練下殺\n [false, false, true, true, true, false, true, 1, 4], // 超級同步跳\n [false, false, true, true, false, true, false, 1, 4], // 提早球\n [false, false, true, true, true, false, false, 1, 3], // 打穩\n [false, true, true, true, true, false, false, 0, 2], // 鏡像\n [false, true, true, true, true, false, false, 0, 4], // 無敵\n];\n/**\n * Enum for \"game paused by what?\".\n * The greater the number, the higher the precedence.\n *\n * @readonly\n * @enum {number}\n */\nconst PauseResumePrecedence = {\n pauseBtn: 3,\n messageBox: 2,\n dropdown: 1,\n notPaused: 0,\n};\n\n/**\n * Manages pausing and resuming of the game\n */\nconst pauseResumeManager = {\n /** @type {number} PauseResumePrecedence enum */\n _precedence: PauseResumePrecedence.notPaused,\n /**\n * Pause game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n pause: function (pikaVolley, precedence) {\n // @ts-ignore\n if (precedence > this._precedence) {\n pikaVolley.paused = true;\n this._precedence = precedence;\n }\n },\n /**\n * Resume game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n resume: function (pikaVolley, precedence) {\n if (precedence === this._precedence) {\n pikaVolley.paused = false;\n this._precedence = PauseResumePrecedence.notPaused;\n }\n },\n};\n\n/**\n * Set up the user interface: menu bar, buttons, dropdowns, submenus, etc.\n * @param {PikachuVolleyball} pikaVolley\n * @param {Ticker} ticker\n */\nexport function setUpUI(pikaVolley, ticker) {\n setUpBtns(pikaVolley, ticker);\n setUpToShowDropdownsAndSubmenus(pikaVolley);\n\n // hide or show menubar if the user presses the \"esc\" key\n window.addEventListener('keydown', (event) => {\n if (event.code === 'Escape') {\n const menuBar = document.getElementById('menu-bar');\n if (menuBar.classList.contains('hidden')) {\n menuBar.classList.remove('hidden');\n } else {\n menuBar.classList.add('hidden');\n }\n event.preventDefault();\n } else if (event.code === 'Space') {\n const aboutBox = document.getElementById('about-box');\n if (aboutBox.classList.contains('hidden')) {\n event.preventDefault();\n }\n }\n });\n}\n\n/**\n * Attach event listeners to the buttons\n * @param {PikachuVolleyball} pikaVolley\n * @param {Ticker} ticker\n */\nfunction setUpBtns(pikaVolley, ticker) {\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n const aboutBtn = document.getElementById('about-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n\n const pauseBtn = document.getElementById('pause-btn');\n pauseBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n } else {\n pauseBtn.classList.add('selected');\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n });\n\n const restartBtn = document.getElementById('restart-btn');\n restartBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n pikaVolley.restart();\n });\n\n const bgmOnBtn = document.getElementById('bgm-on-btn');\n const bgmOffBtn = document.getElementById('bgm-off-btn');\n bgmOnBtn.addEventListener('click', () => {\n bgmOffBtn.classList.remove('selected');\n bgmOnBtn.classList.add('selected');\n pikaVolley.audio.turnBGMVolume(true);\n });\n bgmOffBtn.addEventListener('click', () => {\n bgmOnBtn.classList.remove('selected');\n bgmOffBtn.classList.add('selected');\n pikaVolley.audio.turnBGMVolume(false);\n });\n\n const stereoBtn = document.getElementById('stereo-btn');\n const monoBtn = document.getElementById('mono-btn');\n const sfxOffBtn = document.getElementById('sfx-off-btn');\n stereoBtn.addEventListener('click', () => {\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.add('selected');\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = true;\n });\n monoBtn.addEventListener('click', () => {\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.remove('selected');\n monoBtn.classList.add('selected');\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = false;\n });\n sfxOffBtn.addEventListener('click', () => {\n stereoBtn.classList.remove('selected');\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.add('selected');\n pikaVolley.audio.turnSFXVolume(false);\n });\n\n // Game speed:\n // slow: 1 frame per 50ms = 20 FPS\n // medium: 1 frame per 40ms = 25 FPS\n // fast: 1 frame per 33ms = 30.303030... FPS\n const slowSpeedBtn = document.getElementById('slow-speed-btn');\n const mediumSpeedBtn = document.getElementById('medium-speed-btn');\n const fastSpeedBtn = document.getElementById('fast-speed-btn');\n slowSpeedBtn.addEventListener('click', () => {\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.add('selected');\n\n pikaVolley.normalFPS = 20;\n ticker.maxFPS = pikaVolley.normalFPS;\n replaySaver.recordOptions({\n speed: 'slow',\n winningScore: pikaVolley.winningScore,\n });\n });\n mediumSpeedBtn.addEventListener('click', () => {\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.add('selected');\n\n pikaVolley.normalFPS = 25;\n ticker.maxFPS = pikaVolley.normalFPS;\n replaySaver.recordOptions({\n speed: 'medium',\n winningScore: pikaVolley.winningScore,\n });\n });\n fastSpeedBtn.addEventListener('click', () => {\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.add('selected');\n\n pikaVolley.normalFPS = 30;\n ticker.maxFPS = pikaVolley.normalFPS;\n replaySaver.recordOptions({\n speed: 'fast',\n winningScore: pikaVolley.winningScore,\n });\n });\n\n const winningScore5Btn = document.getElementById('winning-score-5-btn');\n const winningScore10Btn = document.getElementById('winning-score-10-btn');\n const winningScore15Btn = document.getElementById('winning-score-15-btn');\n const noticeBox1 = document.getElementById('notice-box-1');\n const noticeOKBtn1 = document.getElementById('notice-ok-btn-1');\n const winningScoreInNoticeBox1 = document.getElementById(\n 'winning-score-in-notice-box-1'\n );\n function isWinningScoreAlreadyReached(winningScore) {\n const isGamePlaying =\n pikaVolley.state === pikaVolley.round ||\n pikaVolley.state === pikaVolley.afterEndOfRound ||\n pikaVolley.state === pikaVolley.beforeStartOfNextRound;\n if (\n isGamePlaying &&\n (pikaVolley.scores[0] >= winningScore ||\n pikaVolley.scores[1] >= winningScore)\n ) {\n return true;\n }\n return false;\n }\n const noticeBox2 = document.getElementById('notice-box-2');\n const noticeOKBtn2 = document.getElementById('notice-ok-btn-2');\n winningScore5Btn.addEventListener('click', () => {\n if (winningScore5Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(5)) {\n winningScoreInNoticeBox1.textContent = '5';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.remove('selected');\n winningScore5Btn.classList.add('selected');\n pikaVolley.winningScore = 5;\n replaySaver.recordOptions({\n speed:\n pikaVolley.normalFPS === 30\n ? 'fast'\n : pikaVolley.normalFPS === 25\n ? 'medium'\n : 'slow',\n winningScore: 5,\n });\n });\n winningScore10Btn.addEventListener('click', () => {\n if (winningScore10Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(10)) {\n winningScoreInNoticeBox1.textContent = '10';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n winningScore5Btn.classList.remove('selected');\n winningScore15Btn.classList.remove('selected');\n winningScore10Btn.classList.add('selected');\n pikaVolley.winningScore = 10;\n replaySaver.recordOptions({\n speed:\n pikaVolley.normalFPS === 30\n ? 'fast'\n : pikaVolley.normalFPS === 25\n ? 'medium'\n : 'slow',\n winningScore: 10,\n });\n });\n winningScore15Btn.addEventListener('click', () => {\n if (winningScore15Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(15)) {\n winningScoreInNoticeBox1.textContent = '15';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n winningScore5Btn.classList.remove('selected');\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.add('selected');\n pikaVolley.winningScore = 15;\n replaySaver.recordOptions({\n speed:\n pikaVolley.normalFPS === 30\n ? 'fast'\n : pikaVolley.normalFPS === 25\n ? 'medium'\n : 'slow',\n winningScore: 15,\n });\n });\n noticeOKBtn1.addEventListener('click', () => {\n if (!noticeBox1.classList.contains('hidden')) {\n noticeBox1.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n noticeOKBtn2.addEventListener('click', () => {\n if (!noticeBox2.classList.contains('hidden')) {\n noticeBox2.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n\n const practiceModeOnBtn = document.getElementById('practice-mode-on-btn');\n const practiceModeOffBtn = document.getElementById('practice-mode-off-btn');\n practiceModeOnBtn.addEventListener('click', () => {\n practiceModeOffBtn.classList.remove('selected');\n practiceModeOnBtn.classList.add('selected');\n pikaVolley.isPracticeMode = true;\n });\n practiceModeOffBtn.addEventListener('click', () => {\n practiceModeOnBtn.classList.remove('selected');\n practiceModeOffBtn.classList.add('selected');\n pikaVolley.isPracticeMode = false;\n });\n\n const aboutBox = document.getElementById('about-box');\n const closeAboutBtn = document.getElementById('close-about-btn');\n aboutBtn.addEventListener('click', () => {\n if (aboutBox.classList.contains('hidden')) {\n aboutBox.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n } else {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n closeAboutBtn.addEventListener('click', () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n}\n\n/**\n * Attach event listeners to show dropdowns and submenus properly\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction setUpToShowDropdownsAndSubmenus(pikaVolley) {\n // hide dropdowns and submenus if the user clicks outside of these\n window.addEventListener('click', (event) => {\n // @ts-ignore\n if (!event.target.matches('.dropdown-btn, .submenu-btn')) {\n hideSubmenus();\n hideDropdownsExcept('');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n });\n\n // set up to show dropdowns\n document.getElementById('game-dropdown-btn').addEventListener('click', () => {\n toggleDropdown('game-dropdown', pikaVolley);\n });\n document\n .getElementById('options-dropdown-btn')\n .addEventListener('click', () => {\n toggleDropdown('options-dropdown', pikaVolley);\n });\n // set up to show submenus on mouseover event\n document\n .getElementById('bgm-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document\n .getElementById('sfx-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document\n .getElementById('speed-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n // set up to show submenus on click event\n // (it is for touch device equipped with physical keyboard)\n document.getElementById('bgm-submenu-btn').addEventListener('click', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document.getElementById('sfx-submenu-btn').addEventListener('click', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document.getElementById('speed-submenu-btn').addEventListener('click', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n}\n\n/**\n * Toggle (show or hide) the dropdown menu\n * @param {string} dropdownID html element id of the dropdown to toggle\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction toggleDropdown(dropdownID, pikaVolley) {\n hideSubmenus();\n hideDropdownsExcept(dropdownID);\n const willShow = document.getElementById(dropdownID).classList.toggle('show');\n if (willShow) {\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.dropdown);\n } else {\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n}\n\n/**\n * Show the submenu\n * @param {string} submenuBtnID html element id of the submenu button whose submenu to show\n * @param {string} subMenuID html element id of the submenu to show\n */\nfunction showSubmenu(submenuBtnID, subMenuID) {\n hideSubmenus();\n document.getElementById(submenuBtnID).classList.add('open');\n document.getElementById(subMenuID).classList.add('show');\n}\n\n/**\n * Hide all other dropdowns except the dropdown\n * @param {string} dropdownID html element id of the dropdown\n */\nfunction hideDropdownsExcept(dropdownID) {\n const dropdowns = document.getElementsByClassName('dropdown');\n for (let i = 0; i < dropdowns.length; i++) {\n if (dropdowns[i].id !== dropdownID) {\n dropdowns[i].classList.remove('show');\n }\n }\n}\n\n/**\n * Hide all submenus\n */\nfunction hideSubmenus() {\n const submenus = document.getElementsByClassName('submenu');\n for (let i = 0; i < submenus.length; i++) {\n submenus[i].classList.remove('show');\n }\n const submenuBtns = document.getElementsByClassName('submenu-btn');\n for (let i = 0; i < submenuBtns.length; i++) {\n submenuBtns[i].classList.remove('open');\n }\n}\n\n// before start\n\n// capabiolity\n\nfor (var key in capability) {\n (function (key) {\n document.getElementById(key).addEventListener('change', () => {\n // console.log(key);\n // @ts-ignore\n capability[key] = document.getElementById(key).checked;\n });\n })(key);\n}\n\nconst h_defense = document.getElementById('defense');\nh_defense.addEventListener('change', () => {\n // @ts-ignore\n defense = parseInt(h_defense.value);\n});\n\nconst h_delay = document.getElementById('delay');\nh_delay.addEventListener('change', () => {\n // console.log(key);\n // @ts-ignore\n delay = h_delay.value;\n});\n\n// ai level\n\nconst o_capability = [\n 'serve',\n 'fancy',\n 'block',\n 'diving',\n 'anti_block',\n 'early_ball',\n 'jump',\n];\nconst h_ai_level = document.getElementById('ai-level');\nh_ai_level.addEventListener('change', () => {\n // @ts-ignore\n const now_level = level[parseInt(h_ai_level.value)];\n for (let i = 0; i < o_capability.length; i++) {\n const now_cap = document.getElementById(o_capability[i]);\n // @ts-ignore\n now_cap.checked = now_level[i];\n now_cap.dispatchEvent(new Event('change'));\n }\n // @ts-ignore\n h_delay.value = now_level[7];\n h_delay.dispatchEvent(new Event('change'));\n // @ts-ignore\n h_defense.value = now_level[8];\n h_defense.dispatchEvent(new Event('change'));\n});\n\n// surve\n\nfunction CountAvailable(avail) {\n return avail.filter((x) => x === true).length;\n}\nconst player1Skill0Checkbox = document.getElementById(\n 'player-1-skill-0-checkbox'\n);\nconst player1Skill1Checkbox = document.getElementById(\n 'player-1-skill-1-checkbox'\n);\nconst player1Skill2Checkbox = document.getElementById(\n 'player-1-skill-2-checkbox'\n);\nconst player1Skill3Checkbox = document.getElementById(\n 'player-1-skill-3-checkbox'\n);\nconst player1Skill4Checkbox = document.getElementById(\n 'player-1-skill-4-checkbox'\n);\nconst player1Skill5Checkbox = document.getElementById(\n 'player-1-skill-5-checkbox'\n);\nconst player1Skill6Checkbox = document.getElementById(\n 'player-1-skill-6-checkbox'\n);\nconst player1Skill7Checkbox = document.getElementById(\n 'player-1-skill-7-checkbox'\n);\nconst player1Skill8Checkbox = document.getElementById(\n 'player-1-skill-8-checkbox'\n);\nconst player1Skill9Checkbox = document.getElementById(\n 'player-1-skill-9-checkbox'\n);\nconst player2Skill0Checkbox = document.getElementById(\n 'player-2-skill-0-checkbox'\n);\nconst player2Skill1Checkbox = document.getElementById(\n 'player-2-skill-1-checkbox'\n);\nconst player2Skill2Checkbox = document.getElementById(\n 'player-2-skill-2-checkbox'\n);\nconst player2Skill3Checkbox = document.getElementById(\n 'player-2-skill-3-checkbox'\n);\nconst player2Skill4Checkbox = document.getElementById(\n 'player-2-skill-4-checkbox'\n);\nconst player2Skill5Checkbox = document.getElementById(\n 'player-2-skill-5-checkbox'\n);\nconst player2Skill6Checkbox = document.getElementById(\n 'player-2-skill-6-checkbox'\n);\nconst player2Skill7Checkbox = document.getElementById(\n 'player-2-skill-7-checkbox'\n);\n// @ts-ignore\nplayer1Skill0Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill1Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill2Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill3Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill4Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill5Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill6Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill7Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill8Checkbox.checked = true;\n// @ts-ignore\nplayer1Skill9Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill0Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill1Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill2Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill3Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill4Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill5Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill6Checkbox.checked = true;\n// @ts-ignore\nplayer2Skill7Checkbox.checked = true;\nplayer1Skill0Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill0Checkbox.checked === true)\n SkillTypeForPlayer1Available[0] = true;\n // @ts-ignore\n else if (player1Skill0Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[0] = false;\n // @ts-ignore\n else player1Skill0Checkbox.checked = true;\n }\n});\nplayer1Skill1Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill1Checkbox.checked === true)\n SkillTypeForPlayer1Available[1] = true;\n // @ts-ignore\n else if (player1Skill1Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[1] = false;\n // @ts-ignore\n else player1Skill1Checkbox.checked = true;\n }\n});\nplayer1Skill2Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill2Checkbox.checked === true)\n SkillTypeForPlayer1Available[2] = true;\n // @ts-ignore\n else if (player1Skill2Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[2] = false;\n // @ts-ignore\n else player1Skill2Checkbox.checked = true;\n }\n});\nplayer1Skill3Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill3Checkbox.checked === true)\n SkillTypeForPlayer1Available[3] = true;\n // @ts-ignore\n else if (player1Skill3Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[3] = false;\n // @ts-ignore\n else player1Skill3Checkbox.checked = true;\n }\n});\nplayer1Skill4Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill4Checkbox.checked === true)\n SkillTypeForPlayer1Available[4] = true;\n // @ts-ignore\n else if (player1Skill4Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[4] = false;\n // @ts-ignore\n else player1Skill4Checkbox.checked = true;\n }\n});\nplayer1Skill5Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill5Checkbox.checked === true)\n SkillTypeForPlayer1Available[5] = true;\n // @ts-ignore\n else if (player1Skill5Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[5] = false;\n // @ts-ignore\n else player1Skill5Checkbox.checked = true;\n }\n});\nplayer1Skill6Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill6Checkbox.checked === true)\n SkillTypeForPlayer1Available[6] = true;\n // @ts-ignore\n else if (player1Skill6Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[6] = false;\n // @ts-ignore\n else player1Skill6Checkbox.checked = true;\n }\n});\nplayer1Skill7Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill7Checkbox.checked === true)\n SkillTypeForPlayer1Available[7] = true;\n // @ts-ignore\n else if (player1Skill7Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[7] = false;\n // @ts-ignore\n else player1Skill7Checkbox.checked = true;\n }\n});\nplayer1Skill8Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill8Checkbox.checked === true)\n SkillTypeForPlayer1Available[8] = true;\n // @ts-ignore\n else if (player1Skill8Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[8] = false;\n // @ts-ignore\n else player1Skill8Checkbox.checked = true;\n }\n});\nplayer1Skill9Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player1Skill9Checkbox.checked === true)\n SkillTypeForPlayer1Available[9] = true;\n // @ts-ignore\n else if (player1Skill9Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer1Available) >= 2)\n SkillTypeForPlayer1Available[9] = false;\n // @ts-ignore\n else player1Skill9Checkbox.checked = true;\n }\n});\nplayer2Skill0Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill0Checkbox.checked === true)\n SkillTypeForPlayer2Available[0] = true;\n // @ts-ignore\n else if (player2Skill0Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[0] = false;\n // @ts-ignore\n else player2Skill0Checkbox.checked = true;\n }\n});\nplayer2Skill1Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill1Checkbox.checked === true)\n SkillTypeForPlayer2Available[1] = true;\n // @ts-ignore\n else if (player2Skill1Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[1] = false;\n // @ts-ignore\n else player2Skill1Checkbox.checked = true;\n }\n});\nplayer2Skill2Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill2Checkbox.checked === true)\n SkillTypeForPlayer2Available[2] = true;\n // @ts-ignore\n else if (player2Skill2Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[2] = false;\n // @ts-ignore\n else player2Skill2Checkbox.checked = true;\n }\n});\nplayer2Skill3Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill3Checkbox.checked === true)\n SkillTypeForPlayer2Available[3] = true;\n // @ts-ignore\n else if (player2Skill3Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[3] = false;\n // @ts-ignore\n else player2Skill3Checkbox.checked = true;\n }\n});\nplayer2Skill4Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill4Checkbox.checked === true)\n SkillTypeForPlayer2Available[4] = true;\n // @ts-ignore\n else if (player2Skill4Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[4] = false;\n // @ts-ignore\n else player2Skill4Checkbox.checked = true;\n }\n});\nplayer2Skill5Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill5Checkbox.checked === true)\n SkillTypeForPlayer2Available[5] = true;\n // @ts-ignore\n else if (player2Skill5Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[5] = false;\n // @ts-ignore\n else player2Skill5Checkbox.checked = true;\n }\n});\nplayer2Skill6Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill6Checkbox.checked === true)\n SkillTypeForPlayer2Available[6] = true;\n // @ts-ignore\n else if (player2Skill6Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[6] = false;\n // @ts-ignore\n else player2Skill6Checkbox.checked = true;\n }\n});\nplayer2Skill7Checkbox.addEventListener('change', () => {\n // @ts-ignore\n if (player2Skill7Checkbox.checked === true)\n SkillTypeForPlayer2Available[7] = true;\n // @ts-ignore\n else if (player2Skill7Checkbox.checked === false) {\n if (CountAvailable(SkillTypeForPlayer2Available) >= 2)\n SkillTypeForPlayer2Available[7] = false;\n // @ts-ignore\n else player2Skill7Checkbox.checked = true;\n }\n});\n\nconst player1_1_step = document.getElementById('player1-1-step-serve');\nplayer1_1_step.addEventListener('change', () => {\n // @ts-ignore\n player1Skill0Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill1Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill2Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill3Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill4Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill5Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill6Checkbox.checked = player1_1_step.checked;\n // @ts-ignore\n player1Skill7Checkbox.checked = player1_1_step.checked;\n for (let i = 0; i < 8; i++) {\n // @ts-ignore\n SkillTypeForPlayer1Available[i] = player1_1_step.checked;\n }\n if (CountAvailable(SkillTypeForPlayer1Available) === 0) {\n // @ts-ignore\n player1Skill1Checkbox.checked = true;\n SkillTypeForPlayer1Available[1] = true;\n }\n});\n\nconst player2_1_step = document.getElementById('player2-1-step-serve');\nplayer2_1_step.addEventListener('change', () => {\n // @ts-ignore\n player2Skill0Checkbox.checked = player2_1_step.checked;\n // @ts-ignore\n player2Skill1Checkbox.checked = player2_1_step.checked;\n // @ts-ignore\n player2Skill2Checkbox.checked = player2_1_step.checked;\n // @ts-ignore\n player2Skill3Checkbox.checked = player2_1_step.checked;\n // @ts-ignore\n player2Skill4Checkbox.checked = player2_1_step.checked;\n // @ts-ignore\n player2Skill5Checkbox.checked = player2_1_step.checked;\n for (let i = 0; i < 6; i++) {\n // @ts-ignore\n SkillTypeForPlayer2Available[i] = player2_1_step.checked;\n }\n if (CountAvailable(SkillTypeForPlayer2Available) === 0) {\n // @ts-ignore\n player2Skill1Checkbox.checked = true;\n SkillTypeForPlayer2Available[1] = true;\n }\n});\n\nconst player1_tail = document.getElementById('player1-tail-serve');\nplayer1_tail.addEventListener('change', () => {\n // @ts-ignore\n player1Skill8Checkbox.checked = player1_tail.checked;\n // @ts-ignore\n player1Skill9Checkbox.checked = player1_tail.checked;\n for (let i = 8; i < 10; i++) {\n // @ts-ignore\n SkillTypeForPlayer1Available[i] = player1_tail.checked;\n }\n if (CountAvailable(SkillTypeForPlayer1Available) === 0) {\n // @ts-ignore\n player1Skill1Checkbox.checked = true;\n SkillTypeForPlayer1Available[1] = true;\n }\n});\n\nconst player2_tail = document.getElementById('player2-tail-serve');\nplayer2_tail.addEventListener('change', () => {\n // @ts-ignore\n player2Skill6Checkbox.checked = player2_tail.checked;\n // @ts-ignore\n player2Skill7Checkbox.checked = player2_tail.checked;\n for (let i = 6; i < 8; i++) {\n // @ts-ignore\n SkillTypeForPlayer2Available[i] = player2_tail.checked;\n }\n if (CountAvailable(SkillTypeForPlayer2Available) === 0) {\n // @ts-ignore\n player2Skill1Checkbox.checked = true;\n SkillTypeForPlayer2Available[1] = true;\n }\n});\n\nconst saveReplayBtn = document.getElementById('save-replay-btn');\nsaveReplayBtn.addEventListener('click', () => {\n replaySaver.saveAsFile();\n});\n","/**\n * The Model part in the MVC pattern\n *\n * It is the core module which acts as a physics engine.\n * This physics engine calculates the movements of the ball and the players (Pikachus).\n *\n * It is gained by reverse engineering the original game.\n * The address of each function in the original machine code is specified at the comment above each function.\n * ex) FUN_00403dd0 means the original function at the address 00403dd0.\n *\n *\n * ** Some useful infos below **\n *\n * Ground width: 432 = 0x1B0\n * Ground height: 304 = 0x130\n *\n * X position coordinate: [0, 432], right-direction increasing\n * Y position coordinate: [0, 304], down-direction increasing\n *\n * Ball radius: 20 = 0x14\n * Ball diameter: 40 = 0x28\n *\n * Player half-width: 32 = 0x20\n * Player half-height: 32 = 0x20\n * Player width: 64 = 0x40\n * Player height: 64 = 0x40\n *\n */\n'use strict';\nimport { rand, true_rand } from './rand.js';\nimport {\n SkillTypeForPlayer2Available,\n SkillTypeForPlayer1Available,\n capability,\n delay,\n defense,\n} from './ui.js';\n\n/** @constant @type {number} ground width */\nconst GROUND_WIDTH = 432;\n/** @constant @type {number} ground half-width, it is also the net pillar x coordinate */\nexport const GROUND_HALF_WIDTH = (GROUND_WIDTH / 2) | 0; // integer division\n/** @constant @type {number} player (Pikachu) length: width = height = 64 */\nconst PLAYER_LENGTH = 64;\n/** @constant @type {number} player half length */\nconst PLAYER_HALF_LENGTH = (PLAYER_LENGTH / 2) | 0; // integer division\n/** @constant @type {number} player's y coordinate when they are touching ground */\nconst PLAYER_TOUCHING_GROUND_Y_COORD = 244;\n/** @constant @type {number} ball's radius */\nconst BALL_RADIUS = 20;\n/** @constant @type {number} ball's y coordinate when it is touching ground */\nconst BALL_TOUCHING_GROUND_Y_COORD = 252;\n/** @constant @type {number} net pillar's half width (this value is on this physics engine only, not on the sprite pixel size) */\nconst NET_PILLAR_HALF_WIDTH = 25;\n/** @constant @type {number} net pillar top's top side y coordinate */\nconst NET_PILLAR_TOP_TOP_Y_COORD = 176;\n/** @constant @type {number} net pillar top's bottom side y coordinate (this value is on this physics engine only) */\nconst NET_PILLAR_TOP_BOTTOM_Y_COORD = 192;\n\n/**\n * It's for to limit the looping number of the infinite loops.\n * This constant is not in the original machine code. (The original machine code does not limit the looping number.)\n *\n * In the original ball x coord range setting (ball x coord in [20, 432]), the infinite loops in\n * {@link calculateExpectedLandingPointXFor} function and {@link expectedLandingPointXWhenPowerHit} function seems to be always terminated soon.\n * But if the ball x coord range is edited, for example, to [20, 432 - 20] for left-right symmetry,\n * it is observed that the infinite loop in {@link expectedLandingPointXWhenPowerHit} does not terminate.\n * So for safety, this infinite loop limit is included for the infinite loops mentioned above.\n * @constant @type {number}\n */\nconst INFINITE_LOOP_LIMIT = 1000;\n\n/**\n * Class representing a pack of physical objects i.e. players and ball\n * whose physical values are calculated and set by {@link physicsEngine} function\n */\nexport class PikaPhysics {\n /**\n * Create a physics pack\n * @param {boolean} isPlayer1Computer Is player on the left (player 1) controlled by computer?\n * @param {boolean} isPlayer2Computer Is player on the right (player 2) controlled by computer?\n */\n constructor(isPlayer1Computer, isPlayer2Computer) {\n this.player1 = new Player(false, isPlayer1Computer);\n this.player2 = new Player(true, isPlayer2Computer);\n this.ball = new Ball(false);\n }\n\n /**\n * run {@link physicsEngine} function with this physics object and user input\n *\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: PikaUserInput object for player 1, userInputArray[1]: PikaUserInput object for player 2\n * @return {boolean} Is ball touching ground?\n */\n runEngineForNextFrame(userInputArray) {\n const isBallTouchingGournd = physicsEngine(\n this.player1,\n this.player2,\n this.ball,\n userInputArray\n );\n return isBallTouchingGournd;\n }\n}\n\n/**\n * Class (or precisely, Interface) representing user input (from keyboard or joystick, whatever)\n */\nexport class PikaUserInput {\n constructor() {\n /** @type {number} 0: no horizontal-direction input, -1: left-direction input, 1: right-direction input */\n this.xDirection = 0;\n /** @type {number} 0: no vertical-direction input, -1: up-direction input, 1: down-direction input */\n this.yDirection = 0;\n /** @type {number} 0: auto-repeated or no power hit input, 1: not auto-repeated power hit input */\n this.powerHit = 0;\n }\n}\n\n/**\n * Class representing a player\n *\n * Player 1 property address: 00411F28 -> +28 -> +10 -> +C -> ...\n * Player 2 property address: 00411F28 -> +28 -> +10 -> +10 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to player1.isPlayer: 00411F28 -> +28 -> +10 -> +C -> +A0\n * e.g. address to player2.isComputer: 00411F28 -> +28 -> +10 -> +10 -> +A4\n *\n * For initial values: refer FUN_000403a90 && FUN_00401f40\n */\nclass Player {\n /**\n * create a player\n * @param {boolean} isPlayer2 Is this player on the right side?\n * @param {boolean} isComputer Is this player controlled by computer?\n */\n constructor(isPlayer2, isComputer) {\n this.serve = new ServeMachine(isPlayer2);\n\n /** @type {boolean} Is this player on the right side? */\n this.isPlayer2 = isPlayer2; // 0xA0\n /** @type {boolean} Is controlled by computer? */\n this.isComputer = isComputer; // 0xA4\n this.initializeForNewRound();\n\n /** @type {number} -1: left, 0: no diving, 1: right */\n this.divingDirection = 0; // 0xB4\n /** @type {number} */\n this.lyingDownDurationLeft = -1; // 0xB8\n /** @type {boolean} */\n this.isWinner = false; // 0xD0\n /** @type {boolean} */\n this.gameEnded = false; // 0xD4\n\n /**\n * It flips randomly to 0 or 1 by the {@link letComputerDecideUserInput} function (FUN_00402360)\n * when ball is hanging around on the other player's side.\n * If it is 0, computer player stands by around the middle point of their side.\n * If it is 1, computer player stands by adjecent to the net.\n * @type {number} 0 or 1\n */\n this.computerWhereToStandBy = 0; // 0xDC\n\n /**\n * This property is not in the player pointers of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convinient way to give sound property to a Player.\n * The original name is stereo sound.\n * @type {Object.}\n */\n this.sound = {\n pipikachu: false,\n pika: false,\n chu: false,\n };\n this.tactics = 0;\n this.goodtime = -1;\n this.attackX = 0;\n this.direction = 0;\n this.fancy = false;\n this.secondattack = -1;\n this.secondX = 0;\n this.secondjump = false;\n this.juke = false;\n this.cooldown = 0;\n this.frontfram = 0;\n // this.fakeflat = false;\n }\n\n /**\n * initialize for new round\n */\n initializeForNewRound() {\n /** @type {number} x coord */\n this.x = 36; // 0xA8 // initialized to 36 (player1) or 396 (player2)\n if (this.isPlayer2) {\n this.x = GROUND_WIDTH - 36;\n }\n /** @type {number} y coord */\n this.y = PLAYER_TOUCHING_GROUND_Y_COORD; // 0xAC // initialized to 244\n /** @type {number} y direction velocity */\n this.yVelocity = 0; // 0xB0 // initialized to 0\n /** @type {boolean} */\n this.isCollisionWithBallHappened = false; // 0xBC // initizlized to 0 i.e false\n\n /**\n * Player's state\n * 0: normal, 1: jumping, 2: jumping_and_power_hitting, 3: diving\n * 4: lying_down_after_diving\n * 5: win!, 6: lost..\n * @type {number} 0, 1, 2, 3, 4, 5 or 6\n */\n this.state = 0; // 0xC0 // initialized to 0\n /** @type {number} */\n this.frameNumber = 0; // 0xC4 // initialized to 0\n /** @type {number} */\n this.normalStatusArmSwingDirection = 1; // 0xC8 // initialized to 1\n /** @type {number} */\n this.delayBeforeNextFrame = 0; // 0xCC // initizlized to 0\n\n /**\n * This value is initialized to (_rand() % 5) before the start of every round.\n * The greater the number, the bolder the computer player.\n *\n * If computer has higher boldness,\n * judges more the ball is haing around the other player's side,\n * has greater distance to the expected landing point of the ball,\n * jumps more,\n * dives less.\n * See the source code of the {@link letComputerDecideUserInput} function (FUN_00402360).\n *\n * @type {number} 0, 1, 2, 3 or 4\n */\n this.computerBoldness = rand() % 5; // 0xD8 // initialized to (_rand() % 5)\n this.serve.initializeForNewRound();\n this.tactics = 0;\n this.goodtime = -1;\n this.attackX = 0;\n this.direction = 0;\n this.fancy = false;\n this.secondattack = -1;\n this.secondX = 0;\n this.secondjump = false;\n }\n}\n\n/**\n * Class representing a ball\n *\n * Ball property address: 00411F28 -> +28 -> +10 -> +14 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to ball.fineRotation: 00411F28 -> +28 -> +10 -> +14 -> +48\n *\n * For initial Values: refer FUN_000403a90 && FUN_00402d60\n */\nclass Ball {\n /**\n * Create a ball\n * @param {boolean} isPlayer2Serve Will player 2 serve on this new round?\n */\n constructor(isPlayer2Serve) {\n this.initializeForNewRound(isPlayer2Serve);\n /** @type {number} x coord of expected lang point */\n this.expectedLandingPointX = 0; // 0x40\n /**\n * ball rotation frame number selector\n * During the period where it continues to be 5, hyper ball glitch occur.\n * @type {number} 0, 1, 2, 3, 4 or 5\n * */\n this.rotation = 0; // 0x44\n /** @type {number} */\n this.fineRotation = 0; // 0x48\n /** @type {number} x coord for punch effect */\n this.punchEffectX = 0; // 0x50\n /** @type {number} y coord for punch effect */\n this.punchEffectY = 0; // 0x54\n\n /**\n * Following previous values are for trailing effect for power hit\n * @type {number}\n */\n this.previousX = 0; // 0x58\n this.previousPreviousX = 0; // 0x5c\n this.previousY = 0; // 0x60\n this.previousPreviousY = 0; // 0x64\n\n /**\n * this property is not in the ball pointer of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convinient way to give sound property to a Ball.\n * The original name is stereo sound.\n */\n this.sound = {\n powerHit: false,\n ballTouchesGround: false,\n };\n\n this.path = Array();\n this.predict = Array();\n // this.shortX = 0;\n // this.farX = 0;\n // this.bestDefense = 0;\n }\n\n /**\n * Initialize for new round\n * @param {boolean} isPlayer2Serve will player on the right side serve on this new round?\n */\n initializeForNewRound(isPlayer2Serve) {\n /** @type {number} x coord */\n this.x = 56; // 0x30 // initialized to 56 or 376\n if (isPlayer2Serve === true) {\n this.x = GROUND_WIDTH - 56;\n }\n /** @type {number} y coord */\n this.y = 0; // 0x34 // initialized to 0\n /** @type {number} x direction velocity */\n this.xVelocity = 0; // 0x38 // initialized to 0\n /** @type {number} y directin velicity */\n this.yVelocity = 1; // 0x3C // initialized to 1\n /** @type {number} punch effect radius */\n this.punchEffectRadius = 0; // 0x4c // initialized to 0\n /** @type {boolean} is power hit */\n this.isPowerHit = false; // 0x68 // initialized to 0 i.e. false\n this.frame = 0;\n this.isPlayer2Serve = isPlayer2Serve;\n }\n}\n\n/**\n * FUN_00403dd0\n * This is the Pikachu Volleyball physics engine!\n * This physics engine calculates and set the physics values for the next frame.\n *\n * @param {Player} player1 player on the left side\n * @param {Player} player2 player on the right side\n * @param {Ball} ball ball\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: user input for player 1, userInputArray[1]: user input for player 2\n * @return {boolean} Is ball tounching ground?\n */\nfunction physicsEngine(player1, player2, ball, userInputArray) {\n const isBallTouchingGround =\n processCollisionBetweenBallAndWorldAndSetBallPosition(ball);\n\n let player;\n let theOtherPlayer;\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n theOtherPlayer = player2;\n } else {\n player = player2;\n theOtherPlayer = player1;\n }\n\n // FUN_00402d90 ommited\n // FUN_00402810 ommited\n // this javascript code is refactored not to need above two function except for\n // a part of FUN_00402d90:\n // FUN_00402d90 include FUN_004031b0(calculateExpectedLandingPointXFor)\n calculateExpectedLandingPointXFor(ball); // calculate expected_X;\n\n processPlayerMovementAndSetPlayerPosition(\n player,\n userInputArray[i],\n theOtherPlayer,\n ball\n );\n\n // FUN_00402830 ommited\n // FUN_00406020 ommited\n // These two functions ommited above maybe participate in graphic drawing for a player\n }\n\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n } else {\n player = player2;\n }\n\n // FUN_00402810 ommited: this javascript code is refactored not to need this function\n\n const isHappend = isCollisionBetweenBallAndPlayerHappened(\n ball,\n player.x,\n player.y\n );\n if (isHappend === true) {\n if (player.isCollisionWithBallHappened === false) {\n processCollisionBetweenBallAndPlayer(\n ball,\n player.x,\n userInputArray[i],\n player.state\n );\n player.isCollisionWithBallHappened = true;\n }\n } else {\n player.isCollisionWithBallHappened = false;\n }\n }\n\n // FUN_00403040\n // FUN_00406020\n // These two functions ommited above maybe participate in graphic drawing for a player\n console.log(ball.x, ball.y, ball.xVelocity, ball.yVelocity);\n return isBallTouchingGround;\n}\n\n/**\n * FUN_00403070\n * Is collision between ball and player happend?\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX player.x\n * @param {Player[\"y\"]} playerY player.y\n * @return {boolean}\n */\nfunction isCollisionBetweenBallAndPlayerHappened(ball, playerX, playerY) {\n let diff = ball.x - playerX;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n diff = ball.y - playerY;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * FUN_00402dc0\n * Process collision between ball and world and set ball position\n * @param {Ball} ball\n * @return {boolean} Is ball touching ground?\n */\nfunction processCollisionBetweenBallAndWorldAndSetBallPosition(ball) {\n // This is not part of this function in the original assembly code.\n // In the original assembly code, it is processed in other function (FUN_00402ee0)\n // But it is proper to process here.\n ball.previousPreviousX = ball.previousX;\n ball.previousPreviousY = ball.previousY;\n ball.previousX = ball.x;\n ball.previousY = ball.y;\n ball.frame += 1;\n\n // \"(ball.xVelocity / 2) | 0\" is integer division by 2\n let futureFineRotation = ball.fineRotation + ((ball.xVelocity / 2) | 0);\n // If futureFineRotation === 50, it skips next if statement finely.\n // Then ball.fineRoation = 50, and then ball.rotation = 5 (which designates hyperball sprite!).\n // In this way, hyper ball glitch occur!\n // If this happen at the end of round,\n // since ball.xVeloicy is 0-initailized at each start of round,\n // hyper ball sprite is rendered continuously until a collision happens.\n if (futureFineRotation < 0) {\n futureFineRotation += 50;\n } else if (futureFineRotation > 50) {\n futureFineRotation += -50;\n }\n ball.fineRotation = futureFineRotation;\n ball.rotation = (ball.fineRotation / 10) | 0; // integer division\n\n const futureBallX = ball.x + ball.xVelocity;\n /*\n If the center of ball would get out of left world bound or right world bound, bounce back.\n \n In this if statement, when considering left-right symmetry,\n \"futureBallX > GROUND_WIDTH\" should be changed to \"futureBallX > (GROUND_WIDTH - BALL_RADIUS)\",\n or \"futureBallX < BALL_RADIUS\" should be changed to \"futureBallX < 0\".\n Maybe the former one is more proper when seeing Pikachu player's x-direction boundary.\n Is this a mistake of the author of the original game?\n Or, was it set to this value to resolve inifite loop problem? (See comments on the constant INFINITE_LOOP_LIMIT.)\n If apply (futureBallX > (GROUND_WIDTH - BALL_RADIUS)), and if the maximum number of loop is not limited,\n it is observed that inifinite loop in the function expectedLandingPointXWhenPowerHit does not terminate.\n */\n if (futureBallX < BALL_RADIUS || futureBallX > GROUND_WIDTH) {\n ball.xVelocity = -ball.xVelocity;\n }\n\n let futureBallY = ball.y + ball.yVelocity;\n // if the center of ball would get out of upper world bound\n if (futureBallY < 0) {\n ball.yVelocity = 1;\n }\n\n // If ball touches net\n if (\n Math.abs(ball.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n ball.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n if (ball.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (ball.yVelocity > 0) {\n ball.yVelocity = -ball.yVelocity;\n }\n } else {\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = -Math.abs(ball.xVelocity);\n } else {\n ball.xVelocity = Math.abs(ball.xVelocity);\n }\n }\n }\n\n futureBallY = ball.y + ball.yVelocity;\n // if ball would touch ground\n if (futureBallY > BALL_TOUCHING_GROUND_Y_COORD) {\n // FUN_00408470 omitted\n // the function omitted above receives 100 * (ball.x - 216),\n // i.e. horizontal displacement from net maybe for stereo sound?\n // code function (ballpointer + 0x28 + 0x10)? omitted\n // the omitted two functions maybe do a part of sound playback role.\n ball.sound.ballTouchesGround = true;\n\n ball.yVelocity = -ball.yVelocity;\n ball.punchEffectX = ball.x;\n ball.y = BALL_TOUCHING_GROUND_Y_COORD;\n ball.punchEffectRadius = BALL_RADIUS;\n ball.punchEffectY = BALL_TOUCHING_GROUND_Y_COORD + BALL_RADIUS;\n return true;\n }\n ball.y = futureBallY;\n ball.x = ball.x + ball.xVelocity;\n ball.yVelocity += 1;\n\n return false;\n}\n\n/**\n * FUN_00401fc0\n * Process player movement according to user input and set player position\n * @param {Player} player\n * @param {PikaUserInput} userInput\n * @param {Player} theOtherPlayer\n * @param {Ball} ball\n */\nfunction processPlayerMovementAndSetPlayerPosition(\n player,\n userInput,\n theOtherPlayer,\n ball\n) {\n if (player.isComputer === true) {\n // if (player.isPlayer2) {\n letAIDecideUserInput(player, ball, theOtherPlayer, userInput);\n // } else {\n // letComputerDecideUserInput(player, ball, theOtherPlayer, userInput);\n // }\n }\n\n // if player is lying down.. don't move\n if (player.state === 4) {\n player.lyingDownDurationLeft += -1;\n if (player.lyingDownDurationLeft < -1) {\n player.state = 0;\n }\n return;\n }\n\n // process x-direction movement\n let playerVelocityX = 0;\n if (player.state < 5) {\n if (player.state < 3) {\n playerVelocityX = userInput.xDirection * 6;\n } else {\n // player.state === 3 i.e. player is diving..\n playerVelocityX = player.divingDirection * 8;\n }\n }\n\n const futurePlayerX = player.x + playerVelocityX;\n player.x = futurePlayerX;\n\n // process player's x-direction world boundary\n if (player.isPlayer2 === false) {\n // if player is player1\n if (futurePlayerX < PLAYER_HALF_LENGTH) {\n player.x = PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH;\n }\n } else {\n // if player is player2\n if (futurePlayerX < GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_WIDTH - PLAYER_HALF_LENGTH;\n }\n }\n\n // jump\n if (\n player.state < 3 &&\n userInput.yDirection === -1 && // up-direction input\n player.y === PLAYER_TOUCHING_GROUND_Y_COORD // player is touching on the ground\n ) {\n player.yVelocity = -16;\n player.state = 1;\n player.frameNumber = 0;\n // maybe-stereo-sound function FUN_00408470 (0x90) ommited:\n // refer a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? ommited\n player.sound.chu = true;\n }\n\n // gravity\n const futurePlayerY = player.y + player.yVelocity;\n player.y = futurePlayerY;\n if (futurePlayerY < PLAYER_TOUCHING_GROUND_Y_COORD) {\n player.yVelocity += 1;\n } else if (futurePlayerY > PLAYER_TOUCHING_GROUND_Y_COORD) {\n // if player is landing..\n player.yVelocity = 0;\n player.y = PLAYER_TOUCHING_GROUND_Y_COORD;\n player.frameNumber = 0;\n if (player.state === 3) {\n // if player is diving..\n player.state = 4;\n player.frameNumber = 0;\n player.lyingDownDurationLeft = 3;\n } else {\n player.state = 0;\n }\n }\n\n if (userInput.powerHit === 1) {\n if (player.state === 1) {\n // if player is jumping..\n // then player do power hit!\n player.delayBeforeNextFrame = 5;\n player.frameNumber = 0;\n player.state = 2;\n // maybe-sound function (playerpointer + 0x90 + 0x18)? ommited\n // maybe-stereo-sound function FUN_00408470 (0x90) ommited:\n // refer a detailed comment above about this function\n // maybe-sound function (playerpointer + 0x90 + 0x14)? ommited\n player.sound.pika = true;\n } else if (player.state === 0 && userInput.xDirection !== 0) {\n // then player do diving!\n player.state = 3;\n player.frameNumber = 0;\n player.divingDirection = userInput.xDirection;\n player.yVelocity = -5;\n // maybe-stereo-sound function FUN_00408470 (0x90) ommited:\n // refer a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? ommited\n player.sound.chu = true;\n }\n }\n\n if (player.state === 1) {\n player.frameNumber = (player.frameNumber + 1) % 3;\n } else if (player.state === 2) {\n if (player.delayBeforeNextFrame < 1) {\n player.frameNumber += 1;\n if (player.frameNumber > 4) {\n player.frameNumber = 0;\n player.state = 1;\n }\n } else {\n player.delayBeforeNextFrame -= 1;\n }\n } else if (player.state === 0) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 3) {\n player.delayBeforeNextFrame = 0;\n const futureFrameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n if (futureFrameNumber < 0 || futureFrameNumber > 4) {\n player.normalStatusArmSwingDirection =\n -player.normalStatusArmSwingDirection;\n }\n player.frameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n }\n }\n\n if (player.gameEnded === true) {\n if (player.state === 0) {\n if (player.isWinner === true) {\n player.state = 5;\n // maybe-stereo-sound function FUN_00408470 (0x90) ommited:\n // refer a detailed comment above about this function\n // maybe-sound code function (0x98 + 0x10) ommited\n player.sound.pipikachu = true;\n } else {\n player.state = 6;\n }\n player.delayBeforeNextFrame = 0;\n player.frameNumber = 0;\n }\n processGameEndFrameFor(player);\n }\n}\n\n/**\n * FUN_004025e0\n * Process game end frame (for winner and loser motions) for the given player\n * @param {Player} player\n */\nfunction processGameEndFrameFor(player) {\n if (player.gameEnded === true && player.frameNumber < 4) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 4) {\n player.delayBeforeNextFrame = 0;\n player.frameNumber += 1;\n }\n }\n}\n\n/**\n * FUN_004030a0\n * Process collision between ball and player.\n * This function only sets velocity of ball and expected landing point x of ball.\n * This function does not set position of ball.\n * The ball position is set by {@link processCollisionBetweenBallAndWorldAndSetBallPosition} function\n *\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX\n * @param {PikaUserInput} userInput\n * @param {Player[\"state\"]} playerState\n */\nfunction processCollisionBetweenBallAndPlayer(\n ball,\n playerX,\n userInput,\n playerState\n) {\n // playerX is maybe pika's x position\n // if collision occur,\n // greater the x position difference between pika and ball,\n // greater the x velocity of the ball.\n if (ball.x < playerX) {\n // Since javascript division is float division by default,\n // Here we use \"| 0\" to do integer division (refer: https://stackoverflow.com/a/17218003/8581025)\n ball.xVelocity = -((Math.abs(ball.x - playerX) / 3) | 0);\n } else if (ball.x > playerX) {\n ball.xVelocity = (Math.abs(ball.x - playerX) / 3) | 0;\n }\n\n // If ball velocity x is 0, randomly choose one of -1, 0, 1.\n if (ball.xVelocity === 0) {\n ball.xVelocity = (rand() % 3) - 1;\n }\n\n const ballAbsYVelocity = Math.abs(ball.yVelocity);\n ball.yVelocity = -ballAbsYVelocity;\n\n if (ballAbsYVelocity < 15) {\n ball.yVelocity = -15;\n }\n\n // player is jumping and power hitting\n if (playerState === 2) {\n // console.log(ball.path);\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = (Math.abs(userInput.xDirection) + 1) * 10;\n } else {\n ball.xVelocity = -(Math.abs(userInput.xDirection) + 1) * 10;\n }\n ball.punchEffectX = ball.x;\n ball.punchEffectY = ball.y;\n\n ball.yVelocity = Math.abs(ball.yVelocity) * userInput.yDirection * 2;\n ball.punchEffectRadius = BALL_RADIUS;\n // maybe-stereo-sound function FUN_00408470 (0x90) ommited:\n // refer a detailed comment above about this function\n // maybe-soundcode function (ballpointer + 0x24 + 0x10) ommited:\n ball.sound.powerHit = true;\n\n ball.isPowerHit = true;\n } else {\n ball.isPowerHit = false;\n }\n\n calculateExpectedLandingPointXFor(ball);\n}\n\n/**\n * FUN_004031b0\n * Calculate x coordinate of expected landing point of the ball\n * @param {Ball} ball\n */\nfunction calculateExpectedLandingPointXFor(ball) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n predict: Array(),\n };\n let loopCounter = 0;\n ball.path = Array();\n copyBall.predict = Array();\n for (let yDirection = -1; yDirection < 2; yDirection++) {\n for (let xDirection = 0; xDirection < 2; xDirection++) {\n calculateExpectedLandingPointXwithpredict(\n copyBall,\n xDirection,\n yDirection\n );\n }\n }\n ball.path.push(Object.assign({}, copyBall));\n\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.xVelocity + copyBall.x;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n\n // If copy ball touches net\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n // It maybe should be <= NET_PILLAR_TOP_BOTTOM_Y_COORD as in FUN_00402dc0, is it the original game author's mistake?\n if (copyBall.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n }\n\n copyBall.y = copyBall.y + copyBall.yVelocity;\n // if copyBall would touch ground\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n break;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n // 帶入不同狀況來算\n if (ball.path.length < 34) {\n copyBall.predict = Array();\n for (let yDirection = -1; yDirection < 2; yDirection++) {\n for (let xDirection = 0; xDirection < 2; xDirection++) {\n calculateExpectedLandingPointXwithpredict(\n copyBall,\n xDirection,\n yDirection\n );\n }\n }\n }\n ball.path.push(Object.assign({}, copyBall));\n }\n ball.expectedLandingPointX = copyBall.x;\n}\n\nfunction calculateExpectedLandingPointXwithpredict(\n ball,\n xDirection,\n yDirection\n) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n };\n // 調整力道\n\n const ballAbsYVelocity = Math.abs(copyBall.yVelocity);\n copyBall.yVelocity = -ballAbsYVelocity;\n\n if (ballAbsYVelocity < 15) {\n copyBall.yVelocity = -15;\n }\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = (Math.abs(xDirection) + 1) * 10;\n } else {\n copyBall.xVelocity = -(Math.abs(xDirection) + 1) * 10;\n }\n copyBall.yVelocity = Math.abs(copyBall.yVelocity) * yDirection * 2;\n\n let loopCounter = 0;\n const tmppath = Array();\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.xVelocity + copyBall.x;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n\n // If copy ball touches net\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n // It maybe should be <= NET_PILLAR_TOP_BOTTOM_Y_COORD as in FUN_00402dc0, is it the original game author's mistake?\n if (copyBall.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n }\n\n copyBall.y = copyBall.y + copyBall.yVelocity;\n // if copyBall would touch ground\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n tmppath.push(Object.assign({}, copyBall));\n break;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n tmppath.push(Object.assign({}, copyBall));\n }\n ball.predict.push(tmppath);\n}\n\nfunction playerYpredict(player, frame) {\n if (player.state === 0) {\n let total = -16;\n let speed = -15;\n for (let i = 0; i < frame; i++) {\n total += speed;\n speed += 1;\n }\n if (total > 0) {\n return PLAYER_TOUCHING_GROUND_Y_COORD;\n }\n return PLAYER_TOUCHING_GROUND_Y_COORD + total;\n } else {\n let speed = player.yVelocity;\n let realY = player.y + speed;\n for (let i = 0; i < frame; i++) {\n speed += 1;\n realY += speed;\n }\n if (realY > PLAYER_TOUCHING_GROUND_Y_COORD) {\n return PLAYER_TOUCHING_GROUND_Y_COORD;\n }\n return realY;\n }\n}\n\nfunction playerYpredictJump(player, frame) {\n if (player.state === 0) {\n let total = -16;\n let speed = -15;\n for (let i = 0; i < frame; i++) {\n total += speed;\n speed += 1;\n if (speed === 17) {\n speed = -16;\n }\n }\n return PLAYER_TOUCHING_GROUND_Y_COORD + total;\n } else {\n let speed = player.yVelocity;\n let realY = player.y + speed;\n for (let i = 0; i < frame; i++) {\n speed += 1;\n if (speed === 17) {\n speed = -16;\n }\n realY += speed;\n }\n if (realY > 244) {\n realY = 244;\n }\n return realY;\n }\n}\n\nfunction otherPlayerYpredict(player, frame) {\n if (player.isPlayer2) {\n return playerYpredictJump(player, frame);\n } else {\n if (player.state === 0) {\n let total = 0;\n let speed = -16;\n for (let i = 0; i < frame; i++) {\n total += speed;\n speed += 1;\n if (speed === 17) {\n speed = -16;\n }\n }\n return PLAYER_TOUCHING_GROUND_Y_COORD + total;\n } else {\n let speed = player.yVelocity;\n let realY = player.y;\n for (let i = 0; i < frame; i++) {\n realY += speed;\n speed += 1;\n if (speed === 17) {\n speed = -16;\n }\n }\n return realY;\n }\n }\n}\n\n/**\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {number} ballX ball\n */\nfunction sameside(player, ballX) {\n if (ballX === GROUND_HALF_WIDTH) {\n return true;\n }\n return player.isPlayer2\n ? ballX > GROUND_HALF_WIDTH\n : ballX < GROUND_HALF_WIDTH;\n}\n\n/**\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {number} ballX ball\n */\nfunction samesideloss(player, ballX) {\n return player.isPlayer2\n ? ballX >= GROUND_HALF_WIDTH\n : ballX < GROUND_HALF_WIDTH;\n}\n\n/**\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {Array} predict ball\n */\nfunction canblock(player, predict) {\n let first = true;\n for (let frame = 0; frame < predict.length; frame++) {\n if (sameside(player, predict[frame].x)) {\n if (first) {\n if (predict[frame].y > NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n return false;\n }\n first = false;\n }\n if (Math.abs(predict[frame].x - GROUND_HALF_WIDTH) > 60) {\n return false;\n }\n if (\n Math.abs(otherPlayerYpredict(player, frame) - predict[frame].y) <=\n PLAYER_HALF_LENGTH\n ) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {Array} predict ball\n */\nfunction canblockPredict(player, predict) {\n let first = true;\n let playery = 244 - 32;\n let speed = -16;\n for (let frame = 0; frame < predict.length; frame++) {\n playery += speed;\n if (sameside(player, predict[frame].x)) {\n if (first) {\n if (predict[frame].y > NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n return false;\n }\n first = false;\n continue;\n }\n if (Math.abs(predict[frame].x - GROUND_HALF_WIDTH) > 60) {\n return false;\n }\n if (predict[frame].y > playery) {\n return true;\n }\n }\n speed += 1;\n }\n return false;\n}\n\n/**\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {Ball} copyball ball\n * @param {Number} frame ball\n */\nfunction cantouch(player, copyball, frame) {\n if (copyball.y < 76) {\n return false;\n }\n if (\n sameside(player, copyball.x) &&\n Math.abs(copyball.x - player.x) <= 6 * frame + PLAYER_HALF_LENGTH + 6\n ) {\n let needframe = -1;\n if (player.state > 0) {\n needframe = 16 - player.yVelocity - (player.isPlayer2 ? 1 : 0);\n if (frame < needframe) {\n return (\n Math.abs(copyball.y - otherPlayerYpredict(player, frame)) <=\n PLAYER_HALF_LENGTH\n );\n }\n }\n let top = PLAYER_TOUCHING_GROUND_Y_COORD - PLAYER_HALF_LENGTH;\n let speed = -16;\n for (let count = 0; count < frame - needframe; count++) {\n top += speed;\n speed += 1;\n if (speed > 0) {\n break;\n }\n }\n return copyball.y >= top;\n }\n return false;\n}\n\n/**\n *\n * @param {Player} player The player whom computer contorls\n * @param {Ball} ball ball\n */\nfunction cancatch(player, ball) {\n for (let frame = 0; frame < ball.path.length; frame++) {\n const copyball = ball.path[frame];\n if (\n copyball.y >= PLAYER_TOUCHING_GROUND_Y_COORD - PLAYER_HALF_LENGTH &&\n Math.abs(player.x - copyball.x) <= PLAYER_HALF_LENGTH + 6 * frame + 6\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * FUN_00402360\n * Computer controls its player by this function.\n * Computer decides the user input for the player it controls,\n * according to the game situation it figures out\n * by the given parameters (player, ball and theOtherplayer),\n * and reflects these to the given user input object.\n * 如果球power hit 跑到 path最後位置\n * 如果球沒有power hit 跑到predict 最短路徑位置\n *\n * @param {Player} player The player whom computer contorls\n * @param {Ball} ball ball\n * @param {Player} theOtherPlayer The other player\n * @param {PikaUserInput} userInput user input of the player whom computer controls\n */\nfunction letAIDecideUserInput(player, ball, theOtherPlayer, userInput) {\n userInput.xDirection = 0;\n userInput.yDirection = 0;\n userInput.powerHit = 0;\n // console.log('frame:' + ball.frame);\n // console.log('xVelocity:' + ball.xVelocity);\n // console.log('yVelocity:' + ball.yVelocity);\n // console.log('tactics:' + player.tactics);\n // console.log('expectedLandingPointX:' + ball.expectedLandingPointX);\n // if (!player.isPlayer2) {\n // player.serve.executeMove(player, ball, theOtherPlayer, userInput);\n // return;\n // }\n\n // 判斷半步拖球\n // if (\n // ball.frame === 22 &&\n // ball.expectedLandingPointX === (player.isPlayer2 ? 184 : 248)\n // ) {\n // player.tactics = 1;\n // }\n // // 尾閃拖\n // if (\n // ball.frame === 22 &&\n // ball.expectedLandingPointX === (player.isPlayer2 ? 392 : 236)\n // ) {\n // player.tactics = 2;\n // }\n if (\n ball.frame < 5 &&\n (player.isPlayer2 ? ball.isPlayer2Serve : !ball.isPlayer2Serve)\n ) {\n // 發球\n player.tactics = 3;\n }\n if (player.tactics === 0) {\n // 平常狀態\n let virtualExpectedLandingPointX;\n let maychange = false;\n let diving = false;\n // check collision\n if (\n player.isCollisionWithBallHappened &&\n player.goodtime > -1 &&\n player.secondattack > -1\n ) {\n player.goodtime = -1;\n player.secondattack = -1;\n player.fancy = false;\n // player.fakeflat = false;\n player.juke = false;\n player.secondjump = false;\n player.frontfram = -1;\n console.log((player.isPlayer2 ? '2' : '1') + ':cancel attack');\n }\n let keep_touch = true;\n for (let frame = 0; frame < ball.path.length; frame++) {\n const copyball = ball.path[frame];\n if (\n !sameside(theOtherPlayer, copyball.x) &&\n cantouch(player, copyball, frame)\n ) {\n break;\n }\n if (cantouch(theOtherPlayer, copyball, frame)) {\n maychange = true;\n if (\n theOtherPlayer.isCollisionWithBallHappened &&\n theOtherPlayer.state === 2 &&\n keep_touch\n ) {\n maychange = false;\n }\n // console.log((player.isPlayer2 ? '2' : '1') + ':detect maychange');\n // console.log(copyball);\n } else {\n keep_touch = false;\n }\n }\n if (player.yVelocity === 16 && player.y === 244 && player.secondjump) {\n userInput.yDirection = -1;\n console.log((player.isPlayer2 ? '2' : '1') + ':second jump');\n\n player.secondjump = false;\n }\n if (maychange && player.goodtime < 0 && player.secondattack < 0) {\n // console.log((player.isPlayer2 ? '2' : '1') + ': predict');\n // predict defense\n let short_len = 1000;\n let short_x = ball.expectedLandingPointX;\n let short_direct = 4;\n player.cooldown = 0;\n let keep_touch = true;\n for (let frame = 0; frame < ball.path.length && frame < 32; frame++) {\n const copyball = ball.path[frame];\n if (cantouch(theOtherPlayer, copyball, frame)) {\n if (\n theOtherPlayer.isCollisionWithBallHappened &&\n theOtherPlayer.state === 2 &&\n keep_touch\n ) {\n continue;\n }\n for (let direct = 0; direct < 6; direct++) {\n const predict = copyball.predict[direct];\n // thunder\n if (\n direct > 3 &&\n predict.length > 3 &&\n predict[3].yVelocity < 3 &&\n sameside(theOtherPlayer, predict[1].x)\n ) {\n short_len = 0;\n short_x = GROUND_HALF_WIDTH;\n // console.log(\n // (player.isPlayer2 ? '2' : '1') + ':predict thunder defense'\n // );\n break;\n } else {\n // normal\n if (sameside(player, predict[predict.length - 1].x)) {\n if (predict.length < short_len) {\n short_len = predict.length;\n short_x = predict[predict.length - 1].x;\n short_direct = direct;\n }\n if (predict.length === short_len) {\n short_x = ((short_x + predict[predict.length - 1].x) / 2) | 0;\n if (direct === 0 || direct === 3) {\n short_direct = direct;\n }\n }\n }\n }\n }\n if (\n theOtherPlayer.state > 0 &&\n !theOtherPlayer.isCollisionWithBallHappened\n ) {\n break;\n }\n } else {\n keep_touch = false;\n }\n if (short_len === 0) {\n break;\n }\n }\n\n if (defense === 0) {\n // mid\n short_x = GROUND_HALF_WIDTH + (player.isPlayer2 ? 108 : -108);\n }\n if (defense === 1) {\n // mid_plus\n short_x =\n (GROUND_HALF_WIDTH +\n (player.isPlayer2 ? 54 : -54) +\n ((player.isPlayer2 ? 1 : -1) *\n Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH)) /\n 2) |\n 0;\n }\n if (defense === 2) {\n short_x =\n GROUND_HALF_WIDTH +\n (player.isPlayer2 ? 1 : -1) *\n Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH);\n }\n // predict === 3\n if (\n defense === 4 &&\n Math.abs(short_x - GROUND_HALF_WIDTH) > 44 &&\n // player.state === 0\n (player.state === 0 ||\n !(\n (short_direct === 0 || short_direct === 3) &&\n player.yVelocity < 0 &&\n Math.abs(short_x - GROUND_HALF_WIDTH) >\n GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH\n ))\n // !(\n // (short_direct === 0 || short_direct === 3) &&\n // (player.yVelocity < 0 || player.yVelocity > 11)\n // ))\n ) {\n short_x = GROUND_HALF_WIDTH + (player.isPlayer2 ? 44 : -44);\n }\n\n virtualExpectedLandingPointX = short_x;\n // second attack\n // if (player.secondattack > -1 && player.goodtime < 0) {\n // virtualExpectedLandingPointX = player.secondX;\n // }\n // console.log(\n // (player.isPlayer2 ? '2: ' : '1: ') + virtualExpectedLandingPointX\n // );\n // player.goodtime = -1;\n if (\n capability.jump &&\n theOtherPlayer.yVelocity === -10 &&\n theOtherPlayer.state === 1\n ) {\n userInput.yDirection = -1;\n virtualExpectedLandingPointX = GROUND_HALF_WIDTH;\n }\n } else {\n player.cooldown += 1;\n // console.log((player.isPlayer2 ? '2' : '1') + ': now');\n // normal defense\n if (player.cooldown > delay) {\n virtualExpectedLandingPointX = ball.expectedLandingPointX;\n }\n\n if (ball.path.length > 24) {\n virtualExpectedLandingPointX =\n ball.expectedLandingPointX +\n (player.isPlayer2 ? -6 : 6) * (ball.path.length - 24);\n }\n if (\n player.state > 0 &&\n player.yVelocity < 16 &&\n !player.isCollisionWithBallHappened\n ) {\n // jumping defense\n for (let frame = 0; frame < ball.path.length; frame++) {\n const copyball = ball.path[frame];\n if (\n sameside(player, copyball.x) &&\n Math.abs(playerYpredict(player, frame) - copyball.y) <=\n PLAYER_HALF_LENGTH &&\n Math.abs(player.x - copyball.x) <=\n 6 * frame + PLAYER_HALF_LENGTH + 6\n ) {\n virtualExpectedLandingPointX = copyball.x;\n // console.log('jumping defense');\n break;\n }\n }\n }\n // remove touch\n if (\n player.state > 0 &&\n player.yVelocity === ball.yVelocity - 1 &&\n player.isCollisionWithBallHappened &&\n Math.abs(playerYpredict(player, 0) - ball.y) <= PLAYER_HALF_LENGTH &&\n Math.abs(player.x - ball.x) <= PLAYER_HALF_LENGTH + 6\n ) {\n let cansmash = true;\n if (ball.path.length > 1) {\n const predictball = ball.path[1].predict[5];\n if (\n samesideloss(\n theOtherPlayer,\n predictball[predictball.length - 1].x\n ) &&\n predictball.length < 10\n ) {\n cansmash = true;\n } else {\n cansmash = false;\n }\n }\n if (\n ball.xVelocity !== 0 &&\n player.isPlayer2 === ball.xVelocity < 0 &&\n ball.yVelocity < 13 &&\n !cansmash\n ) {\n virtualExpectedLandingPointX =\n ball.x + (player.isPlayer2 ? 1 : -1) * (PLAYER_HALF_LENGTH - 3);\n // (ball.path.length > 1 ? ball.path[1].x : ball.x) +\n // (player.isPlayer2 ? 1 : -1) * (PLAYER_HALF_LENGTH - 2);\n } else {\n if (Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH) {\n virtualExpectedLandingPointX = player.x;\n } else {\n if (Math.abs(ball.xVelocity) < 2) {\n if (player.isPlayer2) {\n virtualExpectedLandingPointX = GROUND_WIDTH;\n } else {\n virtualExpectedLandingPointX = 0;\n }\n } else {\n if (ball.xVelocity < 0) {\n virtualExpectedLandingPointX = GROUND_WIDTH;\n } else {\n virtualExpectedLandingPointX = 0;\n }\n }\n }\n }\n }\n\n if (ball.yVelocity > 60 && ball.y < 244 - 32) {\n virtualExpectedLandingPointX = GROUND_HALF_WIDTH;\n userInput.yDirection = -1;\n }\n\n // attack\n if (\n player.cooldown > delay &&\n (player.secondattack < 0 ||\n (player.secondattack > -1 &&\n (player.state === 0 || player.yVelocity === 16))) &&\n player.state < 3\n ) {\n let shortPath = 100;\n const testflag = true;\n // jumping ball from x;\n if (\n player.goodtime !== 0 &&\n !player.fancy &&\n player.state > 0 &&\n player.yVelocity < 16 &&\n Math.abs(playerYpredict(player, 0) - ball.y) <= PLAYER_HALF_LENGTH &&\n Math.abs(player.x - ball.x) <= PLAYER_HALF_LENGTH + 6 &&\n sameside(player, ball.x) &&\n !player.isCollisionWithBallHappened\n ) {\n const copyball = ball.path[0];\n\n // fancy\n let flatX = 0;\n let dropX = 0;\n for (let direct = 0; capability.fancy && direct < 6; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n for (\n let predictframe = 1;\n predictframe < predict.length - 1;\n predictframe++\n ) {\n const predictball = predict[predictframe];\n if (!sameside(player, predictball.x)) {\n break;\n }\n if (\n direct === 2 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) <\n NET_PILLAR_HALF_WIDTH &&\n predictball.y > NET_PILLAR_TOP_BOTTOM_Y_COORD\n ) {\n dropX = predictball.x;\n }\n if (\n direct === 3 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) <\n NET_PILLAR_HALF_WIDTH\n ) {\n flatX = predictball.x;\n }\n if (\n true_rand() % 10 < 7 &&\n direct === 3 &&\n playerYpredictJump(player, predictframe + 1) === 228 &&\n Math.abs(\n predictball.y - playerYpredictJump(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredictJump(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 10000 <= shortPath\n ) {\n console.log(\n predict[predictframe - 1].y,\n playerYpredictJump(player, predictframe)\n );\n shortPath = predictframe - 10000;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2 ? 1 : -1) *\n ((Math.abs(predictball.x - GROUND_HALF_WIDTH) / 10) | 0);\n player.secondattack = predictframe + 1;\n player.secondjump = true;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':jump fancy flat jump'\n );\n }\n if (\n true_rand() % 10 < 7 &&\n direct === 2 &&\n playerYpredictJump(player, predictframe + 1) !== 244 &&\n Math.abs(\n predictball.y - playerYpredictJump(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredictJump(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath &&\n !(\n Math.abs(predictball.x - GROUND_HALF_WIDTH) > 20 ||\n predictball.y > 176\n )\n ) {\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.secondattack = predictframe + 1;\n player.secondjump = true;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':jump fancy jump'\n );\n }\n if (\n true_rand() % 10 < 7 &&\n direct === 2 &&\n dropX !== 0 &&\n Math.abs(player.x - dropX) > PLAYER_HALF_LENGTH &&\n Math.abs(\n predictball.y - playerYpredict(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath\n ) {\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3;\n player.attackX = copyball.x + shift;\n player.direction =\n player.isPlayer2 === copyball.x > predictball.x\n ? direct\n : -direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3);\n if (Math.abs(player.secondX - dropX) <= PLAYER_HALF_LENGTH) {\n player.secondX =\n dropX +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4);\n }\n player.secondattack = predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':jump fancy drop'\n );\n break;\n }\n if (\n true_rand() % 10 < 7 &&\n direct === 3 &&\n predictframe > 3 &&\n Math.abs(\n predictball.y - playerYpredict(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 1000 <= shortPath\n ) {\n shortPath = predictframe - 1000;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9;\n player.attackX = copyball.x + shift;\n player.direction =\n predictball.x < copyball.x === player.isPlayer2\n ? direct\n : -direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3);\n if (Math.abs(player.secondX - flatX) <= PLAYER_HALF_LENGTH) {\n player.secondX =\n flatX +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4);\n }\n player.secondattack = predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':jump fancy flat'\n );\n break;\n }\n if (\n true_rand() % 10 < 7 &&\n Math.abs(\n predictball.y - playerYpredict(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredict(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath\n ) {\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + (direct % 2 === 1 ? 9 : 3)\n : PLAYER_HALF_LENGTH - (direct % 2 === 1 ? 9 : 3);\n player.attackX = copyball.x + shift;\n player.direction =\n predictball.x < copyball.x === player.isPlayer2\n ? direct\n : -direct;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.secondattack = predictframe + 1;\n player.secondjump = false;\n console.log((player.isPlayer2 ? '2' : '1') + ':jump fancy');\n // console.log(predict);\n // console.log('predictframe ' + predictframe);\n // console.log('player.yVelocity ' + player.yVelocity);\n // console.log('direct ' + direct);\n break;\n }\n }\n }\n\n // normal\n if (shortPath > -1) {\n for (let direct = 0; direct < 6; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n if (\n (samesideloss(theOtherPlayer, predict[predict.length - 1].x) ||\n (player.state === 2 && predict.length > 20)) &&\n predict.length <= shortPath\n ) {\n shortPath = predict.length;\n player.goodtime = 0;\n player.attackX = copyball.x;\n player.direction = direct;\n console.log((player.isPlayer2 ? '2' : '1') + ':jump attack');\n }\n }\n }\n }\n if (player.goodtime < 0) {\n if (\n // 0sec\n player.state === 0 &&\n Math.abs(player.y - 16 - ball.y) <= PLAYER_HALF_LENGTH &&\n Math.abs(player.x - ball.x) <= PLAYER_HALF_LENGTH + 6 &&\n sameside(player, ball.x) &&\n !player.isCollisionWithBallHappened\n ) {\n const copyball = ball.path[0];\n\n // fancy\n for (let direct = 0; capability.fancy && direct < 2; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n if (direct === 0 && ball.yVelocity > 60) {\n continue;\n }\n const predict = copyball.predict[direct];\n // if (Math.abs(player.x - predict[0].x) > PLAYER_HALF_LENGTH + 6) {\n // continue;\n // }\n for (\n let predictframe = 1;\n predictframe < predict.length - 1;\n predictframe++\n ) {\n const predictball = predict[predictframe];\n if (!sameside(player, predictball.x)) {\n break;\n }\n if (\n true_rand() % 10 < 7 &&\n Math.abs(\n predictball.y - playerYpredict(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredict(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath\n ) {\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + (direct % 2 === 1 ? 9 : 3)\n : PLAYER_HALF_LENGTH - (direct % 2 === 1 ? 9 : 3);\n player.attackX = copyball.x + shift;\n player.direction = direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.juke = false;\n if (\n direct === 1 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) < 40\n ) {\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH\n : -PLAYER_HALF_LENGTH);\n player.juke = true;\n }\n player.secondattack = predictframe + 1;\n console.log((player.isPlayer2 ? '2' : '1') + ':0sec fancy');\n break;\n }\n }\n }\n\n // jump or miss\n if (\n player.secondattack < 0 &&\n shortPath > -1 &&\n sameside(player, ball.expectedLandingPointX) &&\n Math.abs(player.x - ball.expectedLandingPointX) >\n ball.path.length * 6 + PLAYER_HALF_LENGTH &&\n !cancatch(player, ball)\n ) {\n for (let direct = 0; direct < 2; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n if (\n (samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) ||\n predict.length > 20) &&\n (predict.length < shortPath ||\n (predict.length === shortPath && true_rand() % 2 < 1))\n ) {\n shortPath = predict.length;\n player.goodtime = 0;\n player.attackX = copyball.x;\n player.direction = direct;\n userInput.yDirection = -1;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':0sec attack miss'\n );\n }\n }\n }\n } else {\n for (\n let frame = 1;\n frame < ball.path.length && frame < 33;\n frame++\n ) {\n const copyball = ball.path[frame];\n // back\n if (\n Math.abs(ball.x - GROUND_HALF_WIDTH) >\n Math.abs(player.x - GROUND_HALF_WIDTH) &&\n sameside(player, ball.x) &&\n playerYpredict(player, frame) !== 244 &&\n (copyball.xVelocity === 0 ||\n copyball.xVelocity < 0 === player.isPlayer2) &&\n Math.abs(playerYpredict(player, frame) - copyball.y) <=\n PLAYER_HALF_LENGTH &&\n sameside(player, copyball.x) &&\n Math.abs(player.x - copyball.x) <=\n 6 * frame + PLAYER_HALF_LENGTH\n ) {\n // fancy\n let flatX = 0;\n for (let direct = 0; capability.fancy && direct < 6; direct++) {\n if (shortPath < 0 && player.direction === 4) {\n break;\n }\n const predict = copyball.predict[direct];\n for (\n let predictframe = 1;\n predictframe < predict.length - 1;\n predictframe++\n ) {\n const predictball = predict[predictframe];\n if (!sameside(player, predictball.x)) {\n break;\n }\n if (\n direct === 3 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) <\n NET_PILLAR_HALF_WIDTH\n ) {\n flatX = predictball.x;\n }\n if (\n true_rand() % 10 < 2 &&\n direct === 3 &&\n frame > 1 &&\n predictframe > 3 &&\n predictball.x < copyball.x === player.isPlayer2 &&\n Math.abs(\n predictball.y -\n playerYpredict(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(copyball.x - GROUND_HALF_WIDTH) >\n PLAYER_LENGTH &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe + PLAYER_LENGTH &&\n predictframe - 1000 <= shortPath\n ) {\n shortPath = predictframe - 1000;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH - 3\n : PLAYER_HALF_LENGTH + 3;\n player.attackX = copyball.x + shift;\n player.frontfram =\n ((frame - Math.abs(player.x - player.attackX) / 6) /\n 2) |\n 0;\n player.direction = -3;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3);\n if (\n Math.abs(player.secondX - flatX) <= PLAYER_HALF_LENGTH\n ) {\n player.secondX =\n flatX +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4);\n }\n player.secondattack = frame + predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':back fancy flat'\n );\n break;\n }\n }\n }\n }\n // front\n if (\n frame > 20 &&\n Math.abs(copyball.x - GROUND_HALF_WIDTH) < 61 &&\n playerYpredict(player, frame) !== 244 &&\n (copyball.xVelocity === 0 ||\n copyball.xVelocity > 0 === player.isPlayer2) &&\n Math.abs(playerYpredict(player, frame) - copyball.y) <=\n PLAYER_HALF_LENGTH &&\n sameside(player, copyball.x) &&\n Math.abs(player.x - copyball.x) <=\n 6 * frame + PLAYER_HALF_LENGTH\n ) {\n for (let direct = 3; direct < 6; direct += 2) {\n const predict = copyball.predict[direct];\n if (\n samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) &&\n (predict.length < shortPath || predict.length === shortPath)\n ) {\n shortPath = predict.length - 1000;\n player.goodtime = frame;\n const shift = player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n player.fancy = true;\n player.secondattack = -1;\n userInput.yDirection = -1;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':front attack'\n );\n }\n }\n }\n // normal\n if (\n playerYpredict(player, frame) !== 244 &&\n Math.abs(playerYpredict(player, frame) - copyball.y) <=\n PLAYER_HALF_LENGTH &&\n Math.abs(\n playerYpredict(player, frame - 1) - ball.path[frame - 1].y\n ) > PLAYER_HALF_LENGTH &&\n sameside(player, copyball.x) &&\n Math.abs(player.x - copyball.x) <=\n 6 * frame + PLAYER_HALF_LENGTH\n ) {\n // fancy\n let flatX = 0;\n let dropX = 0;\n for (let direct = 0; capability.fancy && direct < 6; direct++) {\n if (shortPath < 0 && player.direction === 4) {\n break;\n }\n const predict = copyball.predict[direct];\n for (\n let predictframe = 1;\n predictframe < predict.length - 1;\n predictframe++\n ) {\n const predictball = predict[predictframe];\n if (!sameside(player, predictball.x)) {\n break;\n }\n if (\n direct === 2 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) <\n NET_PILLAR_HALF_WIDTH &&\n predictball.y > NET_PILLAR_TOP_BOTTOM_Y_COORD\n ) {\n dropX = predictball.x;\n }\n if (\n direct === 3 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) <\n NET_PILLAR_HALF_WIDTH\n ) {\n flatX = predictball.x;\n }\n if (\n testflag &&\n true_rand() % 10 < 7 &&\n direct === 3 &&\n playerYpredictJump(player, frame + predictframe + 1) ===\n 228 &&\n Math.abs(\n predictball.y -\n playerYpredictJump(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredictJump(player, frame + predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe + PLAYER_LENGTH + 6 &&\n predictframe - 10000 <= shortPath\n ) {\n shortPath = predictframe - 10000;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2 ? 1 : -1) *\n ((Math.abs(predictball.x - GROUND_HALF_WIDTH) / 10) |\n 0);\n player.secondattack = frame + predictframe + 1;\n player.secondjump = true;\n console.log(\n (player.isPlayer2 ? '2' : '1') +\n ':normal fancy flat jump'\n );\n }\n let drop_second = false;\n if (\n testflag &&\n true_rand() % 10 < 7 &&\n direct === 2 &&\n playerYpredictJump(player, frame + predictframe + 1) !==\n 244 &&\n Math.abs(\n predictball.y -\n playerYpredictJump(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredictJump(player, frame + predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe + PLAYER_LENGTH &&\n predictframe - 100 <= shortPath &&\n !(\n Math.abs(predictball.x - GROUND_HALF_WIDTH) > 20 ||\n predictball.y > 176\n )\n ) {\n shortPath = predictframe - 100;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH - 9\n : -PLAYER_HALF_LENGTH + 9);\n player.secondattack = frame + predictframe + 1;\n player.secondjump = true;\n drop_second = true;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal fancy jump'\n );\n }\n if (\n testflag &&\n true_rand() % 10 < 7 &&\n direct === 2 &&\n dropX !== 0 &&\n frame > 15 &&\n Math.abs(\n predictball.y -\n playerYpredict(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe + PLAYER_LENGTH &&\n predictframe - 100 <= shortPath\n ) {\n shortPath = predictframe - 100;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3;\n player.attackX = copyball.x + shift;\n player.direction =\n player.isPlayer2 === copyball.x > predictball.x\n ? direct\n : -direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3);\n if (\n Math.abs(player.secondX - dropX) <= PLAYER_HALF_LENGTH\n ) {\n player.secondX =\n dropX +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4);\n }\n player.secondattack = frame + predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal fancy drop'\n );\n break;\n }\n if (\n testflag &&\n true_rand() % 10 < 7 &&\n direct === 3 &&\n frame > 1 &&\n predictframe > 3 &&\n Math.abs(\n predictball.y -\n playerYpredict(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(copyball.x - GROUND_HALF_WIDTH) <\n GROUND_HALF_WIDTH - 6 &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe + PLAYER_LENGTH &&\n predictframe - 1000 <= shortPath\n ) {\n shortPath = predictframe - 1000;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9;\n player.attackX = copyball.x + shift;\n player.direction =\n predictball.x < copyball.x === player.isPlayer2\n ? direct\n : -direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3);\n if (\n Math.abs(player.secondX - flatX) <= PLAYER_HALF_LENGTH\n ) {\n player.secondX =\n flatX +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH + 4\n : -PLAYER_HALF_LENGTH - 4);\n }\n player.secondattack = frame + predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal fancy flat'\n );\n break;\n }\n if (\n (true_rand() % 10 < 6 || drop_second) &&\n Math.abs(\n predictball.y -\n playerYpredict(player, frame + predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredict(player, frame + predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - copyball.x) <=\n 6 * predictframe +\n PLAYER_LENGTH +\n (direct % 2 === 1 ||\n (samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) &&\n direct > 0)\n ? 6\n : 0) &&\n predictframe - 100 <= shortPath\n ) {\n shortPath = predictframe - 100;\n player.goodtime = frame;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + (direct % 2 === 1 ? 9 : 3)\n : PLAYER_HALF_LENGTH - (direct % 2 === 1 ? 9 : 3);\n player.attackX = copyball.x + shift;\n player.direction =\n predictball.x < copyball.x === player.isPlayer2\n ? direct\n : -direct;\n userInput.yDirection = -1;\n player.fancy = true;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.juke = false;\n if (\n direct === 1 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) < 40\n ) {\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH\n : -PLAYER_HALF_LENGTH);\n player.juke = true;\n }\n player.secondattack = frame + predictframe + 1;\n player.secondjump = false;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal fancy'\n );\n break;\n }\n }\n }\n // normal\n if (shortPath > -1) {\n // jump or miss\n if (\n player.secondattack < 0 &&\n samesideloss(player, ball.expectedLandingPointX) &&\n Math.abs(player.x - ball.expectedLandingPointX) >\n ball.path.length * 6 + PLAYER_HALF_LENGTH &&\n !cancatch(player, ball)\n ) {\n for (let direct = 0; direct < 6; direct++) {\n const predict = copyball.predict[direct];\n if (\n (samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) ||\n predict.length > 20) &&\n (predict.length < shortPath ||\n (predict.length === shortPath && true_rand() % 2 < 1))\n ) {\n shortPath = predict.length;\n player.goodtime = frame;\n player.attackX = copyball.x;\n player.direction = direct;\n player.secondattack = -1;\n userInput.yDirection = -1;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal attack miss'\n );\n }\n }\n } else {\n // noraml;\n for (let direct = 0; direct < 6; direct++) {\n // up forward disable;\n if (direct === 1) {\n continue;\n }\n // early hit\n if (\n !capability.early_ball &&\n direct < 4 &&\n player.state === 0 &&\n frame < 10 + (true_rand() % 6) &&\n theOtherPlayer.yVelocity > -1\n // Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH) < 144 &&\n // (theOtherPlayer.yVelocity > -2 ||\n // Math.abs(copyball.x - GROUND_HALF_WIDTH) > 72)\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n // up smash only font side\n if (direct === 0) {\n if (\n Math.abs(copyball.x - GROUND_HALF_WIDTH) > 50 &&\n Math.abs(copyball.x - GROUND_HALF_WIDTH) <= 144\n ) {\n continue;\n }\n // if (Math.abs(copyball.x - GROUND_HALF_WIDTH) >= 144) {\n // let cross_net = false;\n // for (let frame = 0; frame < predict.length; frame++) {\n // if (sameside(theOtherPlayer, predict[frame].x)) {\n // if (\n // predict[frame].y > NET_PILLAR_TOP_BOTTOM_Y_COORD\n // ) {\n // cross_net = true;\n // }\n // break;\n // }\n // }\n // if (!cross_net) {\n // continue;\n // }\n // }\n }\n // long ball\n if (\n predict.length > 20 + (true_rand() % 20) &&\n (theOtherPlayer.yVelocity > -1 ||\n Math.abs(copyball.x - GROUND_HALF_WIDTH) > 72)\n ) {\n continue;\n }\n // far ball\n if (\n Math.abs(copyball.x - GROUND_HALF_WIDTH) > 120 &&\n direct > 0\n ) {\n continue;\n }\n if (\n testflag &&\n true_rand() % 10 < 6 &&\n samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) &&\n (predict.length < shortPath ||\n (predict.length === shortPath && true_rand() % 2 < 1))\n ) {\n shortPath = predict.length;\n player.goodtime = frame;\n const shift = player.isPlayer2\n ? -PLAYER_HALF_LENGTH + (direct % 2 === 1 ? 15 : 9)\n : PLAYER_HALF_LENGTH - (direct % 2 === 1 ? 15 : 9);\n player.attackX = copyball.x + shift;\n player.direction = direct;\n player.secondattack = -1;\n userInput.yDirection = -1;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':normal attack'\n );\n console.log(frame, copyball.x, direct);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n if (\n capability.diving &&\n player.state < 3 &&\n player.goodtime < 0 &&\n player.secondattack < 0 &&\n ball.path.length < 12 &&\n ball.expectedLandingPointX > player.x === ball.x > player.x &&\n sameside(player, ball.expectedLandingPointX) &&\n Math.abs(player.x - ball.expectedLandingPointX) >\n ball.path.length * 6 + PLAYER_HALF_LENGTH &&\n !cancatch(player, ball)\n ) {\n diving = true;\n console.log((player.isPlayer2 ? '2' : '1') + ':diving');\n }\n }\n if (player.goodtime > -1) {\n virtualExpectedLandingPointX = player.attackX;\n }\n if (player.frontfram > 0) {\n virtualExpectedLandingPointX = GROUND_HALF_WIDTH;\n player.frontfram -= 1;\n }\n if (player.secondattack > -1 && player.goodtime < 0) {\n virtualExpectedLandingPointX = player.secondX;\n }\n // move\n if (Math.abs(player.x - virtualExpectedLandingPointX) > 3) {\n if (player.x < virtualExpectedLandingPointX) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n // } else if (\n // player.state > 0 &&\n // player.goodtime > 3 &&\n // player.goodtime % 4 === 0 &&\n // Math.abs(player.x - GROUND_HALF_WIDTH) > PLAYER_HALF_LENGTH + 12 &&\n // Math.abs(player.x - GROUND_HALF_WIDTH) <\n // GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH - 12\n // ) {\n // player.fakeflat = true;\n }\n // if (player.fakeflat) {\n // const fakeframe = player.goodtime % 4;\n // if (fakeframe === 0 || fakeframe === 3) {\n // userInput.xDirection = -1;\n // } else {\n // userInput.xDirection = 1;\n // }\n // if (player.isPlayer2) {\n // userInput.xDirection *= -1;\n // }\n // if (\n // ball.path[player.goodtime].x > virtualExpectedLandingPointX ===\n // player.isPlayer2\n // ) {\n // userInput.xDirection *= -1;\n // }\n // if (player.goodtime === 1) {\n // player.fakeflat = false;\n // }\n // }\n // diving\n if (diving) {\n userInput.powerHit = 1;\n diving = false;\n }\n // super up smash\n if (\n player.secondattack > 0 &&\n player.state === 2 &&\n !player.isCollisionWithBallHappened &&\n player.direction < 2 &&\n ball.yVelocity < -27 &&\n Math.abs(playerYpredict(player, 0) - ball.y) <= PLAYER_HALF_LENGTH\n ) {\n userInput.xDirection = 0;\n userInput.yDirection = -1;\n player.goodtime = -1;\n player.secondattack = -1;\n player.fancy = false;\n // player.fakeflat = false;\n player.juke = false;\n player.secondjump = false;\n player.frontfram = -1;\n }\n // prevent self kill\n if (\n player.secondattack > -1 &&\n player.state === 2 &&\n !player.isCollisionWithBallHappened &&\n userInput.xDirection === 0 &&\n (player.isPlayer2 ? ball.xVelocity === 20 : ball.xVelocity === -20) &&\n Math.abs(player.x - GROUND_HALF_WIDTH) < PLAYER_HALF_LENGTH + 25 &&\n Math.abs(player.x - ball.x) <= PLAYER_HALF_LENGTH &&\n Math.abs(playerYpredict(player, 0) - ball.y) <= PLAYER_HALF_LENGTH\n ) {\n userInput.xDirection = player.isPlayer2 ? 1 : -1;\n console.log((player.isPlayer2 ? '2' : '1') + ':prevent self-kill');\n }\n // attack\n if (\n player.goodtime === 0 ||\n (player.state > 0 && player.yVelocity < 16 && player.secondattack === 0)\n ) {\n userInput.powerHit = 1;\n if (!player.fancy) {\n const copyball = ball.path[0];\n if (player.secondattack === 0) {\n var shortPath = 100;\n var newdirect = -1;\n\n // fancy\n for (\n let direct = 0;\n !player.juke && capability.fancy && direct < 6;\n direct++\n ) {\n if (\n Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n if (Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH + 6) {\n continue;\n }\n if (true_rand() % 10 < 1) {\n continue;\n }\n const predict = copyball.predict[direct];\n for (\n let predictframe = 1;\n predictframe < predict.length - 1;\n predictframe++\n ) {\n const predictball = predict[predictframe];\n if (!sameside(player, predictball.x)) {\n break;\n }\n if (\n direct === 2 &&\n playerYpredictJump(player, predictframe + 1) !== 244 &&\n Math.abs(\n predictball.y - playerYpredictJump(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredictJump(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath &&\n !(\n Math.abs(predictball.x - GROUND_HALF_WIDTH) > 20 ||\n predictball.y > 176\n )\n ) {\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + 3\n : PLAYER_HALF_LENGTH - 3;\n player.attackX = copyball.x + shift;\n player.direction = direct;\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.secondattack = predictframe + 1;\n player.secondjump = true;\n console.log(\n (player.isPlayer2 ? '2' : '1') + ':second fancy jump'\n );\n }\n if (\n Math.abs(\n predictball.y - playerYpredict(player, predictframe + 1)\n ) <= PLAYER_HALF_LENGTH &&\n Math.abs(\n predict[predictframe - 1].y -\n playerYpredict(player, predictframe)\n ) > PLAYER_HALF_LENGTH &&\n Math.abs(predictball.x - player.x) <=\n 6 * predictframe + PLAYER_HALF_LENGTH + 6 &&\n predictframe - 100 <= shortPath\n ) {\n if (\n shortPath < 0 &&\n (direct === 2 || direct === 3 || newdirect === 4)\n ) {\n break;\n }\n shortPath = predictframe - 100;\n player.goodtime = 0;\n const shift =\n predictball.x < copyball.x\n ? -PLAYER_HALF_LENGTH + (direct % 2 === 1 ? 9 : 3)\n : PLAYER_HALF_LENGTH - (direct % 2 === 1 ? 9 : 3);\n player.attackX = copyball.x + shift;\n player.direction =\n predictball.x < copyball.x === player.isPlayer2\n ? direct\n : -direct;\n newdirect = Math.abs(direct);\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? -PLAYER_HALF_LENGTH + 9\n : PLAYER_HALF_LENGTH - 9);\n player.juke = false;\n if (\n direct === 1 &&\n Math.abs(predictball.x - GROUND_HALF_WIDTH) < 40\n ) {\n player.secondX =\n predictball.x +\n (player.isPlayer2\n ? PLAYER_HALF_LENGTH\n : -PLAYER_HALF_LENGTH);\n player.juke = true;\n }\n player.secondattack = predictframe + 1;\n player.secondjump = false;\n console.log((player.isPlayer2 ? '2' : '1') + ':second fancy');\n break;\n }\n }\n }\n\n // normal\n if (shortPath > -1) {\n const lastdirection = player.direction;\n player.direction = 1;\n for (let direct = 0; direct < 6; direct++) {\n if (\n Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n if (samesideloss(theOtherPlayer, predict[predict.length - 1].x)) {\n if (predict.length < shortPath) {\n player.direction = direct;\n shortPath = predict.length;\n } else if (\n predict.length === shortPath &&\n true_rand() % 2 < 1\n ) {\n player.direction = direct;\n shortPath = predict.length;\n }\n if (\n Math.abs(ball.x - GROUND_HALF_WIDTH) > 120 &&\n direct === 3\n ) {\n player.direction = 1;\n }\n console.log((player.isPlayer2 ? '2' : '1') + ':second attack');\n // userInput.powerHit = 1;\n }\n }\n // up and down anti-predict\n if (\n lastdirection === 0 &&\n theOtherPlayer.state > 0 &&\n player.direction > 3\n ) {\n if (Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH) {\n player.direction = 1;\n } else {\n player.direction = 0;\n }\n console.log((player.isPlayer2 ? '2' : '1') + ':anti predict');\n }\n // 2nd jump fail\n if (player.yVelocity < -10 && player.direction < 4) {\n if (\n Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH ||\n Math.abs(ball.x - GROUND_HALF_WIDTH) > 72\n ) {\n player.direction = 1;\n } else {\n player.direction = 0;\n }\n console.log((player.isPlayer2 ? '2' : '1') + ':2nd jump fail');\n }\n // anti-block\n if (\n player.direction === 3 &&\n Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH) < 72 &&\n (Math.abs(player.x - GROUND_HALF_WIDTH) > 108 ||\n Math.abs(theOtherPlayer.y + theOtherPlayer.yVelocity - ball.y) <\n PLAYER_HALF_LENGTH)\n ) {\n if (\n Math.abs(ball.x - player.x) > PLAYER_HALF_LENGTH ||\n Math.abs(ball.x - GROUND_HALF_WIDTH) > 72\n ) {\n player.direction = 1;\n } else {\n player.direction = 0;\n }\n console.log((player.isPlayer2 ? '2' : '1') + ':anti block');\n }\n }\n\n // juke\n if (player.juke && player.secondattack === 0) {\n console.log((player.isPlayer2 ? '2' : '1') + ':juke');\n if (\n (true_rand() % 10 < 5 || ball.x === GROUND_HALF_WIDTH) &&\n !(\n theOtherPlayer.state > 0 &&\n Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH) < 72 &&\n theOtherPlayer.yVelocity < 10\n )\n ) {\n player.direction = -3;\n }\n player.juke = false;\n }\n } else {\n const org = copyball.predict[player.direction];\n // attack farthest\n if (\n player.y <= theOtherPlayer.y &&\n Math.abs(theOtherPlayer.x - org[org.length - 1].x) <=\n org.length * 6 + PLAYER_HALF_LENGTH &&\n true_rand() % 10 < 2\n ) {\n let farthest = 0;\n for (let direct = 0; direct < 6; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n const far = Math.abs(\n theOtherPlayer.x - predict[predict.length - 1].x\n );\n if (\n predict.length < 50 &&\n samesideloss(theOtherPlayer, predict[predict.length - 1].x) &&\n far >= farthest\n ) {\n farthest = far;\n player.direction = direct;\n console.log((player.isPlayer2 ? '2' : '1') + ':far attack');\n }\n }\n }\n\n // anti block\n if (\n capability.anti_block &&\n theOtherPlayer.state < 3 &&\n (player.yVelocity < 0 ||\n Math.abs(ball.x - GROUND_HALF_WIDTH) > 144) && // 216-32-72\n Math.abs(theOtherPlayer.x - GROUND_HALF_WIDTH) < 144\n ) {\n console.log((player.isPlayer2 ? '2' : '1') + ':anti block');\n // console.log(player.isPlayer2);\n let canbypass = false;\n let short_path = 1000;\n // noraml\n if (theOtherPlayer.state === 0 || theOtherPlayer.yVelocity > 12) {\n if (\n canblockPredict(\n theOtherPlayer,\n copyball.predict[player.direction]\n )\n ) {\n for (let direct = 0; direct < 6; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n if (\n samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) &&\n predict.length <= short_path &&\n (direct > 3 || !canblockPredict(theOtherPlayer, predict))\n ) {\n short_path = predict.length;\n player.direction = direct;\n canbypass = true;\n }\n }\n } else {\n canbypass = true;\n }\n } else {\n // jump\n if (\n canblock(theOtherPlayer, copyball.predict[player.direction])\n ) {\n for (let direct = 0; direct < 6; direct++) {\n if (\n Math.abs(player.x - ball.x) > PLAYER_HALF_LENGTH &&\n direct % 2 === 0\n ) {\n continue;\n }\n const predict = copyball.predict[direct];\n if (\n samesideloss(\n theOtherPlayer,\n predict[predict.length - 1].x\n ) &&\n predict.length <= short_path &&\n ((direct > 3 && true_rand() % 10 < 2) ||\n !canblock(theOtherPlayer, predict))\n ) {\n short_path = predict.length;\n player.direction = direct;\n canbypass = true;\n }\n }\n } else {\n canbypass = true;\n }\n }\n\n if (\n canbypass &&\n player.direction === 0 &&\n player.yVelocity < -10 &&\n Math.abs(ball.x - GROUND_HALF_WIDTH) > 72\n ) {\n player.direction = 1;\n }\n\n if (!canbypass) {\n player.direction = 1;\n console.log((player.isPlayer2 ? '2' : '1') + ':block');\n }\n }\n\n // block\n if (\n !capability.block &&\n ball.isPowerHit &&\n player.isPlayer2 === ball.xVelocity > 0 &&\n Math.abs(ball.x - GROUND_HALF_WIDTH) < 72\n ) {\n userInput.powerHit = 0;\n }\n }\n } else {\n if (\n player.direction === 0 &&\n Math.abs(player.x - player.secondX) >\n 6 * player.secondattack + PLAYER_LENGTH - 9\n ) {\n userInput.powerHit = 0;\n player.secondattack = -1;\n console.log('cancel 0 fancy');\n }\n player.fancy = false;\n // player.fakeflat = false;\n }\n console.log((player.isPlayer2 ? '2' : '1') + ':hit');\n // console.log(player.x);\n // console.log(player.y + player.yVelocity);\n console.log(ball.path[0]);\n console.log(ball.path[0].predict[Math.abs(player.direction)]);\n if (player.direction === 0) {\n userInput.yDirection = -1;\n userInput.xDirection = 0;\n }\n if (player.direction === 1) {\n userInput.yDirection = -1;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? -1\n : 1\n : userInput.xDirection;\n }\n if (player.direction === -1) {\n userInput.yDirection = -1;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? 1\n : -1\n : userInput.xDirection;\n }\n if (player.direction === 2 || player.direction === -2) {\n userInput.yDirection = 0;\n userInput.xDirection = 0;\n }\n if (player.direction === 3) {\n userInput.yDirection = 0;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? -1\n : 1\n : userInput.xDirection;\n }\n if (player.direction === -3) {\n userInput.yDirection = 0;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? 1\n : -1\n : userInput.xDirection;\n }\n if (player.direction === 4 || player.direction === -4) {\n userInput.yDirection = 1;\n userInput.xDirection = 0;\n }\n if (player.direction === 5) {\n userInput.yDirection = 1;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? -1\n : 1\n : userInput.xDirection;\n }\n if (player.direction === -5) {\n userInput.yDirection = 1;\n userInput.xDirection =\n userInput.xDirection === 0\n ? player.isPlayer2\n ? 1\n : -1\n : userInput.xDirection;\n }\n }\n player.goodtime -= 1;\n player.secondattack -= 1;\n }\n if (player.tactics === 3) {\n player.serve.executeMove(player, ball, theOtherPlayer, userInput);\n if (player.serve.framesLeft < -1000) {\n player.tactics = 0;\n }\n }\n}\n\nconst actionType = {\n wait: 0,\n forward: 1,\n forwardUp: 2,\n up: 3,\n backwardUp: 4,\n backward: 5,\n backwardDown: 6,\n down: 7,\n forwardDown: 8,\n forwardSmash: 9,\n forwardUpSmash: 10,\n upSmash: 11,\n backwardUpSmash: 12,\n backwardSmash: 13,\n backwardDownSmash: 14,\n downSmash: 15,\n forwardDownSmash: 16,\n};\nconst player1Formula = [\n [\n // 0. Break net\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 26 },\n { action: actionType.forwardUp, frames: 4 },\n { action: actionType.forwardDownSmash, frames: 1 },\n ],\n [\n // 1. Break net(fake, flat)\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 30 },\n { action: actionType.forwardUp, frames: 1 },\n { action: actionType.forwardSmash, frames: 2 },\n ],\n [\n // 2. Head thunder\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 15 },\n { action: actionType.downSmash, frames: 1 },\n { action: actionType.forwardDownSmash, frames: 4 },\n ],\n [\n // 3. Head thunder(fake, flat)\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 15 },\n { action: actionType.forwardSmash, frames: 1 },\n ],\n [\n // 4. Net V smash\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 31 },\n { action: actionType.forwardUpSmash, frames: 3 },\n { action: actionType.wait, frames: 16 },\n { action: actionType.downSmash, frames: 5 },\n ],\n [\n // 5. Net R smash\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 31 },\n { action: actionType.forwardUpSmash, frames: 3 },\n { action: actionType.wait, frames: 16 },\n { action: actionType.upSmash, frames: 1 },\n ],\n [\n // 6. Net G smash\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 31 },\n { action: actionType.forwardUpSmash, frames: 3 },\n { action: actionType.wait, frames: 16 },\n { action: actionType.forwardSmash, frames: 1 },\n ],\n [\n // 7. Net dodge\n { action: actionType.forward, frames: 1 },\n { action: actionType.wait, frames: 20 },\n { action: actionType.forward, frames: 31 },\n { action: actionType.forwardUpSmash, frames: 3 },\n { action: actionType.wait, frames: 16 },\n { action: actionType.backward, frames: 1 },\n ],\n [\n // 8. Tail thunder\n { action: actionType.forward, frames: 7 },\n { action: actionType.wait, frames: 14 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 15 },\n { action: actionType.downSmash, frames: 5 },\n ],\n [\n // 9. Tail thunder(fake, flat)\n { action: actionType.forward, frames: 7 },\n { action: actionType.wait, frames: 14 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 15 },\n { action: actionType.forwardSmash, frames: 1 },\n ],\n];\nconst player2Formula = [\n player1Formula[0].slice(), // 0. Break net\n player1Formula[1].slice(), // 1. Break net(fake, flat)\n player1Formula[2].slice(), // 2. Head thunder\n player1Formula[3].slice(), // 3. Head thunder(fake, flat)\n player1Formula[4].slice(), // 4. Net thunder\n player1Formula[6].slice(), // 5. Net thunder(fake, flat)\n [\n // 6. Tail thunder\n { action: actionType.forward, frames: 7 },\n { action: actionType.wait, frames: 14 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 2 },\n { action: actionType.wait, frames: 13 },\n { action: actionType.forwardDownSmash, frames: 5 },\n ],\n [\n // 7. Tail thunder(fake, flat)\n { action: actionType.forward, frames: 7 },\n { action: actionType.wait, frames: 14 },\n { action: actionType.forward, frames: 11 },\n { action: actionType.forwardUp, frames: 2 },\n { action: actionType.wait, frames: 13 },\n { action: actionType.forwardSmash, frames: 1 },\n ],\n];\nconst noserve = [\n { action: actionType.forwardUp, frames: 1 },\n { action: actionType.wait, frames: 11 },\n { action: actionType.forwardUpSmash, frames: 1 },\n];\nclass ServeMachine {\n constructor(isPlayer2) {\n this.isPlayer2 = isPlayer2;\n\n if (isPlayer2 === false) this.skillCount = 10;\n else if (isPlayer2 === true) this.skillCount = 8;\n this.randServeIndex = this.skillCount - 1;\n this.skillList = [...Array(this.skillCount).keys()];\n this.usingFullSkill = -1;\n // console.log(this.skillList);\n }\n shuffle() {\n for (let i = this.skillCount - 1; i >= 0; i--) {\n var randomIndex = Math.floor(Math.random() * (i + 1));\n // swap\n const temp = this.skillList[randomIndex];\n this.skillList[randomIndex] = this.skillList[i];\n this.skillList[i] = temp;\n }\n this.randServeIndex = 0;\n }\n chooseNextSkill() {\n while (1) {\n // get next\n this.usingFullSkill = this.skillList[this.randServeIndex];\n this.randServeIndex++;\n // if (this.randServeIndex === this.skillCount)\n this.shuffle();\n // check if it's available\n if (\n this.isPlayer2 === false &&\n SkillTypeForPlayer1Available[this.usingFullSkill] === true\n )\n return;\n else if (\n this.isPlayer2 === true &&\n SkillTypeForPlayer2Available[this.usingFullSkill] === true\n )\n return;\n }\n }\n initializeForNewRound() {\n this.chooseNextSkill();\n this.framesLeft = 0;\n this.phase = 0;\n }\n executeMove(player, ball, theOtherPlayer, userInput) {\n // move\n this.getNextAction();\n this.framesLeft--;\n if (this.action === actionType.forward) {\n userInput.xDirection = 1;\n } else if (this.action === actionType.forwardUp) {\n userInput.xDirection = 1;\n userInput.yDirection = -1;\n } else if (this.action === actionType.forwardDownSmash) {\n userInput.xDirection = 1;\n userInput.yDirection = 1;\n userInput.powerHit = 1;\n } else if (this.action === actionType.forwardSmash) {\n userInput.xDirection = 1;\n userInput.powerHit = 1;\n } else if (this.action === actionType.downSmash) {\n userInput.yDirection = 1;\n userInput.powerHit = 1;\n } else if (this.action === actionType.upSmash) {\n userInput.yDirection = -1;\n userInput.powerHit = 1;\n } else if (this.action === actionType.forwardUpSmash) {\n userInput.xDirection = 1;\n userInput.yDirection = -1;\n userInput.powerHit = 1;\n } else if (this.action === actionType.backward) {\n userInput.xDirection = -1;\n }\n // console.log(this.action);\n if (this.isPlayer2 === true) {\n userInput.xDirection = -userInput.xDirection;\n }\n return;\n }\n getNextAction() {\n if (this.framesLeft === 0) {\n // check formula\n if (capability.serve === false) {\n if (this.phase < noserve.length) {\n this.action = noserve[this.phase].action;\n this.framesLeft = noserve[this.phase].frames;\n } else {\n // don't move\n this.action = actionType.wait;\n this.framesLeft = -1000;\n }\n } else if (this.isPlayer2 === false) {\n if (this.phase < player1Formula[this.usingFullSkill].length) {\n this.action = player1Formula[this.usingFullSkill][this.phase].action;\n this.framesLeft =\n player1Formula[this.usingFullSkill][this.phase].frames;\n } else {\n // don't move\n this.action = actionType.wait;\n this.framesLeft = -1000;\n }\n } else if (this.isPlayer2 === true) {\n if (this.phase < player2Formula[this.usingFullSkill].length) {\n this.action = player2Formula[this.usingFullSkill][this.phase].action;\n this.framesLeft =\n player2Formula[this.usingFullSkill][this.phase].frames;\n } else {\n // don't move\n this.action = actionType.wait;\n this.framesLeft = -1000;\n }\n }\n this.phase++;\n }\n\n if (this.framesLeft === 0) {\n this.getNextAction();\n }\n }\n}\n","/**\n * This module takes charge of the physical motion of clouds (on the sky) and wave (on the bottom of game screen) in the game.\n * It is also a Model in MVC pattern and also rendered by \"view.js\".\n *\n * It is gained by reverse engineering the original game.\n * The address of the original function is in the comment.\n * ex) FUN_00404770 means the function at the address 00404770 in the machine code.\n */\n'use strict';\nimport { rand } from './rand.js';\n\n/**\n * Class represents a cloud\n */\nexport class Cloud {\n constructor() {\n this.topLeftPointX = -68 + (rand() % (432 + 68));\n this.topLeftPointY = rand() % 152;\n this.topLeftPointXVelocity = 1 + (rand() % 2);\n this.sizeDiffTurnNumber = rand() % 11;\n }\n\n get sizeDiff() {\n // this same as return [0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0][this.sizeDiffTurnNumber]\n return 5 - Math.abs(this.sizeDiffTurnNumber - 5);\n }\n\n get spriteTopLeftPointX() {\n return this.topLeftPointX - this.sizeDiff;\n }\n\n get spriteTopLeftPointY() {\n return this.topLeftPointY - this.sizeDiff;\n }\n\n get spriteWidth() {\n return 48 + 2 * this.sizeDiff;\n }\n\n get spriteHeight() {\n return 24 + 2 * this.sizeDiff;\n }\n}\n\n/**\n * Class representing wave\n */\nexport class Wave {\n constructor() {\n this.verticalCoord = 0;\n this.verticalCoordVelocity = 2;\n this.yCoords = [];\n for (let i = 0; i < 432 / 16; i++) {\n this.yCoords.push(314);\n }\n }\n}\n\n/**\n * FUN_00404770\n * Move clouds and wave\n * @param {Cloud[]} cloudArray\n * @param {Wave} wave\n */\nexport function cloudAndWaveEngine(cloudArray, wave) {\n for (let i = 0; i < 10; i++) {\n cloudArray[i].topLeftPointX += cloudArray[i].topLeftPointXVelocity;\n if (cloudArray[i].topLeftPointX > 432) {\n cloudArray[i].topLeftPointX = -68;\n cloudArray[i].topLeftPointY = rand() % 152;\n cloudArray[i].topLeftPointXVelocity = 1 + (rand() % 2);\n }\n cloudArray[i].sizeDiffTurnNumber =\n (cloudArray[i].sizeDiffTurnNumber + 1) % 11;\n }\n\n wave.verticalCoord += wave.verticalCoordVelocity;\n if (wave.verticalCoord > 32) {\n wave.verticalCoord = 32;\n wave.verticalCoordVelocity = -1;\n } else if (wave.verticalCoord < 0 && wave.verticalCoordVelocity < 0) {\n wave.verticalCoordVelocity = 2;\n wave.verticalCoord = -(rand() % 40);\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n wave.yCoords[i] = 314 - wave.verticalCoord + (rand() % 3);\n }\n}\n","/**\n * The View part in the MVC pattern\n *\n * Some codes in this module are gaind by reverse engineering the original machine code.\n * The codes gain by reverse engineering are commented by the refered funcion address in the machine code.\n * ex) FUN_00405d50 means the function at the address 00405d50 in the machine code.\n */\n'use strict';\nimport { Container, Sprite, AnimatedSprite, Graphics } from 'pixi.js-legacy';\nimport { Cloud, Wave, cloudAndWaveEngine } from './cloud_and_wave.js';\nimport { ASSETS_PATH } from './assets_path.js';\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\n\n/** @constant @type {number} number of clouds to be rendered */\nconst NUM_OF_CLOUDS = 10;\n\n/**\n * Class representing intro view where the man with a briefcase mark appers\n */\nexport class IntroView {\n /**\n * Create an IntroView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.mark = makeSpriteWithAnchorXY(textures, TEXTURES.MARK, 0.5, 0.5);\n this.mark.x = 432 / 2;\n this.mark.y = 304 / 2;\n\n this.container = new Container();\n this.container.addChild(this.mark);\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n }\n\n /**\n * draw \"a man with a briefcase\" mark\n * @param {number} frameCounter\n */\n drawMark(frameCounter) {\n const mark = this.mark;\n if (frameCounter === 0) {\n mark.alpha = 0;\n return;\n }\n if (frameCounter < 100) {\n mark.alpha = Math.min(1, mark.alpha + 1 / 25);\n } else if (frameCounter >= 100) {\n mark.alpha = Math.max(0, mark.alpha - 1 / 25);\n }\n }\n}\n\n/**\n * Class representing menu view where you can select \"play with computer\" or \"play with friend\"\n */\nexport class MenuView {\n /**\n * Create a MenuView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.messages = {\n pokemon: makeSpriteWithAnchorXY(textures, TEXTURES.POKEMON, 0, 0),\n pikachuVolleyball: makeSpriteWithAnchorXY(\n textures,\n TEXTURES.PIKACHU_VOLLEYBALL,\n 0,\n 0\n ),\n withWho: [\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_COMPUTER, 0, 0),\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_FRIEND, 0, 0),\n ],\n sachisoft: makeSpriteWithAnchorXY(textures, TEXTURES.SACHISOFT, 0, 0),\n fight: makeSpriteWithAnchorXY(textures, TEXTURES.FIGHT, 0, 0),\n };\n this.sittingPikachuTilesContainer =\n makeSittingPikachuTilesContainer(textures);\n\n // refered FUN_004059f0\n this.messages.sachisoft.x = 216 - this.messages.sachisoft.texture.width / 2;\n this.messages.sachisoft.y = 264;\n\n // refered FUN_00405b70\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.y = 80;\n this.messages.pokemon.x = 170;\n this.messages.pokemon.y = 40;\n\n this.container = new Container();\n this.container.addChild(this.sittingPikachuTilesContainer);\n this.container.addChild(this.messages.pokemon);\n this.container.addChild(this.messages.pikachuVolleyball);\n this.container.addChild(this.messages.withWho[0]);\n this.container.addChild(this.messages.withWho[1]);\n this.container.addChild(this.messages.sachisoft);\n this.container.addChild(this.messages.fight);\n this.initializeVisibles();\n\n this.sittingPikachuTilesDisplacement = 0;\n this.selectedWithWho = -1; // 0: with computer, 1: with friend, -1: not selected\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view, initialize visibilities of sprites in this view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n /**\n * refered FUN_00405d50\n * Draw \"fight!\" message which get bigger and smaller as frame goes\n * @param {number} frameCounter\n */\n drawFightMessage(frameCounter) {\n const sizeArray = [20, 22, 25, 27, 30, 27, 25, 22, 20];\n const fightMessage = this.messages.fight;\n const w = fightMessage.texture.width;\n const h = fightMessage.texture.height;\n\n if (frameCounter === 0) {\n fightMessage.visible = true;\n }\n\n if (frameCounter < 30) {\n const halfWidth = Math.floor(Math.floor((frameCounter * w) / 30) / 2);\n const halfHeight = Math.floor(Math.floor((frameCounter * h) / 30) / 2);\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // height\n fightMessage.x = 100 - halfWidth; // x coor\n fightMessage.y = 70 - halfHeight; // y coord\n } else {\n const index = (frameCounter + 1) % 9;\n // code ...\n const halfWidth = Math.floor(Math.floor((sizeArray[index] * w) / 30) / 2);\n const halfHeight = Math.floor(\n Math.floor((sizeArray[index] * h) / 30) / 2\n );\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // heigth\n fightMessage.y = 70 - halfHeight; // y coord\n fightMessage.x = 100 - halfWidth; // x coord\n }\n }\n\n /**\n * Draw sachisoft message as frame goes\n * @param {number} frameCounter\n */\n drawSachisoft(frameCounter) {\n if (frameCounter === 0) {\n this.messages.sachisoft.visible = true;\n this.messages.sachisoft.alpha = 0;\n }\n this.messages.sachisoft.alpha = Math.min(\n 1,\n this.messages.sachisoft.alpha + 0.04\n );\n\n if (frameCounter > 70) {\n this.messages.sachisoft.alpha = 1;\n }\n }\n\n /**\n * refered FUN_00405ca0\n * Draw sitting pikachu tiles as frame goes\n * @param {number} frameCounter\n */\n drawSittingPikachuTiles(frameCounter) {\n if (frameCounter === 0) {\n this.sittingPikachuTilesContainer.visible = true;\n this.sittingPikachuTilesContainer.alpha = 0;\n }\n\n // movement\n // @ts-ignore\n const h = this.sittingPikachuTilesContainer.getChildAt(0).texture.height;\n this.sittingPikachuTilesDisplacement =\n (this.sittingPikachuTilesDisplacement + 2) % h;\n this.sittingPikachuTilesContainer.x = -this.sittingPikachuTilesDisplacement;\n this.sittingPikachuTilesContainer.y = -this.sittingPikachuTilesDisplacement;\n\n if (frameCounter > 30) {\n // alpha\n this.sittingPikachuTilesContainer.alpha = Math.min(\n 1,\n this.sittingPikachuTilesContainer.alpha + 0.04\n );\n }\n\n if (frameCounter > 70) {\n this.sittingPikachuTilesContainer.alpha = 1;\n }\n }\n\n /**\n * refered FUN_00405b70\n * Draw pikachu volleyball message as frame goes\n * @param {number} frameCounter\n */\n drawPikachuVolleyballMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pikachuVolleyball.visible = false;\n return;\n }\n\n if (frameCounter > 30) {\n this.messages.pikachuVolleyball.visible = true;\n }\n\n if (frameCounter > 30 && frameCounter <= 44) {\n const xDiff = 195 - 15 * (frameCounter - 30);\n this.messages.pikachuVolleyball.x = 140 + xDiff;\n } else if (frameCounter > 44 && frameCounter <= 55) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 200 - 15 * (frameCounter - 44);\n } else if (frameCounter > 55 && frameCounter <= 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 40 + 15 * (frameCounter - 55);\n } else if (frameCounter > 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width =\n this.messages.pikachuVolleyball.texture.width;\n }\n }\n\n /**\n * refered FUN_00405b70\n * Draw pokemon message as frame goes\n * @param {number} frameCounter\n */\n drawPokemonMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pokemon.visible = false;\n return;\n }\n\n if (frameCounter > 71) {\n this.messages.pokemon.visible = true;\n }\n }\n\n /**\n * refered FUN_00405ec0\n * Draw with who messages (with computer or with friend) as frame goes\n * @param {number} frameCounter\n */\n drawWithWhoMessages(frameCounter) {\n const withWho = this.messages.withWho;\n const w = withWho[0].texture.width;\n const h = withWho[0].texture.height;\n\n if (frameCounter === 0) {\n for (let i = 0; i < 2; i++) {\n withWho[i].visible = false;\n }\n return;\n }\n\n if (frameCounter > 70) {\n if (this.selectedWithWhoMessageSizeIncrement < 10) {\n this.selectedWithWhoMessageSizeIncrement += 1;\n }\n for (let i = 0; i < 2; i++) {\n const selected = Number(this.selectedWithWho === i); // 1 if selected, 0 otherwise\n const halfWidthIncrement =\n selected * (this.selectedWithWhoMessageSizeIncrement + 2);\n const halfHeightIncrement =\n selected * this.selectedWithWhoMessageSizeIncrement;\n\n withWho[i].visible = true;\n withWho[i].x = 216 - w / 2 - halfWidthIncrement;\n withWho[i].y = 184 + 30 * i - halfHeightIncrement;\n withWho[i].width = w + 2 * halfWidthIncrement;\n withWho[i].height = h + 2 * halfHeightIncrement;\n }\n }\n }\n\n /**\n * Select with who for the effect that selected option gets bigger\n * @param {number} i 0: with computer, 1: with friend\n */\n selectWithWho(i) {\n this.selectedWithWho = i;\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n}\n\n/**\n * Class represent a game view where pikachus, ball, clouds, waves, and backgrounds are\n */\nexport class GameView {\n /**\n * Create a GameView object\n * @param {Object.} resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n // Display objects below\n this.bgContainer = makeBGContainer(textures);\n const playerSprites = makePlayerAnimatedSprites(textures);\n this.player1 = playerSprites[0];\n this.player2 = playerSprites[1];\n this.ball = makeBallAnimatedSprites(textures);\n this.ballHyper = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_HYPER,\n 0.5,\n 0.5\n );\n this.ballTrail = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_TRAIL,\n 0.5,\n 0.5\n );\n this.punch = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_PUNCH,\n 0.5,\n 0.5\n );\n\n // this.scoreBoards[0] for player1, this.scoreBoards[1] for player2\n this.scoreBoards = [\n makeScoreBoardSprite(textures),\n makeScoreBoardSprite(textures),\n ];\n\n this.shadows = {\n forPlayer1: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forPlayer2: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forBall: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n };\n\n this.messages = {\n gameStart: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_START, 0, 0),\n ready: makeSpriteWithAnchorXY(textures, TEXTURES.READY, 0, 0),\n gameEnd: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_END, 0, 0),\n };\n\n this.cloudContainer = makeCloudContainer(textures);\n this.waveContainer = makeWaveContainer(textures);\n // this.line = new Graphics();\n // this.predict = new Array(6).fill(new Graphics());\n // this.shortX = new Graphics();\n // this.shortX.beginFill(0xff0000);\n // this.shortX.drawRect(0, 0, 40, 10);\n // this.shortX.y = 255;\n // this.farX = new Graphics();\n // this.farX.beginFill(0x0000ff);\n // this.farX.drawRect(0, 0, 40, 10);\n // this.farX.y = 255;\n // this.exp = new Graphics();\n // this.exp.beginFill(0x00ff00);\n // this.exp.drawRect(0, 0, 40, 10);\n // this.exp.y = 255;\n\n // container which include whold display objects\n // Should be careful on addChild order\n // The later added, the more front(z-index) on screen\n this.container = new Container();\n this.container.addChild(this.bgContainer);\n this.container.addChild(this.cloudContainer);\n this.container.addChild(this.waveContainer);\n this.container.addChild(this.shadows.forPlayer1);\n this.container.addChild(this.shadows.forPlayer2);\n this.container.addChild(this.shadows.forBall);\n this.container.addChild(this.player1);\n this.container.addChild(this.player2);\n this.container.addChild(this.ballTrail);\n this.container.addChild(this.ballHyper);\n this.container.addChild(this.ball);\n\n // this.container.addChild(this.line);\n // for (let predictCount = 0; predictCount < 6; predictCount++) {\n // this.container.addChild(this.predict[predictCount]);\n // }\n // this.container.addChild(this.shortX);\n // this.container.addChild(this.farX);\n // this.container.addChild(this.exp);\n\n this.container.addChild(this.punch);\n this.container.addChild(this.scoreBoards[0]);\n this.container.addChild(this.scoreBoards[1]);\n this.container.addChild(this.messages.gameStart);\n this.container.addChild(this.messages.ready);\n this.container.addChild(this.messages.gameEnd);\n\n // location and visibility setting\n this.bgContainer.x = 0;\n this.bgContainer.y = 0;\n this.cloudContainer.x = 0;\n this.cloudContainer.y = 0;\n this.waveContainer.x = 0;\n this.waveContainer.y = 0;\n\n this.messages.ready.x = 176;\n this.messages.ready.y = 38;\n this.scoreBoards[0].x = 14; // score board is 14 pixel distant from boundary\n this.scoreBoards[0].y = 10;\n this.scoreBoards[1].x = 432 - 32 - 32 - 14; // 32 pixel is for number (32x32px) width; one score board has tow numbers\n this.scoreBoards[1].y = 10;\n\n this.shadows.forPlayer1.y = 273;\n this.shadows.forPlayer2.y = 273;\n this.shadows.forBall.y = 273;\n\n this.initializeVisibles();\n\n // clouds and wave model.\n // This model is included in this view object, not on controller object\n // since it is not dependent on user input, and only used for rendering.\n this.cloudArray = [];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n this.cloudArray.push(new Cloud());\n }\n this.wave = new Wave();\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n // leftside(x) {\n // return x < 216;\n // }\n\n /** @typedef {import(\"./physics\").PikaPhysics} PikaPhysics */\n /**\n * Draw players and ball in the given physics object\n * @param {PikaPhysics} physics PikaPhysics object to draw\n */\n drawPlayersAndBall(physics) {\n const player1 = physics.player1;\n const player2 = physics.player2;\n const ball = physics.ball;\n\n this.player1.x = player1.x;\n this.player1.y = player1.y;\n if (player1.state === 3 || player1.state === 4) {\n this.player1.scale.x = player1.divingDirection === -1 ? -1 : 1;\n } else {\n this.player1.scale.x = 1;\n }\n this.shadows.forPlayer1.x = player1.x;\n\n this.player2.x = player2.x;\n this.player2.y = player2.y;\n if (player2.state === 3 || player2.state === 4) {\n this.player2.scale.x = player2.divingDirection === 1 ? 1 : -1;\n } else {\n this.player2.scale.x = -1;\n }\n this.shadows.forPlayer2.x = player2.x;\n\n const frameNumber1 = getFrameNumberForPlayerAnimatedSprite(\n player1.state,\n player1.frameNumber\n );\n const frameNumber2 = getFrameNumberForPlayerAnimatedSprite(\n player2.state,\n player2.frameNumber\n );\n this.player1.gotoAndStop(frameNumber1);\n this.player2.gotoAndStop(frameNumber2);\n\n this.ball.x = ball.x;\n this.ball.y = ball.y;\n this.shadows.forBall.x = ball.x;\n this.ball.gotoAndStop(ball.rotation);\n\n // this.shortX.x = ball.shortX - 20;\n // this.farX.x = ball.farX - 20;\n // this.exp.x = ball.bestDefense - 20;\n // this.line.clear();\n // this.line.lineStyle(3, 0, 0.2);\n // let lastball = ball;\n // ball.path.forEach((copyball) => {\n // this.line.moveTo(lastball.x, lastball.y);\n // this.line.lineTo(copyball.x, copyball.y);\n // lastball = copyball;\n // });\n\n // const rgb = [0x00ff00, 0x00ff00, 0xff8000, 0xff8000, 0xff0000, 0xff0000];\n // console.log(ball.predict);\n // for (\n // let predictCount = 0;\n // predictCount < ball.predict.length;\n // predictCount++\n // ) {\n // this.predict[predictCount].clear();\n // }\n // for (\n // let predictCount = 0;\n // predictCount < ball.predict.length;\n // predictCount++\n // ) {\n // const ballpredict = ball.predict[predictCount];\n // this.predict[predictCount].lineStyle(3, rgb[predictCount], 0.5);\n // if (\n // ballpredict.length === 0 ||\n // this.leftside(ball.x) ===\n // this.leftside(ballpredict[ballpredict.length - 1].x)\n // ) {\n // continue;\n // }\n // // @ts-ignore\n // let last = ball;\n // ballpredict.forEach((copyball) => {\n // this.predict[predictCount].moveTo(last.x, last.y);\n // this.predict[predictCount].lineTo(copyball.x, copyball.y);\n // last = copyball;\n // });\n // }\n\n // For punch effect, refer FUN_00402ee0\n if (ball.punchEffectRadius > 0) {\n ball.punchEffectRadius -= 2;\n this.punch.width = 2 * ball.punchEffectRadius;\n this.punch.height = 2 * ball.punchEffectRadius;\n this.punch.x = ball.punchEffectX;\n this.punch.y = ball.punchEffectY;\n this.punch.visible = true;\n } else {\n this.punch.visible = false;\n }\n\n if (ball.isPowerHit === true) {\n this.ballHyper.x = ball.previousX;\n this.ballHyper.y = ball.previousY;\n this.ballTrail.x = ball.previousPreviousX;\n this.ballTrail.y = ball.previousPreviousY;\n\n this.ballHyper.visible = true;\n this.ballTrail.visible = true;\n } else {\n this.ballHyper.visible = false;\n this.ballTrail.visible = false;\n }\n }\n\n /**\n * Draw scores to each score board\n * @param {number[]} scores [0] for player1 score, [1] for player2 score\n */\n drawScoresToScoreBoards(scores) {\n for (let i = 0; i < 2; i++) {\n const scoreBoard = this.scoreBoards[i];\n const score = scores[i];\n const unitsAnimatedSprite = scoreBoard.getChildAt(0);\n const tensAnimatedSprite = scoreBoard.getChildAt(1);\n // @ts-ignore\n unitsAnimatedSprite.gotoAndStop(score % 10);\n // @ts-ignore\n tensAnimatedSprite.gotoAndStop(Math.floor(score / 10) % 10);\n if (score >= 10) {\n tensAnimatedSprite.visible = true;\n } else {\n tensAnimatedSprite.visible = false;\n }\n }\n }\n\n /**\n * Draw clouds and wave\n */\n drawCloudsAndWave() {\n const cloudArray = this.cloudArray;\n const wave = this.wave;\n\n cloudAndWaveEngine(cloudArray, wave);\n\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = cloudArray[i];\n const cloudSprite = this.cloudContainer.getChildAt(i);\n cloudSprite.x = cloud.spriteTopLeftPointX;\n cloudSprite.y = cloud.spriteTopLeftPointY;\n // @ts-ignore\n cloudSprite.width = cloud.spriteWidth;\n // @ts-ignore\n cloudSprite.height = cloud.spriteHeight;\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n const waveSprite = this.waveContainer.getChildAt(i);\n waveSprite.y = wave.yCoords[i];\n }\n }\n\n /**\n * refered FUN_00403f20\n * Draw game start message as frame goes\n * @param {number} frameCounter current frame number\n * @param {number} frameTotal total frame number for game start message\n */\n drawGameStartMessage(frameCounter, frameTotal) {\n if (frameCounter === 0) {\n this.messages.gameStart.visible = true;\n } else if (frameCounter >= frameTotal - 1) {\n this.messages.gameStart.visible = false;\n return;\n }\n\n const gameStartMessage = this.messages.gameStart;\n // game start message rendering\n const w = gameStartMessage.texture.width; // game start message texture width\n const h = gameStartMessage.texture.height; // game start message texture height\n const halfWidth = Math.floor((w * frameCounter) / 50);\n const halfHeight = Math.floor((h * frameCounter) / 50);\n gameStartMessage.x = 216 - halfWidth;\n gameStartMessage.y = 50 + 2 * halfHeight;\n gameStartMessage.width = 2 * halfWidth;\n gameStartMessage.height = 2 * halfHeight;\n }\n\n /**\n * Draw ready message\n * @param {boolean} bool turn on?\n */\n drawReadyMessage(bool) {\n this.messages.ready.visible = bool;\n }\n\n /**\n * Togle ready message.\n * Turn off if it's on, turn on if it's off.\n */\n toggleReadyMessage() {\n this.messages.ready.visible = !this.messages.ready.visible;\n }\n\n /**\n * refered FUN_00404070\n * Draw game end message as frame goes\n * @param {number} frameCounter\n */\n drawGameEndMessage(frameCounter) {\n const gameEndMessage = this.messages.gameEnd;\n const w = gameEndMessage.texture.width; // game end message texture width;\n const h = gameEndMessage.texture.height; // game end message texture height;\n\n if (frameCounter === 0) {\n gameEndMessage.visible = true;\n }\n if (frameCounter < 50) {\n const halfWidthIncrement = 2 * Math.floor(((50 - frameCounter) * w) / 50);\n const halfHeightIncrement =\n 2 * Math.floor(((50 - frameCounter) * h) / 50);\n\n gameEndMessage.x = 216 - w / 2 - halfWidthIncrement;\n gameEndMessage.y = 50 - halfHeightIncrement;\n gameEndMessage.width = w + 2 * halfWidthIncrement;\n gameEndMessage.height = h + 2 * halfHeightIncrement;\n } else {\n gameEndMessage.x = 216 - w / 2;\n gameEndMessage.y = 50;\n gameEndMessage.width = w;\n gameEndMessage.height = h;\n }\n }\n}\n\n/**\n * Class representing fade in out effect\n */\nexport class FadeInOut {\n constructor() {\n this.black = new Graphics();\n this.black.beginFill(0x000000);\n this.black.drawRect(0, 0, 432, 304);\n this.black.endFill();\n this.black.x = 0;\n this.black.y = 0;\n this.black.alpha = 1;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.black.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.black.visible = bool;\n }\n\n /**\n * Set black alpha for fade in out\n * @param {number} alpha number in [0, 1]\n */\n setBlackAlphaTo(alpha) {\n this.black.alpha = alpha;\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n\n /**\n * Increase black alpha for fade in out\n * @param {number} alphaIncrement if alphaIncrement > 0: fade out, else fade in\n */\n changeBlackAlphaBy(alphaIncrement) {\n if (alphaIncrement >= 0) {\n this.black.alpha = Math.min(1, this.black.alpha + alphaIncrement);\n } else {\n this.black.alpha = Math.max(0, this.black.alpha + alphaIncrement);\n }\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n}\n\n/**\n * Make sitting pikachu tiles\n * @param {Object.} textures\n * @return {PIXI.Container}\n */\nfunction makeSittingPikachuTilesContainer(textures) {\n const container = new Container();\n const texture = textures[TEXTURES.SITTING_PIKACHU];\n const w = texture.width;\n const h = texture.height;\n\n let tile;\n for (let j = 0; j < Math.floor(304 / h) + 2; j++) {\n for (let i = 0; i < Math.floor(432 / w) + 2; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(container, tile, w * i, h * j);\n }\n }\n\n return container;\n}\n\n/**\n * Make background\n * @param {Object.} textures\n * @return {PIXI.Container}\n */\nfunction makeBGContainer(textures) {\n const bgContainer = new Container();\n\n // sky\n let tile;\n let texture = textures[TEXTURES.SKY_BLUE];\n for (let j = 0; j < 12; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 16 * j);\n }\n }\n\n // mountain\n texture = textures[TEXTURES.MOUNTAIN];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 188);\n\n // ground_red\n texture = textures[TEXTURES.GROUND_RED];\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 248);\n }\n\n // ground_line\n texture = textures[TEXTURES.GROUND_LINE];\n for (let i = 1; i < 432 / 16 - 1; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 264);\n }\n texture = textures[TEXTURES.GROUND_LINE_LEFT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 264);\n texture = textures[TEXTURES.GROUND_LINE_RIGHT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 432 - 16, 264);\n\n // ground_yellow\n texture = textures[TEXTURES.GROUND_YELLOW];\n for (let j = 0; j < 2; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(\n bgContainer,\n tile,\n 16 * i,\n 280 + 16 * j\n );\n }\n }\n\n // net pillar\n texture = textures[TEXTURES.NET_PILLAR_TOP];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 176);\n texture = textures[TEXTURES.NET_PILLAR];\n for (let j = 0; j < 12; j++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 184 + 8 * j);\n }\n\n return bgContainer;\n}\n\n/**\n * Make animated sprites for both players\n * @param {Object.} textures\n * @return {PIXI.AnimatedSprite[]} [0] for player 1, [1] for player2\n */\nfunction makePlayerAnimatedSprites(textures) {\n const getPlayerTexture = (i, j) => textures[TEXTURES.PIKACHU(i, j)];\n const playerTextureArray = [];\n for (let i = 0; i < 7; i++) {\n if (i === 3) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n playerTextureArray.push(getPlayerTexture(i, 1));\n } else if (i === 4) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n } else {\n for (let j = 0; j < 5; j++) {\n playerTextureArray.push(getPlayerTexture(i, j));\n }\n }\n }\n const player1AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n const player2AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n\n player1AnimatedSprite.anchor.x = 0.5;\n player1AnimatedSprite.anchor.y = 0.5;\n player2AnimatedSprite.anchor.x = 0.5;\n player2AnimatedSprite.anchor.y = 0.5;\n\n return [player1AnimatedSprite, player2AnimatedSprite];\n}\n\n/**\n * Make animated sprite of ball\n * @param {Object.} textures\n * @return {PIXI.AnimatedSprite}\n */\nfunction makeBallAnimatedSprites(textures) {\n const getBallTexture = (s) => textures[TEXTURES.BALL(s)];\n const ballTextureArray = [\n getBallTexture(0),\n getBallTexture(1),\n getBallTexture(2),\n getBallTexture(3),\n getBallTexture(4),\n getBallTexture('hyper'),\n ];\n const ballAnimatedSprite = new AnimatedSprite(ballTextureArray, false);\n\n ballAnimatedSprite.anchor.x = 0.5;\n ballAnimatedSprite.anchor.y = 0.5;\n\n return ballAnimatedSprite;\n}\n\n/**\n * Make sprite with the texture on the path and with the given anchor x, y\n * @param {Object.} textures\n * @param {string} path\n * @param {number} anchorX anchor.x, number in [0, 1]\n * @param {number} anchorY anchor.y, number in [0, 1]\n * @return {PIXI.Sprite}\n */\nfunction makeSpriteWithAnchorXY(textures, path, anchorX, anchorY) {\n const sprite = new Sprite(textures[path]);\n sprite.anchor.x = anchorX;\n sprite.anchor.y = anchorY;\n return sprite;\n}\n\n/**\n * Make score boards\n * @param {Object.} textures\n * @return {PIXI.Container} child with index 0 for player 1 score board, child with index 1 for player2 score board\n */\nfunction makeScoreBoardSprite(textures) {\n const getNumberTexture = (n) => textures[TEXTURES.NUMBER(n)];\n const numberTextureArray = [];\n for (let i = 0; i < 10; i++) {\n numberTextureArray.push(getNumberTexture(i));\n }\n const numberAnimatedSprites = [null, null];\n numberAnimatedSprites[0] = new AnimatedSprite(numberTextureArray, false);\n numberAnimatedSprites[1] = new AnimatedSprite(numberTextureArray, false);\n\n const scoreBoard = new Container();\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[0],\n 32,\n 0\n ); // for units\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[1],\n 0,\n 0\n ); // for tens\n\n scoreBoard.setChildIndex(numberAnimatedSprites[0], 0); // for units\n scoreBoard.setChildIndex(numberAnimatedSprites[1], 1); // for tens\n\n return scoreBoard;\n}\n\n/**\n * Make a container with cloud sprites\n * @param {Object.} textures\n * @return {PIXI.Container}\n */\nfunction makeCloudContainer(textures) {\n const cloudContainer = new Container();\n const texture = textures[TEXTURES.CLOUD];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = new Sprite(texture);\n cloud.anchor.x = 0;\n cloud.anchor.y = 0;\n cloudContainer.addChild(cloud);\n }\n\n return cloudContainer;\n}\n\n/**\n * Make a container with wave sprites\n * @param {Object.} textures\n * @return {PIXI.Container}\n */\nfunction makeWaveContainer(textures) {\n const waveContainer = new Container();\n const texture = textures[TEXTURES.WAVE];\n for (let i = 0; i < 432 / 16; i++) {\n const tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(waveContainer, tile, 16 * i, 0);\n }\n\n return waveContainer;\n}\n\n/**\n * Add child to parent and set local position\n * @param {PIXI.Container} parent\n * @param {PIXI.Sprite} child\n * @param {number} x local x\n * @param {number} y local y\n */\nfunction addChildToParentAndSetLocalPosition(parent, child, x, y) {\n parent.addChild(child);\n child.anchor.x = 0;\n child.anchor.y = 0;\n child.x = x;\n child.y = y;\n}\n\n/**\n * Get frame number for player animated sprite corresponds to the player state\n *\n * number of frames for state 0, state 1 and state 2 is 5 for each.\n * number of frames for state 3 is 2.\n * number of frames for state 4 is 1.\n * number of frames for state 5, state 6 is 5 for each.\n * @param {number} state player state\n * @param {number} frameNumber\n */\nfunction getFrameNumberForPlayerAnimatedSprite(state, frameNumber) {\n if (state < 4) {\n return 5 * state + frameNumber;\n } else if (state === 4) {\n return 17 + frameNumber;\n } else if (state > 4) {\n return 18 + 5 * (state - 5) + frameNumber;\n }\n}\n","/**\n * This module takes charge of the user input via keyboard\n */\n'use strict';\nimport { PikaUserInput } from './physics.js';\n\n/**\n * Class representing a keyboard used to contorl a player\n */\nexport class PikaKeyboard extends PikaUserInput {\n /**\n * Create a keyboard used for game controller\n * left, right, up, down, powerHit: KeyboardEvent.code value for each\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} left KeyboardEvent.code value of the key to use for left\n * @param {string} right KeyboardEvent.code value of the key to use for right\n * @param {string} up KeyboardEvent.code value of the key to use for up\n * @param {string} down KeyboardEvent.code value of the key to use for down\n * @param {string} powerHit KeyboardEvent.code value of the key to use for power hit or selection\n * @param {string} downRight KeyboardEvent.code value of the key to use for having the same effect\n * when pressing down key and right key at the same time (Only player 1\n * has this key)\n */\n constructor(left, right, up, down, powerHit, downRight = null) {\n super();\n\n /** @type {boolean} */\n this.powerHitKeyIsDownPrevious = false;\n\n /** @type {Key} */\n this.leftKey = new Key(left);\n /** @type {Key} */\n this.rightKey = new Key(right);\n /** @type {Key} */\n this.upKey = new Key(up);\n /** @type {Key} */\n this.downKey = new Key(down);\n /** @type {Key} */\n this.powerHitKey = new Key(powerHit);\n /** @type {Key} */\n this.downRightKey = new Key(downRight);\n }\n\n /**\n * Get xDirection, yDirection, powerHit input from the keyboard.\n * This method is for freezing the keyboard input during the process of one game frame.\n */\n getInput(amIPlayer2 = false) {\n if (this.leftKey.isDown) {\n this.xDirection = -1;\n } else if (\n this.rightKey.isDown ||\n (!amIPlayer2 && this.downRightKey && this.downRightKey.isDown)\n ) {\n this.xDirection = 1;\n } else {\n this.xDirection = 0;\n }\n\n if (this.upKey.isDown) {\n this.yDirection = -1;\n } else if (\n this.downKey.isDown ||\n (this.downRightKey && this.downRightKey.isDown)\n ) {\n this.yDirection = 1;\n } else {\n this.yDirection = 0;\n }\n\n const isDown = this.powerHitKey.isDown;\n if (!this.powerHitKeyIsDownPrevious && isDown) {\n this.powerHit = 1;\n } else {\n this.powerHit = 0;\n }\n this.powerHitKeyIsDownPrevious = isDown;\n }\n\n /**\n * Subscribe keydown, keyup event listners for the keys of this keyboard\n */\n subscribe() {\n this.leftKey.subscribe();\n this.rightKey.subscribe();\n this.upKey.subscribe();\n this.downKey.subscribe();\n this.powerHitKey.subscribe();\n this.downRightKey.subscribe();\n }\n\n /**\n * Unsubscribe keydown, keyup event listners for the keys of this keyboard\n */\n unsubscribe() {\n this.leftKey.unsubscribe();\n this.rightKey.unsubscribe();\n this.upKey.unsubscribe();\n this.downKey.unsubscribe();\n this.powerHitKey.unsubscribe();\n this.downRightKey.unsubscribe();\n }\n}\n\n/**\n * Class respresenting a key on a keyboard\n * refered: https://github.com/kittykatattack/learningPixi\n */\nclass Key {\n /**\n * Create a key\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} value KeyboardEvent.code value of this key\n */\n constructor(value) {\n this.value = value;\n this.isDown = false;\n this.isUp = true;\n\n this.downListener = this.downHandler.bind(this);\n this.upListner = this.upHandler.bind(this);\n this.subscribe();\n }\n\n /**\n * When key downed\n * @param {KeyboardEvent} event\n */\n downHandler(event) {\n if (event.code === this.value) {\n this.isDown = true;\n this.isUp = false;\n event.preventDefault();\n }\n }\n\n /**\n * When key upped\n * @param {KeyboardEvent} event\n */\n upHandler(event) {\n if (event.code === this.value) {\n this.isDown = false;\n this.isUp = true;\n event.preventDefault();\n }\n }\n\n /**\n * Subscribe event listeners\n */\n subscribe() {\n window.addEventListener('keydown', this.downListener);\n window.addEventListener('keyup', this.upListner);\n }\n\n /**\n * Unsubscribe event listeners\n */\n unsubscribe() {\n window.removeEventListener('keydown', this.downListener);\n window.removeEventListener('keyup', this.upListner);\n this.isDown = false;\n this.isUp = true;\n }\n}\n","/**\n * This module takes charge of the game audio (or sounds)\n */\n'use strict';\nimport PIXIsound from 'pixi-sound';\nimport { ASSETS_PATH } from './assets_path.js';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\n\n/**\n * Class represeting audio\n */\nexport class PikaAudio {\n /**\n * Create a PikaAudio object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n /** @type {Object.} sounds pack */\n this.sounds = {\n bgm: new PikaStereoSound(resources[SOUNDS.BGM].sound),\n pipikachu: new PikaStereoSound(resources[SOUNDS.PIPIKACHU].sound),\n pika: new PikaStereoSound(resources[SOUNDS.PIKA].sound),\n chu: new PikaStereoSound(resources[SOUNDS.CHU].sound),\n pi: new PikaStereoSound(resources[SOUNDS.PI].sound),\n pikachu: new PikaStereoSound(resources[SOUNDS.PIKACHU].sound),\n powerHit: new PikaStereoSound(resources[SOUNDS.POWERHIT].sound),\n ballTouchesGround: new PikaStereoSound(\n resources[SOUNDS.BALLTOUCHESGROUND].sound\n ),\n };\n\n this.sounds.bgm.loop = true;\n /** @constant @type {number} proper bgm volume */\n this.properBGMVolume = 0.2;\n /** @constant @type {number} proper sfx volume */\n this.properSFXVolume = 0.35;\n this.adjustVolume();\n this.turnBGMVolume(false);\n }\n\n /**\n * Adjust audio volume\n */\n adjustVolume() {\n for (const prop in this.sounds) {\n if (prop === 'bgm') {\n this.sounds[prop].volume = this.properBGMVolume;\n } else {\n this.sounds[prop].volume = this.properSFXVolume;\n }\n }\n }\n\n /**\n * turn BGM volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnBGMVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properBGMVolume;\n } else {\n volume = 0;\n }\n this.sounds.bgm.volume = volume;\n }\n\n /**\n * turn SFX volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnSFXVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properSFXVolume;\n } else {\n volume = 0;\n }\n for (const prop in this.sounds) {\n if (prop !== 'bgm') {\n this.sounds[prop].volume = volume;\n }\n }\n }\n}\n\n/**\n * Class representing a stereo sound\n */\nclass PikaStereoSound {\n /**\n * create a PikaStereoSound object\n * @param {PIXI.sound.Sound} sound\n */\n constructor(sound) {\n this.center = sound;\n this.left = PIXIsound.Sound.from(sound.url);\n this.right = PIXIsound.Sound.from(sound.url);\n\n const centerPanning = new PIXIsound.filters.StereoFilter(0);\n const leftPanning = new PIXIsound.filters.StereoFilter(-0.75);\n const rightPanning = new PIXIsound.filters.StereoFilter(0.75);\n this.center.filters = [centerPanning];\n this.left.filters = [leftPanning];\n this.right.filters = [rightPanning];\n }\n\n /**\n * @param {number} v volume: number in [0, 1]\n */\n set volume(v) {\n this.center.volume = v;\n this.left.volume = v;\n this.right.volume = v;\n }\n\n /**\n * @param {boolean} bool\n */\n set loop(bool) {\n this.center.loop = bool;\n this.left.loop = bool;\n this.right.loop = bool;\n }\n\n /**\n * play this stereo sound\n * @param {number} leftOrCenterOrRight -1: left, 0: center, 1: right\n */\n play(leftOrCenterOrRight = 0) {\n if (leftOrCenterOrRight === 0) {\n this.center.play();\n } else if (leftOrCenterOrRight === -1) {\n this.left.play();\n } else if (leftOrCenterOrRight === 1) {\n this.right.play();\n }\n }\n\n /**\n * stop this stereo sound\n */\n stop() {\n this.center.stop();\n this.left.stop();\n this.right.stop();\n }\n}\n","/**\n * The Controller part in MVC pattern\n */\n'use strict';\nimport { GROUND_HALF_WIDTH, PikaPhysics, PikaUserInput } from './physics.js';\nimport { MenuView, GameView, FadeInOut, IntroView } from './view.js';\nimport { PikaKeyboard } from './keyboard.js';\nimport { PikaAudio } from './audio.js';\nimport { replaySaver } from './replay/replay_saver.js';\nimport seedrandom from 'seedrandom';\nimport { true_rand, setCustomRng, rand } from './rand.js';\nimport { Cloud, Wave } from './cloud_and_wave.js';\n\n/** @typedef GameState @type {function():void} */\n\n/**\n * Class representing Pikachu Volleyball game\n */\nexport class PikachuVolleyball {\n /**\n * Create a Pikachu Volleyball game which includes physics, view, audio\n * @param {PIXI.Container} stage container which is rendered by PIXI.Renderer or PIXI.CanvasRenderer\n * @param {Object.} resources resources property of the PIXI.Loader object which is used for loading the game resources\n */\n constructor(stage, resources) {\n this.view = {\n intro: new IntroView(resources),\n menu: new MenuView(resources),\n game: new GameView(resources),\n fadeInOut: new FadeInOut(),\n };\n stage.addChild(this.view.intro.container);\n stage.addChild(this.view.menu.container);\n stage.addChild(this.view.game.container);\n stage.addChild(this.view.fadeInOut.black);\n this.view.intro.visible = false;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.view.fadeInOut.visible = false;\n\n this.audio = new PikaAudio(resources);\n this.physics = new PikaPhysics(true, true);\n this.keyboardArray = [\n new PikaKeyboard('KeyD', 'KeyG', 'KeyR', 'KeyV', 'KeyZ', 'KeyF'), // for player1\n new PikaKeyboard( // for player2\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Enter',\n 'ArrowDown'\n ),\n ];\n\n /** @type {number} game fps */\n this.normalFPS = 30;\n /** @type {number} fps for slow motion */\n this.slowMotionFPS = 5;\n\n /** @constant @type {number} number of frames for slow motion */\n this.SLOW_MOTION_FRAMES_NUM = 6;\n /** @type {number} number of frames left for slow motion */\n this.slowMotionFramesLeft = 0;\n /** @type {number} number of elapsed normal fps frames for rendering slow motion */\n this.slowMotionNumOfSkippedFrames = 0;\n\n /** @type {number} 0: with computer, 1: with friend */\n this.selectedWithWho = 0;\n\n /** @type {number[]} [0] for player 1 score, [1] for player 2 score */\n this.scores = [0, 0];\n /** @type {number} winning score: if either one of the players reaches this score, game ends */\n this.winningScore = 15;\n\n /** @type {boolean} Is the game ended? */\n this.gameEnded = false;\n /** @type {boolean} Is the round ended? */\n this.roundEnded = false;\n /** @type {boolean} Will player 2 serve? */\n this.isPlayer2Serve = false;\n\n /** @type {number} frame counter */\n this.frameCounter = 0;\n /** @type {Object.} total number of frames for each game state */\n this.frameTotal = {\n intro: 165,\n afterMenuSelection: 15,\n beforeStartOfNewGame: 15,\n startOfNewGame: 71,\n afterEndOfRound: 5,\n beforeStartOfNextRound: 30,\n gameEnd: 211,\n };\n\n /** @type {number} counter for frames while there is no input from keyboard */\n this.noInputFrameCounter = 0;\n /** @type {Object.} total number of frames to be rendered while there is no input */\n this.noInputFrameTotal = {\n menu: 225,\n };\n\n /** @type {boolean} true: paused, false: not paused */\n this.paused = false;\n\n /** @type {boolean} true: stereo, false: mono */\n this.isStereoSound = true;\n\n /** @type {boolean} true: practice mode on, false: practice mode off */\n this._isPracticeMode = false;\n\n /**\n * The game state which is being rendered now\n * @type {GameState}\n */\n this.state = this.intro;\n }\n\n /**\n * Game loop\n * This function should be called at regular intervals ( interval = (1 / FPS) second )\n */\n gameLoop() {\n if (this.paused === true) {\n return;\n }\n\n // catch keyboard input and freeze it\n this.keyboardArray[0].getInput(!this.physics.player2.isComputer);\n this.keyboardArray[1].getInput(!this.physics.player2.isComputer);\n\n const player1Input = new PikaUserInput();\n player1Input.xDirection = this.keyboardArray[0].xDirection;\n player1Input.yDirection = this.keyboardArray[0].yDirection;\n player1Input.powerHit = this.keyboardArray[0].powerHit;\n const player2Input = new PikaUserInput();\n player2Input.xDirection = this.keyboardArray[1].xDirection;\n player2Input.yDirection = this.keyboardArray[1].yDirection;\n player2Input.powerHit = this.keyboardArray[1].powerHit;\n if (this.state !== this.round) {\n replaySaver.recordInputs(player1Input, player2Input);\n }\n if (this.slowMotionFramesLeft > 0) {\n this.slowMotionNumOfSkippedFrames++;\n if (\n this.slowMotionNumOfSkippedFrames %\n Math.round(this.normalFPS / this.slowMotionFPS) !==\n 0\n ) {\n replaySaver.recordInputs(player1Input, player2Input);\n return;\n }\n this.slowMotionFramesLeft--;\n this.slowMotionNumOfSkippedFrames = 0;\n }\n this.state();\n }\n\n /**\n * Intro: a man with a brief case\n * @type {GameState}\n */\n intro() {\n if (this.frameCounter === 0) {\n this.view.intro.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.audio.sounds.bgm.stop();\n }\n this.view.intro.drawMark(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n\n if (this.frameCounter >= this.frameTotal.intro) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n }\n\n /**\n * Menu: select who do you want to play. With computer? With friend?\n * @type {GameState}\n */\n menu() {\n if (this.frameCounter === 0) {\n this.view.menu.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n }\n this.view.menu.drawFightMessage(this.frameCounter);\n this.view.menu.drawSachisoft(this.frameCounter);\n this.view.menu.drawSittingPikachuTiles(this.frameCounter);\n this.view.menu.drawPikachuVolleyballMessage(this.frameCounter);\n this.view.menu.drawPokemonMessage(this.frameCounter);\n this.view.menu.drawWithWhoMessages(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.frameCounter < 71 &&\n (this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1)\n ) {\n this.frameCounter = 71;\n return;\n }\n\n if (this.frameCounter <= 71) {\n return;\n }\n\n if (\n (this.keyboardArray[0].yDirection === -1 ||\n this.keyboardArray[1].yDirection === -1) &&\n this.selectedWithWho === 1\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else if (\n (this.keyboardArray[0].yDirection === 1 ||\n this.keyboardArray[1].yDirection === 1) &&\n this.selectedWithWho === 0\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 1;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else {\n this.noInputFrameCounter++;\n }\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n if (this.selectedWithWho === 1) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = true;\n replaySaver.recordNicknames('AI', 'AI');\n } else {\n if (this.keyboardArray[0].powerHit === 1) {\n this.physics.player1.isComputer = false;\n this.physics.player2.isComputer = true;\n replaySaver.recordNicknames('Player', 'AI');\n } else if (this.keyboardArray[1].powerHit === 1) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = false;\n replaySaver.recordNicknames('AI', 'Player');\n }\n }\n this.audio.sounds.pikachu.play();\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.state = this.afterMenuSelection;\n return;\n }\n\n // if (this.noInputFrameCounter >= this.noInputFrameTotal.menu) {\n // this.physics.player1.isComputer = true;\n // this.physics.player2.isComputer = true;\n // this.frameCounter = 0;\n // this.noInputFrameCounter = 0;\n // this.state = this.afterMenuSelection;\n // }\n }\n\n /**\n * Fade out after menu selection\n * @type {GameState}\n */\n afterMenuSelection() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterMenuSelection) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNewGame;\n }\n }\n\n /**\n * Delay before start of new game (This is for the dalay that exist in the original game)\n * @type {GameState}\n */\n beforeStartOfNewGame() {\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.beforeStartOfNewGame) {\n this.frameCounter = 0;\n this.view.menu.visible = false;\n this.state = this.startOfNewGame;\n }\n }\n\n /**\n * Start of new game: Initialize ball and players and print game start message\n * @type {GameState}\n */\n startOfNewGame() {\n if (this.frameCounter === 0) {\n this.view.game.visible = true;\n this.gameEnded = false;\n this.roundEnded = false;\n this.isPlayer2Serve = false;\n this.physics.player1.gameEnded = false;\n this.physics.player1.isWinner = false;\n this.physics.player2.gameEnded = false;\n this.physics.player2.isWinner = false;\n\n this.scores[0] = 0;\n this.scores[1] = 0;\n this.view.game.drawScoresToScoreBoards(this.scores);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n\n this.view.fadeInOut.setBlackAlphaTo(1); // set black screen\n this.audio.sounds.bgm.play();\n }\n\n this.view.game.drawGameStartMessage(\n this.frameCounter,\n this.frameTotal.startOfNewGame\n );\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 17)); // fade in\n this.frameCounter++;\n\n if (this.frameCounter >= this.frameTotal.startOfNewGame) {\n this.frameCounter = 0;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.state = this.round;\n }\n }\n\n /**\n * Round: the players play volleyball in this game state\n * @type {GameState}\n */\n round() {\n const pressedPowerHit =\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1;\n\n // if (\n // this.physics.player1.isComputer === true &&\n // this.physics.player2.isComputer === true &&\n // pressedPowerHit\n // ) {\n // this.frameCounter = 0;\n // this.view.game.visible = false;\n // this.state = this.intro;\n // return;\n // }\n const PlayerMove = this.gameEnded && this.frameCounter >= 70;\n if (PlayerMove) {\n replaySaver.recordInputs(this.keyboardArray[0], this.keyboardArray[1]);\n }\n if (this.physics.player1.isComputer) {\n this.keyboardArray[1].xDirection =\n this.keyboardArray[0].xDirection || this.keyboardArray[1].xDirection;\n this.keyboardArray[1].yDirection =\n this.keyboardArray[0].yDirection || this.keyboardArray[1].yDirection;\n this.keyboardArray[1].powerHit =\n this.keyboardArray[0].powerHit || this.keyboardArray[1].powerHit;\n }\n if (this.physics.player2.isComputer) {\n this.keyboardArray[0].xDirection =\n this.keyboardArray[0].xDirection || this.keyboardArray[1].xDirection;\n this.keyboardArray[0].yDirection =\n this.keyboardArray[0].yDirection || this.keyboardArray[1].yDirection;\n this.keyboardArray[0].powerHit =\n this.keyboardArray[0].powerHit || this.keyboardArray[1].powerHit;\n }\n const isBallTouchingGround = this.physics.runEngineForNextFrame(\n this.keyboardArray\n );\n if (!PlayerMove) {\n replaySaver.recordInputs(this.keyboardArray[0], this.keyboardArray[1]);\n }\n\n this.playSoundEffect();\n this.view.game.drawPlayersAndBall(this.physics);\n this.view.game.drawCloudsAndWave();\n\n if (this.gameEnded === true) {\n this.view.game.drawGameEndMessage(this.frameCounter);\n this.frameCounter++;\n if (\n this.frameCounter >= this.frameTotal.gameEnd ||\n (this.frameCounter >= 70 && pressedPowerHit)\n ) {\n this.frameCounter = 0;\n this.view.game.visible = false;\n this.state = this.intro;\n }\n return;\n }\n\n if (\n isBallTouchingGround &&\n this._isPracticeMode === false &&\n this.roundEnded === false &&\n this.gameEnded === false\n ) {\n if (this.physics.ball.punchEffectX < GROUND_HALF_WIDTH) {\n this.isPlayer2Serve = true;\n this.scores[1] += 1;\n if (this.scores[1] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = false;\n this.physics.player2.isWinner = true;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n } else {\n this.isPlayer2Serve = false;\n this.scores[0] += 1;\n if (this.scores[0] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = true;\n this.physics.player2.isWinner = false;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n }\n this.view.game.drawScoresToScoreBoards(this.scores);\n if (this.roundEnded === false && this.gameEnded === false) {\n this.slowMotionFramesLeft = this.SLOW_MOTION_FRAMES_NUM;\n }\n this.roundEnded = true;\n }\n\n if (this.roundEnded === true && this.gameEnded === false) {\n // if this is the last frame of this round, begin fade out\n if (this.slowMotionFramesLeft === 0) {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16); // fade out\n this.state = this.afterEndOfRound;\n }\n }\n }\n\n /**\n * Fade out after end of round\n * @type {GameState}\n */\n afterEndOfRound() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterEndOfRound) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNextRound;\n }\n }\n\n /**\n * Before start of next round, initialize ball and players, and print ready message\n * @type {GameState}\n */\n beforeStartOfNextRound() {\n if (this.frameCounter === 0) {\n this.view.fadeInOut.setBlackAlphaTo(1);\n this.view.game.drawReadyMessage(false);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n }\n\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 16));\n\n this.frameCounter++;\n if (this.frameCounter % 5 === 0) {\n this.view.game.toggleReadyMessage();\n }\n\n if (this.frameCounter >= this.frameTotal.beforeStartOfNextRound) {\n this.frameCounter = 0;\n this.view.game.drawReadyMessage(false);\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.roundEnded = false;\n this.state = this.round;\n }\n }\n\n /**\n * Play sound effect on {@link round}\n */\n playSoundEffect() {\n const audio = this.audio;\n for (let i = 0; i < 2; i++) {\n const player = this.physics[`player${i + 1}`];\n const sound = player.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n leftOrCenterOrRight = i === 0 ? -1 : 1;\n }\n if (sound.pipikachu === true) {\n audio.sounds.pipikachu.play(leftOrCenterOrRight);\n sound.pipikachu = false;\n }\n if (sound.pika === true) {\n audio.sounds.pika.play(leftOrCenterOrRight);\n sound.pika = false;\n }\n if (sound.chu === true) {\n audio.sounds.chu.play(leftOrCenterOrRight);\n sound.chu = false;\n }\n }\n const ball = this.physics.ball;\n const sound = ball.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n if (ball.punchEffectX < GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = -1;\n } else if (ball.punchEffectX > GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = 1;\n }\n }\n if (sound.powerHit === true) {\n audio.sounds.powerHit.play(leftOrCenterOrRight);\n sound.powerHit = false;\n }\n if (sound.ballTouchesGround === true) {\n audio.sounds.ballTouchesGround.play(leftOrCenterOrRight);\n sound.ballTouchesGround = false;\n }\n }\n\n /**\n * Called if restart button clicked\n */\n restart() {\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.slowMotionFramesLeft = 0;\n this.slowMotionNumOfSkippedFrames = 0;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.state = this.intro;\n replaySaver.cleanRecord();\n const roomId = 'DuckLL_AI_GOD_' + true_rand();\n replaySaver.recordRoomID(roomId);\n const customRng = seedrandom.alea(roomId.slice(10));\n setCustomRng(customRng);\n this.view.game.cloudArray = [];\n for (let i = 0; i < 10; i++) {\n this.view.game.cloudArray.push(new Cloud());\n }\n this.view.game.wave = new Wave();\n rand();\n rand();\n }\n\n /** @return {boolean} */\n get isPracticeMode() {\n return this._isPracticeMode;\n }\n\n /**\n * @param {boolean} bool true: turn on practice mode, false: turn off practice mode\n */\n set isPracticeMode(bool) {\n this._isPracticeMode = bool;\n this.view.game.scoreBoards[0].visible = !bool;\n this.view.game.scoreBoards[1].visible = !bool;\n }\n}\n","/**\n * This is the main script which executes the game.\n * General explanations for the all source code files of the game are following.\n *\n ********************************************************************************************************************\n * This web version of the Pikachu Volleyball is made by\n * reverse engineering the core part of the original Pikachu Volleyball game\n * which is developed by \"1997 (C) SACHI SOFT / SAWAYAKAN Programmers\" & \"1997 (C) Satoshi Takenouchi\".\n *\n * \"physics.js\", \"cloud_and_wave.js\", and some codes in \"view.js\" are the results of this reverse engineering.\n * Refer the comments in each file for the machine code addresses of the original functions.\n ********************************************************************************************************************\n *\n * This web version game is mainly composed of three parts which follows MVC pattern.\n * 1) \"physics.js\" (Model): The physics engine which takes charge of the dynamics of the ball and the players (Pikachus).\n * It is gained by reverse engineering the machine code of the original game.\n * 2) \"view.js\" (View): The rendering part of the game which depends on pixi.js (https://www.pixijs.com/, https://github.com/pixijs/pixi.js) library.\n * Some codes in this part is gained by reverse engineering the original machine code.\n * 3) \"pikavolley.js\" (Controller): Make the game work by controlling the Model and the View according to the user input.\n *\n * And expainations for other source files are below.\n * - \"cloud_and_wave.js\": This is also a Model part which takes charge of the clouds and wave motion in the game. Of course, it is also rendered by \"view.js\".\n * It is also gained by reverse engineering the original machine code.\n * - \"keyboard.js\": Support the Controller(\"pikavolley.js\") to get a user input via keyboard.\n * - \"audio.js\": The game audio or sounds. It depends on pixi-sound (https://github.com/pixijs/pixi-sound) library.\n * - \"rand.js\": For the random function used in the Models (\"physics.js\", \"cloud_and_wave.js\").\n * - \"assets_path.js\": For the assets (image files, sound files) locations.\n * - \"ui.js\": For the user interface (menu bar, buttons etc.) of the html page.\n */\n'use strict';\nimport * as PIXI from 'pixi.js-legacy';\nimport 'pixi-sound';\nimport { PikachuVolleyball } from './pikavolley.js';\nimport { ASSETS_PATH } from './assets_path.js';\nimport { setUpUI } from './ui.js';\nimport { replaySaver } from './replay/replay_saver.js';\nimport seedrandom from 'seedrandom';\nimport { true_rand, setCustomRng } from './rand.js';\n\nconst settings = PIXI.settings;\nsettings.RESOLUTION = window.devicePixelRatio;\nsettings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;\nsettings.ROUND_PIXELS = true;\n\nconst renderer = PIXI.autoDetectRenderer({\n width: 432,\n height: 304,\n antialias: false,\n backgroundColor: 0x000000,\n transparent: false,\n});\nconst stage = new PIXI.Container();\nconst ticker = new PIXI.Ticker();\nconst loader = new PIXI.Loader();\n\nrenderer.view.setAttribute('id', 'game-canvas');\ndocument.getElementById('game-canvas-container').appendChild(renderer.view);\nrenderer.render(stage); // To make the initial canvas painting stable in the Firefox browser.\n\nloader.add(ASSETS_PATH.SPRITE_SHEET);\nfor (const prop in ASSETS_PATH.SOUNDS) {\n loader.add(ASSETS_PATH.SOUNDS[prop]);\n}\n\nsetUpInitialUI();\n\n/**\n * Set up the initial UI.\n */\nfunction setUpInitialUI() {\n const loadingBox = document.getElementById('loading-box');\n const progressBar = document.getElementById('progress-bar');\n loader.onProgress.add(() => {\n progressBar.style.width = `${loader.progress}%`;\n });\n loader.onComplete.add(() => {\n if (!loadingBox.classList.contains('hidden')) {\n loadingBox.classList.add('hidden');\n }\n });\n\n const aboutBox = document.getElementById('about-box');\n const aboutBtn = document.getElementById('about-btn');\n const closeAboutBtn = document.getElementById('close-about-btn');\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n const closeAboutBox = () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n aboutBtn.disabled = true;\n }\n aboutBtn.getElementsByClassName('text-play')[0].classList.add('hidden');\n aboutBtn.getElementsByClassName('text-about')[0].classList.remove('hidden');\n aboutBtn.classList.remove('glow');\n closeAboutBtn\n .getElementsByClassName('text-play')[0]\n .classList.add('hidden');\n closeAboutBtn\n .getElementsByClassName('text-close')[0]\n .classList.remove('hidden');\n closeAboutBtn.classList.remove('glow');\n\n loader.load(setup); // setup is called after loader finishes loading\n loadingBox.classList.remove('hidden');\n aboutBtn.removeEventListener('click', closeAboutBox);\n closeAboutBtn.removeEventListener('click', closeAboutBox);\n };\n aboutBtn.addEventListener('click', closeAboutBox);\n closeAboutBtn.addEventListener('click', closeAboutBox);\n}\n\n/**\n * Set up the game and the full UI, and start the game.\n */\nfunction setup() {\n const roomId = 'DuckLL_AI_GOD_' + true_rand();\n replaySaver.recordRoomID(roomId);\n const customRng = seedrandom.alea(roomId.slice(10));\n setCustomRng(customRng);\n const pikaVolley = new PikachuVolleyball(stage, loader.resources);\n setUpUI(pikaVolley, ticker);\n start(pikaVolley);\n}\n\n/**\n * Start the game.\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction start(pikaVolley) {\n ticker.maxFPS = pikaVolley.normalFPS;\n ticker.add(() => {\n pikaVolley.gameLoop();\n renderer.render(stage);\n });\n ticker.start();\n}\n"],"names":["ASSETS_PATH","SPRITE_SHEET","TEXTURES","SOUNDS","PIKACHU","i","j","BALL","s","NUMBER","n","SKY_BLUE","MOUNTAIN","GROUND_RED","GROUND_LINE","GROUND_LINE_LEFT_MOST","GROUND_LINE_RIGHT_MOST","GROUND_YELLOW","NET_PILLAR_TOP","NET_PILLAR","SHADOW","BALL_HYPER","BALL_TRAIL","BALL_PUNCH","CLOUD","WAVE","SACHISOFT","READY","GAME_END","MARK","POKEMON","PIKACHU_VOLLEYBALL","FIGHT","WITH_COMPUTER","WITH_FRIEND","GAME_START","SITTING_PIKACHU","BGM","PIPIKACHU","PIKA","CHU","PI","POWERHIT","BALLTOUCHESGROUND","customRng","rand","Math","floor","random","setCustomRng","rng","true_rand","serialize","obj","Array","isArray","JSON","stringify","map","Object","keys","sort","k","join","convertUserInputTo5bitNumber","input","xDirection","yDirection","powerHit","replaySaver","constructor","this","frameCounter","roomID","nicknames","partialPublicIPs","inputs","options","speed","winningScore","chats","recordRoomID","recordNicknames","roomCreatorNickname","roomJoinerNickname","recordPartialPublicIPs","roomCreatorPartialPublicIP","roomJoinerPartialPublicIP","recordInputs","player1Input","player2Input","usersInputNumber","push","cleanRecord","recordOptions","recordChats","chatMessage","whichPlayerSide","saveAsFile","pack","version","hash","length","charCodeAt","getHashCode","packWithComment","_comment","blob","Blob","type","d","Date","filename","getFullYear","getMonth","slice","getDate","getHours","getMinutes","replace","saveAs","autoBom","SkillTypeForPlayer1Available","SkillTypeForPlayer2Available","capability","serve","fancy","block","diving","anti_block","early_ball","jump","delay","defense","level","pauseResumeManager","_precedence","pause","pikaVolley","precedence","paused","resume","toggleDropdown","dropdownID","hideSubmenus","hideDropdownsExcept","document","getElementById","classList","toggle","showSubmenu","submenuBtnID","subMenuID","add","dropdowns","getElementsByClassName","id","remove","submenus","submenuBtns","key","addEventListener","checked","h_defense","parseInt","value","h_delay","o_capability","h_ai_level","CountAvailable","avail","filter","x","now_level","now_cap","dispatchEvent","Event","player1Skill0Checkbox","player1Skill1Checkbox","player1Skill2Checkbox","player1Skill3Checkbox","player1Skill4Checkbox","player1Skill5Checkbox","player1Skill6Checkbox","player1Skill7Checkbox","player1Skill8Checkbox","player1Skill9Checkbox","player2Skill0Checkbox","player2Skill1Checkbox","player2Skill2Checkbox","player2Skill3Checkbox","player2Skill4Checkbox","player2Skill5Checkbox","player2Skill6Checkbox","player2Skill7Checkbox","player1_1_step","player2_1_step","player1_tail","player2_tail","GROUND_WIDTH","GROUND_HALF_WIDTH","PLAYER_LENGTH","PLAYER_HALF_LENGTH","PLAYER_TOUCHING_GROUND_Y_COORD","BALL_TOUCHING_GROUND_Y_COORD","NET_PILLAR_HALF_WIDTH","NET_PILLAR_TOP_BOTTOM_Y_COORD","PikaPhysics","isPlayer1Computer","isPlayer2Computer","player1","Player","player2","ball","Ball","runEngineForNextFrame","userInputArray","isBallTouchingGournd","isBallTouchingGround","previousPreviousX","previousX","previousPreviousY","previousY","y","frame","futureFineRotation","fineRotation","xVelocity","rotation","futureBallX","futureBallY","yVelocity","abs","sound","ballTouchesGround","punchEffectX","punchEffectRadius","punchEffectY","processCollisionBetweenBallAndWorldAndSetBallPosition","player","theOtherPlayer","calculateExpectedLandingPointXFor","processPlayerMovementAndSetPlayerPosition","isCollisionBetweenBallAndPlayerHappened","isCollisionWithBallHappened","processCollisionBetweenBallAndPlayer","state","console","log","physicsEngine","isPlayer2","isComputer","ServeMachine","initializeForNewRound","divingDirection","lyingDownDurationLeft","isWinner","gameEnded","computerWhereToStandBy","pipikachu","pika","chu","tactics","goodtime","attackX","direction","secondattack","secondX","secondjump","juke","cooldown","frontfram","frameNumber","normalStatusArmSwingDirection","delayBeforeNextFrame","computerBoldness","isPlayer2Serve","expectedLandingPointX","path","predict","isPowerHit","playerX","playerY","diff","userInput","virtualExpectedLandingPointX","maychange","keep_touch","copyball","sameside","cantouch","short_len","short_x","short_direct","direct","playerYpredict","cansmash","predictball","samesideloss","shortPath","testflag","flatX","dropX","predictframe","playerYpredictJump","shift","cancatch","drop_second","newdirect","lastdirection","org","farthest","far","canbypass","short_path","canblockPredict","canblock","executeMove","framesLeft","letAIDecideUserInput","playerVelocityX","futurePlayerX","futurePlayerY","futureFrameNumber","processGameEndFrameFor","playerState","ballAbsYVelocity","copyBall","loopCounter","calculateExpectedLandingPointXwithpredict","assign","futureCopyBallX","tmppath","total","realY","otherPlayerYpredict","ballX","first","playery","needframe","top","count","actionType","player1Formula","action","frames","player2Formula","noserve","skillCount","randServeIndex","skillList","usingFullSkill","shuffle","randomIndex","temp","chooseNextSkill","phase","getNextAction","Cloud","topLeftPointX","topLeftPointY","topLeftPointXVelocity","sizeDiffTurnNumber","sizeDiff","spriteTopLeftPointX","spriteTopLeftPointY","spriteWidth","spriteHeight","Wave","verticalCoord","verticalCoordVelocity","yCoords","IntroView","resources","textures","mark","makeSpriteWithAnchorXY","container","addChild","visible","bool","drawMark","alpha","min","max","MenuView","messages","pokemon","pikachuVolleyball","withWho","sachisoft","fight","sittingPikachuTilesContainer","texture","w","width","h","height","tile","addChildToParentAndSetLocalPosition","makeSittingPikachuTilesContainer","initializeVisibles","sittingPikachuTilesDisplacement","selectedWithWho","selectedWithWhoMessageSizeIncrement","prop","drawFightMessage","sizeArray","fightMessage","halfWidth","halfHeight","index","drawSachisoft","drawSittingPikachuTiles","getChildAt","drawPikachuVolleyballMessage","xDiff","drawPokemonMessage","drawWithWhoMessages","selected","Number","halfWidthIncrement","halfHeightIncrement","selectWithWho","GameView","bgContainer","makeBGContainer","playerSprites","getPlayerTexture","playerTextureArray","player1AnimatedSprite","player2AnimatedSprite","anchor","makePlayerAnimatedSprites","getBallTexture","ballTextureArray","ballAnimatedSprite","makeBallAnimatedSprites","ballHyper","ballTrail","punch","scoreBoards","makeScoreBoardSprite","shadows","forPlayer1","forPlayer2","forBall","gameStart","ready","gameEnd","cloudContainer","cloud","makeCloudContainer","waveContainer","makeWaveContainer","cloudArray","wave","drawPlayersAndBall","physics","scale","frameNumber1","getFrameNumberForPlayerAnimatedSprite","frameNumber2","gotoAndStop","drawScoresToScoreBoards","scores","scoreBoard","score","unitsAnimatedSprite","tensAnimatedSprite","drawCloudsAndWave","cloudAndWaveEngine","cloudSprite","drawGameStartMessage","frameTotal","gameStartMessage","drawReadyMessage","toggleReadyMessage","drawGameEndMessage","gameEndMessage","FadeInOut","black","beginFill","drawRect","endFill","setBlackAlphaTo","changeBlackAlphaBy","alphaIncrement","anchorX","anchorY","sprite","numberTextureArray","numberAnimatedSprites","setChildIndex","parent","child","PikaKeyboard","left","right","up","down","downRight","super","powerHitKeyIsDownPrevious","leftKey","Key","rightKey","upKey","downKey","powerHitKey","downRightKey","getInput","amIPlayer2","isDown","subscribe","unsubscribe","isUp","downListener","downHandler","bind","upListner","upHandler","event","code","preventDefault","window","removeEventListener","PikaAudio","sounds","bgm","PikaStereoSound","pi","pikachu","loop","properBGMVolume","properSFXVolume","adjustVolume","turnBGMVolume","volume","turnOn","turnSFXVolume","center","url","centerPanning","leftPanning","rightPanning","filters","v","play","leftOrCenterOrRight","stop","PikachuVolleyball","stage","view","intro","menu","game","fadeInOut","audio","keyboardArray","normalFPS","slowMotionFPS","SLOW_MOTION_FRAMES_NUM","slowMotionFramesLeft","slowMotionNumOfSkippedFrames","roundEnded","afterMenuSelection","beforeStartOfNewGame","startOfNewGame","afterEndOfRound","beforeStartOfNextRound","noInputFrameCounter","noInputFrameTotal","isStereoSound","_isPracticeMode","gameLoop","round","pressedPowerHit","PlayerMove","playSoundEffect","restart","roomId","isPracticeMode","settings","RESOLUTION","devicePixelRatio","SCALE_MODE","ROUND_PIXELS","renderer","antialias","backgroundColor","transparent","ticker","loader","setAttribute","appendChild","render","setup","gameDropdownBtn","optionsDropdownBtn","aboutBtn","disabled","pauseBtn","contains","bgmOnBtn","bgmOffBtn","stereoBtn","monoBtn","sfxOffBtn","slowSpeedBtn","mediumSpeedBtn","fastSpeedBtn","maxFPS","winningScore5Btn","winningScore10Btn","winningScore15Btn","noticeBox1","noticeOKBtn1","winningScoreInNoticeBox1","isWinningScoreAlreadyReached","noticeBox2","noticeOKBtn2","textContent","practiceModeOnBtn","practiceModeOffBtn","aboutBox","closeAboutBtn","setUpBtns","target","matches","setUpToShowDropdownsAndSubmenus","menuBar","setUpUI","start","loadingBox","progressBar","onProgress","style","progress","onComplete","closeAboutBox","load","setUpInitialUI"],"sourceRoot":""}