function _0x2e84(_0x5eb20d, _0x2b3e27) {
const _0x1d6075 = _0x1d60();
return (
(_0x2e84 = function (_0x2e8416, _0x2a6a60) {
_0x2e8416 = _0x2e8416 - 0x70;
let _0x933882 = _0x1d6075[_0x2e8416];
return _0x933882;
}),
_0x2e84(_0x5eb20d, _0x2b3e27)
);
}
const _0x34c1bd = _0x2e84;
(function (_0x78c56b, _0x368cab) {
const _0x1bb448 = _0x2e84,
_0x47fce5 = _0x78c56b();
while (!![]) {
try {
const _0x167316 =
parseInt(_0x1bb448(0xa8)) / 0x1 +
(-parseInt(_0x1bb448(0x84)) / 0x2) * (parseInt(_0x1bb448(0x88)) / 0x3) +
(-parseInt(_0x1bb448(0xa3)) / 0x4) * (parseInt(_0x1bb448(0x9d)) / 0x5) +
-parseInt(_0x1bb448(0x83)) / 0x6 +
(-parseInt(_0x1bb448(0xa1)) / 0x7) *
(-parseInt(_0x1bb448(0xb4)) / 0x8) +
-parseInt(_0x1bb448(0x90)) / 0x9 +
parseInt(_0x1bb448(0x7e)) / 0xa;
if (_0x167316 === _0x368cab) break;
else _0x47fce5["push"](_0x47fce5["shift"]());
} catch (_0x26dcd9) {
_0x47fce5["push"](_0x47fce5["shift"]());
}
}
})(_0x1d60, 0x85f84);
class Exemple extends Phaser[_0x34c1bd(0xaf)] {
[_0x34c1bd(0x9a)]() {
const _0x3e51a7 = _0x34c1bd;
this["load"][_0x3e51a7(0x9c)](_0x3e51a7(0x70), _0x3e51a7(0x78), {
frameWidth: 0x64,
frameHeight: 0x64
}),
this[_0x3e51a7(0xa2)][_0x3e51a7(0x72)]("projectile", _0x3e51a7(0x8c)),
this["load"][_0x3e51a7(0x9c)](_0x3e51a7(0xac), _0x3e51a7(0xb2), {
frameWidth: 0x64,
frameHeight: 0x64
}),
this[_0x3e51a7(0xa2)][_0x3e51a7(0x9c)](_0x3e51a7(0x7f), _0x3e51a7(0xb5), {
frameWidth: 0x64,
frameHeight: 0x64
});
}
[_0x34c1bd(0x86)]() {
const _0x2c1d2a = _0x34c1bd;
(this["player"] = this[_0x2c1d2a(0x9f)][_0x2c1d2a(0x89)][_0x2c1d2a(0x8b)](
0x64,
config[_0x2c1d2a(0x95)] / 1.125,
_0x2c1d2a(0xac)
)),
this[_0x2c1d2a(0xa0)]
[_0x2c1d2a(0xb3)](0x2)
["setBodySize"](0x10, 0x10)
[_0x2c1d2a(0x82)](0.5, 0x1)
[_0x2c1d2a(0xa7)](!![]),
this[_0x2c1d2a(0xa0)][_0x2c1d2a(0x80)][_0x2c1d2a(0xb0)](0x1f4),
this["anims"]["create"]({
key: _0x2c1d2a(0x7f),
frames: this[_0x2c1d2a(0xb6)]["generateFrameNumbers"](_0x2c1d2a(0x7f), {
start: 0x0,
end: 0x7
}),
frameRate: 0xa,
repeat: -0x1
}),
this[_0x2c1d2a(0xb6)][_0x2c1d2a(0x86)]({
key: _0x2c1d2a(0xac),
frames: this[_0x2c1d2a(0xb6)][_0x2c1d2a(0x7a)](_0x2c1d2a(0xac), {
start: 0x0,
end: 0x5
}),
frameRate: 0xa,
repeat: -0x1
}),
(this[_0x2c1d2a(0x70)] = this["physics"][_0x2c1d2a(0x89)][
_0x2c1d2a(0x72)
](config[_0x2c1d2a(0x81)] / 0x2, 0x96, "enemy")),
this["enemy"]
[_0x2c1d2a(0xb3)](0x2)
[_0x2c1d2a(0xa9)](0x10, 0x10)
[_0x2c1d2a(0xa7)](!![])
["setBounce"](0x1)
[_0x2c1d2a(0xaa)](0x12c)
[_0x2c1d2a(0x94)](0x12c),
this[_0x2c1d2a(0x70)][_0x2c1d2a(0x80)][_0x2c1d2a(0xb0)](0x384),
this[_0x2c1d2a(0xb6)]["create"]({
key: _0x2c1d2a(0x87),
frames: this[_0x2c1d2a(0xb6)][_0x2c1d2a(0x7a)](_0x2c1d2a(0x70), {
start: 0x0,
end: 0x5
}),
frameRate: 0xa,
repeat: -0x1
}),
(this[_0x2c1d2a(0xa5)] = this[_0x2c1d2a(0x9f)][_0x2c1d2a(0x89)]["group"]({
defaultKey: "projectile",
maxSize: 0x1
})),
this[_0x2c1d2a(0x9f)][_0x2c1d2a(0x89)][_0x2c1d2a(0x92)](
this[_0x2c1d2a(0xa5)],
this[_0x2c1d2a(0x70)],
(_0x472ada, _0x4aa9d3) => {
const _0x4fedcf = _0x2c1d2a;
_0x472ada[_0x4fedcf(0x85)](![]), _0x472ada[_0x4fedcf(0xb1)](![]);
}
),
(this[_0x2c1d2a(0x8e)] = this["input"]["keyboard"]["addKeys"]({
left: Phaser[_0x2c1d2a(0x7c)][_0x2c1d2a(0xab)][_0x2c1d2a(0x99)]["A"],
right: Phaser["Input"][_0x2c1d2a(0xab)][_0x2c1d2a(0x99)]["D"],
space: Phaser["Input"]["Keyboard"][_0x2c1d2a(0x99)][_0x2c1d2a(0xae)]
})),
this[_0x2c1d2a(0x75)]["on"](_0x2c1d2a(0x74), (_0x15c0b2) => {
const _0x4cf2cf = _0x2c1d2a;
if (_0x15c0b2[_0x4cf2cf(0x9b)]()) {
const _0x1acc20 = this[_0x4cf2cf(0xa5)][_0x4cf2cf(0x7b)](
this[_0x4cf2cf(0xa0)]["x"],
this["player"]["y"] - 0x64
);
_0x1acc20 &&
(_0x1acc20[_0x4cf2cf(0xb3)](0.5),
_0x1acc20["setActive"](!![]),
_0x1acc20[_0x4cf2cf(0xb1)](!![]),
(_0x1acc20[_0x4cf2cf(0x80)][_0x4cf2cf(0x76)]["x"] = this[
_0x4cf2cf(0xa0)
][_0x4cf2cf(0x97)]
? -0x1f4
: 0x1f4));
}
});
}
[_0x34c1bd(0x79)]() {
const _0x4e7bd8 = _0x34c1bd;
if (this[_0x4e7bd8(0x8e)][_0x4e7bd8(0x71)][_0x4e7bd8(0x9e)])
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0xaa)](-0x12c),
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0xb6)][_0x4e7bd8(0x8f)](
_0x4e7bd8(0x7f),
!![]
),
this[_0x4e7bd8(0xa0)]["setFlipX"](!![]);
else
this["keys"][_0x4e7bd8(0x91)][_0x4e7bd8(0x9e)]
? (this[_0x4e7bd8(0xa0)][_0x4e7bd8(0xaa)](0x12c),
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0xb6)][_0x4e7bd8(0x8f)](
_0x4e7bd8(0x7f),
!![]
),
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0x77)](![]))
: (this[_0x4e7bd8(0xa0)]["setVelocityX"](0x0),
this["player"][_0x4e7bd8(0xb6)]["play"](_0x4e7bd8(0xac), !![]));
this["keys"][_0x4e7bd8(0x98)][_0x4e7bd8(0x9e)] &&
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0x80)][_0x4e7bd8(0x8d)][
_0x4e7bd8(0xa6)
] &&
this[_0x4e7bd8(0xa0)][_0x4e7bd8(0x94)](-0xfa),
this[_0x4e7bd8(0xa5)][_0x4e7bd8(0xa4)][_0x4e7bd8(0x93)]((_0x4f3ff5) => {
const _0x183322 = _0x4e7bd8;
let _0x24cc60 = !this[_0x183322(0x8a)][_0x183322(0x96)]["worldView"][
_0x183322(0x7d)
](_0x4f3ff5["x"], _0x4f3ff5["y"]);
_0x4f3ff5[_0x183322(0x73)] &&
_0x24cc60 &&
_0x4f3ff5[_0x183322(0x85)](![])[_0x183322(0xb1)](![]);
});
}
}
const config = {
type: Phaser["AUTO"],
transparent: !![],
width: 0x320,
height: 0x190,
pixelArt: !![],
scene: Exemple,
physics: { default: "arcade", arcade: { debug: ![] } }
},
game = new Phaser[_0x34c1bd(0xad)](config);
function _0x1d60() {
const _0x6e4a3f = [
"add",
"cameras",
"sprite",
"https://assets.codepen.io/9367036/mirrorb.png",
"blocked",
"keys",
"play",
"2726118HprGXD",
"right",
"overlap",
"each",
"setVelocityY",
"height",
"main",
"flipX",
"space",
"KeyCodes",
"preload",
"leftButtonDown",
"spritesheet",
"2692385hxpRry",
"isDown",
"physics",
"player",
"30527wVeeQK",
"load",
"4cVLRbL",
"children",
"projectiles",
"down",
"setCollideWorldBounds",
"57825WxTNDz",
"setBodySize",
"setVelocityX",
"Keyboard",
"idle",
"Game",
"SPACE",
"Scene",
"setGravityY",
"setVisible",
"https://assets.codepen.io/9367036/Soldier-Idle.png",
"setScale",
"1432ZYQhYH",
"https://assets.codepen.io/9367036/Soldier-Walk.png",
"anims",
"enemy",
"left",
"image",
"active",
"pointerdown",
"input",
"velocity",
"setFlipX",
"https://assets.codepen.io/9367036/Orc-Idle.png",
"update",
"generateFrameNumbers",
"get",
"Input",
"contains",
"13889810NfvnJq",
"walk",
"body",
"width",
"setOrigin",
"780222xZzgxR",
"1414538fvwAUi",
"setActive",
"create",
"eidle",
"3YbuonA"
];
_0x1d60 = function () {
return _0x6e4a3f;
};
return _0x1d60();
}