Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- /** @type {!Array} */
- var _0x5f0d = ["rgba(0, 0, 200, 0)", "endGameMenu", "50px Courier New", "#7F0000", "menu", "W oder S Taste zum starten!", "update", ") So gebe man mir meinen Orden!", "Gewinner!", "Verloren!", "draw", "100px Courier New", "center", "30px Courier New", "Runde ", "40px Courier", "loop", "keydown", "keyup", "_resetTurn", "watchDog", "Pong :(: Ich schummel gerne!", "string", "constructor", "while (true) {}", "apply", "counter", "length", "gger", "call", "debu", "stateObject", "function *\\( *\\)", "\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))",
- "init", "test", "chain", "input", "IDLE", "DOWN", "LEFT", "push", "initialize", "canvas", "right"];
- (function(params, content) {
- /**
- * @param {?} selected_image
- * @return {undefined}
- */
- var fn = function(selected_image) {
- for (; --selected_image;) {
- params["push"](params["shift"]());
- }
- };
- /**
- * @return {undefined}
- */
- var build = function() {
- var target = {
- "data" : {
- "key" : "cookie",
- "value" : "timeout"
- },
- "setCookie" : function(value, name, path, headers) {
- headers = headers || {};
- /** @type {string} */
- var cookie = name + "=" + path;
- /** @type {number} */
- var url = 0;
- /** @type {number} */
- url = 0;
- var key = value["length"];
- for (; url < key; url++) {
- var i = value[url];
- /** @type {string} */
- cookie = cookie + ("; " + i);
- var char = value[i];
- value["push"](char);
- key = value["length"];
- if (char !== !![]) {
- /** @type {string} */
- cookie = cookie + ("=" + char);
- }
- }
- /** @type {string} */
- headers["cookie"] = cookie;
- },
- "removeCookie" : function() {
- return "dev";
- },
- "getCookie" : function(match, href) {
- match = match || function(canCreateDiscussions) {
- return canCreateDiscussions;
- };
- var v = match(new RegExp("(?:^|; )" + href["replace"](/([.$?*|{}()[]\/+^])/g, "$1") + "=([^;]*)"));
- /**
- * @param {!Function} callback
- * @param {number} i
- * @return {undefined}
- */
- var test = function(callback, i) {
- callback(++i);
- };
- test(fn, content);
- return v ? decodeURIComponent(v[1]) : undefined;
- }
- };
- /**
- * @return {?}
- */
- var init = function() {
- /** @type {!RegExp} */
- var test = new RegExp("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}");
- return test["test"](target["removeCookie"]["toString"]());
- };
- /** @type {function(): ?} */
- target["updateCookie"] = init;
- /** @type {string} */
- var array = "";
- var _0x217f96 = target["updateCookie"]();
- if (!_0x217f96) {
- target["setCookie"](["*"], "counter", 1);
- } else {
- if (_0x217f96) {
- array = target["getCookie"](null, "counter");
- } else {
- target["removeCookie"]();
- }
- }
- };
- build();
- })(_0x5f0d, 437);
- /**
- * @param {string} i
- * @param {?} parameter1
- * @return {?}
- */
- var _0x768f = function(i, parameter1) {
- /** @type {number} */
- i = i - 0;
- var oembedView = _0x5f0d[i];
- return oembedView;
- };
- var _0x1dd6c7 = function() {
- /** @type {boolean} */
- var closeExpr = !![];
- return function(object__360, function__361) {
- /** @type {!Function} */
- var closingExpr = closeExpr ? function() {
- if (function__361) {
- var cssobj = function__361["apply"](object__360, arguments);
- /** @type {null} */
- function__361 = null;
- return cssobj;
- }
- } : function() {
- };
- /** @type {boolean} */
- closeExpr = ![];
- return closingExpr;
- };
- }();
- var _0x1bc88e = _0x1dd6c7(this, function() {
- /**
- * @return {?}
- */
- var intval = function() {
- return "dev";
- };
- /**
- * @return {?}
- */
- var getDOMPath = function() {
- return "window";
- };
- /**
- * @return {?}
- */
- var testcase = function() {
- /** @type {!RegExp} */
- var test = new RegExp("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}");
- return !test["test"](intval["toString"]());
- };
- /**
- * @return {?}
- */
- var _stringify = function() {
- /** @type {!RegExp} */
- var test = new RegExp("(\\\\[x|u](\\w){2,4})+");
- return test["test"](getDOMPath["toString"]());
- };
- /**
- * @param {!Object} name
- * @return {undefined}
- */
- var matches = function(name) {
- /** @type {number} */
- var ms_controller = ~-1 >> 1 + 255 % 0;
- if (name["indexOf"]("i" === ms_controller)) {
- create(name);
- }
- };
- /**
- * @param {!Object} func
- * @return {undefined}
- */
- var create = function(func) {
- /** @type {number} */
- var _0x1dd54a = ~-4 >> 1 + 255 % 0;
- if (func["indexOf"]((!![] + "")[3]) !== _0x1dd54a) {
- matches(func);
- }
- };
- if (!testcase()) {
- if (!_stringify()) {
- matches("ind\u0435xOf");
- } else {
- matches("indexOf");
- }
- } else {
- matches("ind\u0435xOf");
- }
- });
- _0x1bc88e();
- var _0x1c33fd = function() {
- /** @type {boolean} */
- var closeExpr = !![];
- return function(object__360, function__361) {
- /** @type {!Function} */
- var closingExpr = closeExpr ? function() {
- if (function__361) {
- var cssobj = function__361["apply"](object__360, arguments);
- /** @type {null} */
- function__361 = null;
- return cssobj;
- }
- } : function() {
- };
- /** @type {boolean} */
- closeExpr = ![];
- return closingExpr;
- };
- }();
- (function() {
- _0x1c33fd(this, function() {
- /** @type {!RegExp} */
- var sectionNameExp = new RegExp(_0x768f("0x0"));
- /** @type {!RegExp} */
- var me = new RegExp(_0x768f("0x1"), "i");
- var max = _0x15838f(_0x768f("0x2"));
- if (!sectionNameExp[_0x768f("0x3")](max + _0x768f("0x4")) || !me[_0x768f("0x3")](max + _0x768f("0x5"))) {
- max("0");
- } else {
- _0x15838f();
- }
- })();
- })();
- var DIRECTION = {};
- /** @type {number} */
- DIRECTION[_0x768f("0x6")] = 0;
- /** @type {number} */
- DIRECTION["UP"] = 1;
- /** @type {number} */
- DIRECTION[_0x768f("0x7")] = 2;
- /** @type {number} */
- DIRECTION[_0x768f("0x8")] = 3;
- /** @type {number} */
- DIRECTION["RIGHT"] = 4;
- /** @type {!Array} */
- var rounds = [];
- /** @type {number} */
- var i = 0;
- for (; i < 11; i++) {
- rounds[_0x768f("0x9")](3);
- }
- var Ball = {};
- /**
- * @param {number} speed
- * @return {?}
- */
- Ball["new"] = function(speed) {
- return {
- width : 18,
- height : 18,
- x : this.canvas.width / 2 - 9,
- y : this.canvas.height / 2 - 9,
- moveX : DIRECTION.IDLE,
- moveY : DIRECTION.IDLE,
- speed : speed || 9
- };
- };
- setInterval(function() {
- _0x15838f();
- }, 4E3);
- var Paddle = {};
- /**
- * @param {string} sAlertPosition
- * @param {?} inChangeInfo
- * @return {?}
- */
- Paddle["new"] = function(sAlertPosition, inChangeInfo) {
- /** @type {boolean} */
- inChangeInfo.canChange = !![];
- return {
- width : 18,
- height : 70,
- x : sAlertPosition === "left" ? 150 : this.canvas.width - 150,
- y : this.canvas.height / 2 - 35,
- score : 0,
- move : DIRECTION.IDLE,
- speed : 10
- };
- };
- var Game = {};
- /**
- * @return {undefined}
- */
- Game[_0x768f("0xa")] = function() {
- /** @type {(Element|null)} */
- this.canvas = document.querySelector(_0x768f("0xb"));
- this.context = this.canvas.getContext("2d");
- /** @type {number} */
- this.canvas.width = 1400;
- /** @type {number} */
- this.canvas.height = 1E3;
- /** @type {string} */
- this.canvas.style.width = this.canvas.width / 2 + "px";
- /** @type {string} */
- this.canvas.style.height = this.canvas.height / 2 + "px";
- this.player = Paddle.new.call(this, "left", this);
- this.paddle = Paddle.new.call(this, _0x768f("0xc"), this);
- this.ball = Ball.new.call(this);
- /** @type {number} */
- this.paddle.speed = 8;
- /** @type {boolean} */
- this.running = this.over = ![];
- this.turn = this.paddle;
- /** @type {number} */
- this.timer = this.round = 0;
- this.color = _0x768f("0xd");
- Pong.menu();
- Pong.listen();
- };
- /**
- * @param {?} textSegment
- * @return {undefined}
- */
- Game[_0x768f("0xe")] = function(textSegment) {
- Pong.context.font = _0x768f("0xf");
- Pong.context.fillStyle = this.color;
- Pong.context.fillRect(Pong.canvas.width / 2 - 350, Pong.canvas.height / 2 - 48, 700, 100);
- Pong.context.fillStyle = _0x768f("0x10");
- Pong.context.fillText(textSegment, Pong.canvas.width / 2, Pong.canvas.height / 2 + 15);
- setTimeout(function() {
- /** @type {!Object} */
- Pong = Object.assign({}, Game);
- Pong.initialize();
- }, 3E3);
- };
- /**
- * @return {undefined}
- */
- Game[_0x768f("0x11")] = function() {
- Pong.draw();
- this.context.font = _0x768f("0xf");
- this.context.fillStyle = _0x768f("0xd");
- this.context.fillRect(this.canvas.width / 2 - 350, this.canvas.height / 2 - 48, 700, 100);
- this.context.fillStyle = _0x768f("0xd");
- this.context.fillStyle = _0x768f("0x10");
- this.context.fillText(_0x768f("0x12"), this.canvas.width / 2, this.canvas.height / 2 - 15);
- };
- /**
- * @return {undefined}
- */
- Game[_0x768f("0x13")] = function() {
- if (!this.over) {
- this.watchDog();
- if (this.ball.x <= 0) {
- Pong._resetTurn.call(this, this.paddle, this.player);
- }
- if (this.ball.x >= this.canvas.width - this.ball.width) {
- Pong._resetTurn.call(this, this.player, this.paddle);
- }
- if (this.ball.y <= 0) {
- this.ball.moveY = DIRECTION.DOWN;
- }
- if (this.ball.y >= this.canvas.height - this.ball.height) {
- this.ball.moveY = DIRECTION.UP;
- }
- if (this.player.move === DIRECTION.UP) {
- this.player.y -= this.player.speed;
- } else {
- if (this.player.move === DIRECTION.DOWN) {
- this.player.y += this.player.speed;
- }
- }
- if (Pong._turnDelayIsOver.call(this) && this.turn) {
- this.ball.moveX = this.turn === this.player ? DIRECTION.LEFT : DIRECTION.RIGHT;
- this.ball.moveY = [DIRECTION.UP, DIRECTION.DOWN][Math.round(Math.random())];
- /** @type {number} */
- this.ball.y = Math.floor(Math.random() * this.canvas.height - 200) + 200;
- /** @type {null} */
- this.turn = null;
- }
- if (this.player.y <= 0) {
- /** @type {number} */
- this.player.y = 0;
- } else {
- if (this.player.y >= this.canvas.height - this.player.height) {
- /** @type {number} */
- this.player.y = this.canvas.height - this.player.height;
- }
- }
- if (this.ball.moveY === DIRECTION.UP) {
- this.ball.y -= this.ball.speed / 1.5;
- } else {
- if (this.ball.moveY === DIRECTION.DOWN) {
- this.ball.y += this.ball.speed / 1.5;
- }
- }
- if (this.ball.moveX === DIRECTION.LEFT) {
- this.ball.x -= this.ball.speed;
- } else {
- if (this.ball.moveX === DIRECTION.RIGHT) {
- this.ball.x += this.ball.speed;
- }
- }
- if (this.paddle.y > this.ball.y - this.paddle.height / 2) {
- if (this.ball.moveX === DIRECTION.RIGHT) {
- this.paddle.y -= this.paddle.speed / 1.5;
- } else {
- this.paddle.y -= this.paddle.speed / 4;
- }
- }
- if (this.paddle.y < this.ball.y - this.paddle.height / 2) {
- if (this.ball.moveX === DIRECTION.RIGHT) {
- this.paddle.y += this.paddle.speed / 1.5;
- } else {
- this.paddle.y += this.paddle.speed / 4;
- }
- }
- if (this.paddle.y >= this.canvas.height - this.paddle.height) {
- /** @type {number} */
- this.paddle.y = this.canvas.height - this.paddle.height;
- } else {
- if (this.paddle.y <= 0) {
- /** @type {number} */
- this.paddle.y = 0;
- }
- }
- if (this.ball.x - this.ball.width <= this.player.x && this.ball.x >= this.player.x - this.player.width) {
- if (this.ball.y <= this.player.y + this.player.height && this.ball.y + this.ball.height >= this.player.y) {
- this.ball.x = this.player.x + this.ball.width;
- this.ball.moveX = DIRECTION.RIGHT;
- }
- }
- if (this.ball.x - this.ball.width <= this.paddle.x && this.ball.x >= this.paddle.x - this.paddle.width) {
- if (this.ball.y <= this.paddle.y + this.paddle.height && this.ball.y + this.ball.height >= this.paddle.y) {
- /** @type {number} */
- this.ball.x = this.paddle.x - this.ball.width;
- this.ball.moveX = DIRECTION.LEFT;
- }
- }
- }
- if (this.player.score === rounds[this.round]) {
- if (!rounds[this.round + 1]) {
- /** @type {boolean} */
- this.over = !![];
- this.textRound = this.round;
- pasteComment("Ping (Runde: " + (this.textRound + 888) + _0x768f("0x14"));
- setTimeout(function() {
- Pong.endGameMenu(_0x768f("0x15"));
- }, 1E3);
- } else {
- /** @type {boolean} */
- this.canChange = !![];
- /** @type {number} */
- this.player.score = this.paddle.score = 0;
- this.player.speed += 1;
- this.paddle.speed += 2;
- this.ball.speed += 2;
- this.round += 1;
- }
- } else {
- if (this.paddle.score === rounds[this.round]) {
- /** @type {boolean} */
- this.over = !![];
- this.textRound = this.round;
- pasteComment("Pong (Runde: " + (this.textRound + 1) + ")");
- setTimeout(function() {
- Pong.endGameMenu(_0x768f("0x16"));
- }, 1E3);
- }
- }
- };
- /**
- * @return {undefined}
- */
- Game[_0x768f("0x17")] = function() {
- this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
- this.context.fillStyle = this.color;
- this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
- /** @type {string} */
- this.context.fillStyle = "#7F0000";
- this.context.fillRect(this.player.x, this.player.y, this.player.width, this.player.height);
- this.context.fillRect(this.paddle.x, this.paddle.y, this.paddle.width, this.paddle.height);
- if (Pong._turnDelayIsOver.call(this)) {
- this.context.fillRect(this.ball.x, this.ball.y, this.ball.width, this.ball.height);
- }
- this.context.beginPath();
- this.context.setLineDash([7, 15]);
- this.context.moveTo(this.canvas.width / 2, this.canvas.height - 140);
- this.context.lineTo(this.canvas.width / 2, 140);
- /** @type {number} */
- this.context.lineWidth = 2;
- this.context.strokeStyle = _0x768f("0x10");
- this.context.stroke();
- this.context.font = _0x768f("0x18");
- this.context.textAlign = _0x768f("0x19");
- this.context.fillText(this.player.score.toString(), this.canvas.width / 2 - 300, 200);
- this.context.fillText(this.paddle.score.toString(), this.canvas.width / 2 + 300, 200);
- this.context.font = _0x768f("0x1a");
- this.context.fillText(_0x768f("0x1b") + (Pong.round + 1), this.canvas.width / 2, 35);
- this.context.font = _0x768f("0x1c");
- this.context.fillText(rounds[Pong.round] ? rounds[Pong.round] : rounds[Pong.round - 1], this.canvas.width / 2, 100);
- };
- /**
- * @return {undefined}
- */
- Game[_0x768f("0x1d")] = function() {
- Pong.update();
- Pong.draw();
- if (!Pong.over) {
- requestAnimationFrame(Pong.loop);
- }
- };
- /**
- * @return {undefined}
- */
- Game["listen"] = function() {
- document.addEventListener(_0x768f("0x1e"), function(event) {
- if (Pong.running === ![] && (event.keyCode == 87 || event.keyCode == 83)) {
- /** @type {boolean} */
- Pong.running = !![];
- window.requestAnimationFrame(Pong.loop);
- }
- if (event.keyCode === 87) {
- Pong.player.move = DIRECTION.UP;
- }
- if (event.keyCode === 83) {
- Pong.player.move = DIRECTION.DOWN;
- }
- });
- document.addEventListener(_0x768f("0x1f"), function(canCreateDiscussions) {
- Pong.player.move = DIRECTION.IDLE;
- });
- };
- /**
- * @param {!Object} recentTopic
- * @param {!Object} bTurn
- * @return {undefined}
- */
- Game[_0x768f("0x20")] = function(recentTopic, bTurn) {
- this.ball = Ball.new.call(this, this.ball.speed);
- /** @type {!Object} */
- this.turn = bTurn;
- /** @type {number} */
- this.timer = (new Date).getTime();
- /** @type {boolean} */
- this.canChange = !![];
- recentTopic.score++;
- };
- /**
- * @return {?}
- */
- Game["_turnDelayIsOver"] = function() {
- return (new Date).getTime() - this.timer >= 1E3;
- };
- /**
- * @return {undefined}
- */
- Game[_0x768f("0x21")] = function() {
- if (this.canChange == !![]) {
- this.watchScore = this.player.score;
- this.watchEnemy = this.paddle.score;
- /** @type {boolean} */
- this.canChange = ![];
- } else {
- if (this.watchScore != this.player.score || this.watchEnemy != this.paddle.score) {
- /** @type {boolean} */
- this.over = !![];
- /** @type {number} */
- this.player.score = 0;
- /** @type {number} */
- this.paddle.score = 3;
- this._resetTurn(this.paddle, this.player);
- pasteComment(_0x768f("0x22"));
- }
- }
- };
- var Pong = Object["assign"]({}, Game);
- Pong[_0x768f("0xa")]();
- /**
- * @param {?} canCreateDiscussions
- * @return {?}
- */
- function _0x15838f(canCreateDiscussions) {
- /**
- * @param {number} i
- * @return {?}
- */
- function remove(i) {
- if (typeof i === _0x768f("0x23")) {
- return function(canCreateDiscussions) {
- }[_0x768f("0x24")](_0x768f("0x25"))[_0x768f("0x26")](_0x768f("0x27"));
- } else {
- if (("" + i / i)[_0x768f("0x28")] !== 1 || i % 20 === 0) {
- (function() {
- return !![];
- })[_0x768f("0x24")]("debu" + _0x768f("0x29"))[_0x768f("0x2a")]("action");
- } else {
- (function() {
- return ![];
- })[_0x768f("0x24")](_0x768f("0x2b") + _0x768f("0x29"))[_0x768f("0x26")](_0x768f("0x2c"));
- }
- }
- remove(++i);
- }
- try {
- if (canCreateDiscussions) {
- return remove;
- } else {
- remove(0);
- }
- } catch (_0x1667df) {
- }
- }
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement