This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GamePad { | |
UP = false; | |
DOWN = false; | |
RIGHT = false; | |
LEFT = false; | |
A = false; | |
B = false; | |
press = { | |
UP: false, | |
DOWN: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeEventChecker { | |
add(name, checkerFunc) { | |
this[name] = {checkerFunc, lastValue:undefined, isChanged:false}; | |
return this; | |
} | |
check() { | |
Object.entries(this).forEach((e) => { | |
const [k, v] = e; | |
const value = v.checkerFunc(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScreenGamePad { | |
UP = false; | |
DOWN = false; | |
RIGHT = false; | |
LEFT = false; | |
A = false; | |
B = false; | |
press = { | |
UP: false, | |
DOWN: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* プレイヤー。矢印で操作できる | |
*/ | |
class Player { | |
gameObject; | |
cursors; | |
create(scene) { | |
const player = (this.gameObject = scene.physics.add.existing( | |
scene.add.rectangle(100, 300, 16, 28, 0xffff00) | |
)); |
OlderNewer