code
stringlengths
1
2.08M
language
stringclasses
1 value
var xmlHttpallskill function Showallskill() { xmlHttpallskill=GetXmlHttpObject() if (xmlHttpallskill==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/GetAllSkill.php" url=url+"?sid="+Math.random() //document.write(url); xmlHttpallskill.onreadystatechange=stateChangedal...
JavaScript
var xmlHttprole var nam function Showroleinfo(name) { xmlHttprole=GetXmlHttpObject() if (xmlHttprole==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getroleinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttprole.onreadystatec...
JavaScript
var xmlHttpsyn; var xmlHttpsynsubmit; var nam; var syn=''; var flag1=0; var flag2=0; var flag3=0; var flag4=0; var flag5=0; function SynAdd1() { if(document.getElementById("Bag1syid").textContent!='0'&&flag1==0) { add=document.getElementById("Bag1syid").textContent; add+=','; syn+=add; document.getEle...
JavaScript
var reg1 var att function Showplayer(atti) { reg1=GetXmlHttpObject1() if (reg1==null) { alert ("Browser does not support HTTP Request") return } att=atti var url1="Ajax/PlayerAttend.php" url1=url1+"?att="+atti url1=url1+"&sid="+Math.random() //document.write(url); reg1.onreadystatechange=stateCh...
JavaScript
var xmlHttpres var nam function Showresinfo(name) { xmlHttpres=GetXmlHttpObject() if (xmlHttpres==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getresinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttpres.onreadystatechange=...
JavaScript
var xmlHttpsearch var nam function Showsearch(name) { xmlHttpsearch=GetXmlHttpObject() if (xmlHttpsearch==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Search.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttpsearch.onreadystatechange=stateCha...
JavaScript
var xmlHttpinfo var at function Showinfo(atti) { xmlHttpinfo=GetXmlHttpObject() if (xmlHttpinfo==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getinformation.php" url=url+"?a="+atti url=url+"&sid="+Math.random() //document.write(url); xmlHttpinfo.onreadystatechange...
JavaScript
$(document).ready(function(){ $(".flip").click(function(){ $(".panel").slideToggle("slow"); }); }); $(document).ready(function(){ $("p.box2").hide(); }); $(document).ready(function(){ $("#box").mouseenter(function(){ $("p.box2").show("slow"); }); }); $(document).ready(function(){ $("...
JavaScript
$(document).ready(function(){ $("img.small").mouseover(function(){ $("img.small").css("height","80px"); }); }); $(document).ready(function(){ $("img.small").mouseout(function(){ $("img.small").css("height","50px"); }); });
JavaScript
/*! * jQuery blockUI plugin * Version 2.53 (01-NOV-2012) * @requires jQuery v1.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2012 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.ht...
JavaScript
/** * impress.js * * impress.js is a presentation tool based on the power of CSS3 transforms and transitions * in modern browsers and inspired by the idea behind prezi.com. * * * Copyright 2011-2012 Bartek Szopka (@bartaz) * * Released under the MIT and GPL Licenses. * * --------------------------...
JavaScript
$(document).ready(function(){ $(".flip").click(function(){ $(".panel").slideToggle("slow"); }); }); $(document).ready(function(){ $("p.box2").hide(); }); $(document).ready(function(){ $("#box").mouseenter(function(){ $("p.box2").show("slow"); }); }); $(document).ready(function(){ $("...
JavaScript
$(document).ready(function(){ $("img.small").mouseover(function(){ $("img.small").css("height","80px"); }); }); $(document).ready(function(){ $("img.small").mouseout(function(){ $("img.small").css("height","50px"); }); });
JavaScript
/*! * jQuery blockUI plugin * Version 2.53 (01-NOV-2012) * @requires jQuery v1.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2012 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.ht...
JavaScript
/** * impress.js * * impress.js is a presentation tool based on the power of CSS3 transforms and transitions * in modern browsers and inspired by the idea behind prezi.com. * * * Copyright 2011-2012 Bartek Szopka (@bartaz) * * Released under the MIT and GPL Licenses. * * --------------------------...
JavaScript
var xmlHttp var at function Showchat(name,str,atti) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="Chat/GetChat.php" url=url+"?q="+str url=url+"&n="+name url=url+"&a="+atti url=url+"&sid="+Math.random() //document.write(url); ...
JavaScript
var xmlHttprole var nam function Showroleinfo(name) { xmlHttprole=GetXmlHttpObject() if (xmlHttprole==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getroleinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttprole.onreadystatec...
JavaScript
var reg1 var att function Showplayer(atti) { reg1=GetXmlHttpObject1() if (reg1==null) { alert ("Browser does not support HTTP Request") return } att=atti var url1="Ajax/PlayerAttend.php" url1=url1+"?att="+atti url1=url1+"&sid="+Math.random() //document.write(url); reg1.onreadystatechange=stateCh...
JavaScript
var xmlHttpres var nam function Showresinfo(name) { xmlHttpres=GetXmlHttpObject() if (xmlHttpres==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getresinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttpres.onreadystatechange=...
JavaScript
var xmlHttpinfo var at function Showinfo(atti) { xmlHttpinfo=GetXmlHttpObject() if (xmlHttpinfo==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getinformation.php" url=url+"?a="+atti url=url+"&sid="+Math.random() //document.write(url); xmlHttpinfo.onreadystatechange...
JavaScript
$(document).ready(function(){ $(".flip").click(function(){ $(".panel").slideToggle("slow"); }); }); $(document).ready(function(){ $("p.box2").hide(); }); $(document).ready(function(){ $("#box").mouseenter(function(){ $("p.box2").show("slow"); }); }); $(document).ready(function(){ $("...
JavaScript
$(document).ready(function(){ $("img.small").mouseover(function(){ $("img.small").css("height","80px"); }); }); $(document).ready(function(){ $("img.small").mouseout(function(){ $("img.small").css("height","50px"); }); });
JavaScript
/*! * jQuery blockUI plugin * Version 2.53 (01-NOV-2012) * @requires jQuery v1.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2012 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.ht...
JavaScript
/** * impress.js * * impress.js is a presentation tool based on the power of CSS3 transforms and transitions * in modern browsers and inspired by the idea behind prezi.com. * * * Copyright 2011-2012 Bartek Szopka (@bartaz) * * Released under the MIT and GPL Licenses. * * --------------------------...
JavaScript
var xmlHttp var at function Showchat(name,str,atti) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="Chat/GetChat.php" url=url+"?q="+str url=url+"&n="+name url=url+"&a="+atti url=url+"&sid="+Math.random() //document.write(url); ...
JavaScript
var xmlHttpskill var nam function Showskills(name) { xmlHttpskill=GetXmlHttpObject() if (xmlHttpskill==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/GetSkills.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttpskill.onreadystatec...
JavaScript
function DeHeHS() { document.getElementById("DeHeH").style.display='inline' } function DeHeHH() { document.getElementById("DeHeH").style.display='none' } function DeArHS() { document.getElementById("DeArH").style.display='inline' } function DeArHH() { document.getElementById("DeArH...
JavaScript
function Showlocation(lo) { switch(lo){ case 1: allhide() alllocationnone(); document.getElementById("L1").style.display='none'; document.getElementById("L1H").style.display='inline'; break; case 2: allhide() alllocationnone(); document.getElementById("L2").style.display='none'; ...
JavaScript
var xmlHttprole var nam function Showroleinfo(name) { xmlHttprole=GetXmlHttpObject() if (xmlHttprole==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getroleinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttprole.onreadystatec...
JavaScript
var xmlHttpsyn; var xmlHttpsynsubmit; var nam; var syn=''; var flag1=0; var flag2=0; var flag3=0; var flag4=0; var flag5=0; function SynAdd1() { if(document.getElementById("Bag1syid").textContent!='0'&&flag1==0) { add=document.getElementById("Bag1syid").textContent; add+=','; syn+=add; document.getEle...
JavaScript
var reg1 var att function Showplayer(atti) { reg1=GetXmlHttpObject1() if (reg1==null) { alert ("Browser does not support HTTP Request") return } att=atti var url1="Ajax/PlayerAttend.php" url1=url1+"?att="+atti url1=url1+"&sid="+Math.random() //document.write(url); reg1.onreadystatechange=stateCh...
JavaScript
var xmlHttpres var nam function Showresinfo(name) { xmlHttpres=GetXmlHttpObject() if (xmlHttpres==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getresinfo.php" url=url+"?name="+name url=url+"&sid="+Math.random() //document.write(url); xmlHttpres.onreadystatechange=...
JavaScript
var xmlHttpinfo var at function Showinfo(atti) { xmlHttpinfo=GetXmlHttpObject() if (xmlHttpinfo==null) { alert ("Browser does not support HTTP Request") return } var url="Ajax/Getinformation.php" url=url+"?a="+atti url=url+"&sid="+Math.random() //document.write(url); xmlHttpinfo.onreadystatechange...
JavaScript
var textFrame = null; var topFrame = null; function beginUsingTextFrame() { textFrame = $("#divText"); topFrame = $("#divFrame"); clearFramePicture(); setFrameHeight(); disableMainScrollbar(); $(window).resize(function () { setFrameHeight(); }); window.scrollToE...
JavaScript
/* jjmenu - context menu jquery plugin * http://jursza.net/dev/jjmenu/ * * @author Jacek Jursza ([email protected]) * @version 1.1.2 * @date 2010-08-28 * @category jQuery plugin * @copyright (c) 2009 Jacek Jursza (http://jursza.net/) * @licence MIT [http://www.opensource.org/licenses/mit-license.php]...
JavaScript
var webPlayer = false; function scrollToEnd() { $('html, body').animate({ scrollTop: $(document).height() }, 0); } function sendCommand(text) { UIEvent("RunCommand", text); } function ASLEvent(event, parameter) { UIEvent("ASLEvent", event + ";" + parameter); } function goUrl(href) { ...
JavaScript
var _currentDiv = null; function addText(text) { if (_currentDiv == null) { createNewDiv("left"); } _currentDiv.append(text); scrollToEnd(); } var _divCount = 0; function createNewDiv(alignment) { _divCount++; $("<div/>", { id: "divOutputAlign" + _divCount, ...
JavaScript
/* jjmenu - context menu jquery plugin * http://jursza.net/dev/jjmenu/ * * @author Jacek Jursza ([email protected]) * @version 1.1.2 * @date 2010-08-28 * @category jQuery plugin * @copyright (c) 2009 Jacek Jursza (http://jursza.net/) * @licence MIT [http://www.opensource.org/licenses/mit-license.php]...
JavaScript
function setObject(src, left, top, className, alias) { var objAppended = $("<img src='/img/" + className + "s/" + src + ".png' id='" + src + "' tittle='" + alias + "' class='" + className + "' style='left:" + left + "%;top:" + top + "%'/>").appendTo($("#gameBorder")); $(objAppended).bind("click", function ()...
JavaScript
function showDialog(caption, text) { $("#dialog").dialog({ title: caption, modal: true, position: ["center", "center"], buttons: { "Закрыть": function () { $(this).dialog("close"); } } }); $("#dialog").text(''); ...
JavaScript
var _currentDiv = null; function addText(text) { if (_currentDiv == null) { createNewDiv("left"); } _currentDiv.append(text); scrollToEnd(); } var _divCount = 0; function createNewDiv(alignment) { _divCount++; $("<div/>", { id: "divOutputAlign" + _divCount, ...
JavaScript
function test(level) { var div = "<div>fff</div>"; addText(div); }
JavaScript
var $_GET = {}; var selectSizeWithoutStatus = 8; var selectSizeWithStatus = 6; var numCommands = 0; var thisCommand = 0; var commandsList = new Array(); var fluid = false; var webPlayer = true; var tmrTick = null; var tickCount = 0; var sendNextGameTickerAfter = 0; var inventoryVerbs = null; var placesObje...
JavaScript
function inputKeydown(id, event) { if (keyPressCode(event) == 13) { var text = (id == "mind1") ? $("#mind1").val() : $("#mind2").val(); $("#mind1").val(""); $("#mind2").val(""); addNewRow(); ASLEvent("ProcessInput", id + ";" + text); // returning false here to ...
JavaScript
$(document).ready(function() { ItemDetails.init(); }); ItemDetails = {}; ItemDetails.init = function() { //Contact Seller $('#itemDetailsLinkContactSeller').bind('click', function() { $("#itemDetailsContatSellerDialog").dialog({ resizable : false, modal : true, minWidth: 500, draggable : false, bu...
JavaScript
$(document).ready(function() { UploadItem.init(); }); UploadItem = {}; UploadItem.acceptFileTypes = new Array('jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG'); UploadItem.init = function() { $('#itemUploadFileInput').change(function(e) { var fileInput = $(this); var file = $(this).val(); if (file) { var fileT...
JavaScript
$(document).ready(function() { UserMessages.init(); }); UserMessages = {}; UserMessages.init = function() { $("#userMessagesTabs").tabs(); $('.userMessagesTable').bind('click', function(e) { if($(e.target).prop("tagName") != 'A' && $(e.target).prop("tagName") != 'a'){ var conversationContainer = $(this).clos...
JavaScript
$(document).ready(function() { EditItem.init(); }); EditItem = {}; EditItem.init = function() { $('#itemEditSubmitButton').click(function(e){ $('#itemEditForm').submit(); return false; }); $('#itemEditBackButton').click(function(e){ Util.redirect($('#itemEditBackButton').attr('link')); return false; })...
JavaScript
$(document).ready(function() { ItemDetails.init(); }); ItemDetails = {}; ItemDetails.init = function() { //Contact Seller $('#itemDetailsLinkContactSeller').bind('click', function() { $("#itemDetailsContatSellerDialog").dialog({ resizable : false, modal : true, minWidth: 500, draggable : false, bu...
JavaScript
$(document).ready(function() { LanguageChanger.init(); Tooltip.init(); SearchBar.init(); }); /** * SearchBar */ SearchBar = {}; SearchBar.init = function() { $('#searchInput').keypress(function(e) { if(e.which == 13) { $(this).blur(); SearchBar.submitSearch(); } }); ...
JavaScript
$(document).ready(function() { AddItem.init(); }); AddItem = {}; AddItem.acceptFileTypes = new Array('jpg', 'jpeg', 'png'); AddItem.init = function() { $('#itemAddSubmitButton').click(function(e){ $('#itemAddForm').submit(); }); }
JavaScript
$(document).ready(function() { Search.init(); }); Search = {}; Search.selectSum = 1; Search.init = function() { var sortLink = $("#sortAddLink"); Search.selectSum = $('.searchSortOption').length-1; if(Search.selectSum > 1) Search.addDeleteButton(); $('#newSearchFieldLink').click(function(e){ if(Search.s...
JavaScript
$(document).ready(function() { UploadUser.init(); }); UploadUser = {}; UploadUser.acceptFileTypes = new Array('jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG'); UploadUser.init = function() { $('#userUploadFileInput').change(function(e) { var fileInput = $(this); var file = $(this).val(); if (file) { var fileT...
JavaScript
$(document).ready(function() { UserProfile.init(); }); UserProfile = {}; UserProfile.init = function() { //Contact Seller $('#userProfileLinkContact').bind('click', function() { $('#userProfileContactDialog').dialog({ resizable : false, modal : true, minWidth: 500, draggable : false, buttons : [ {...
JavaScript
function BcClient(socket) { this.socket = socket; // todo rename to serverInterface? this.users = new TList().bindSource(socket, 'users'); this.currentUser = new User(); // do not replace this.users.bindSlave(this.currentUser); this.premades = new TList().bindSource(socket, 'premades'); this....
JavaScript
TankController = function TankController(tank) { this.tank = tank; var controller = this; $(window.document).keydown(this.controlEvent.bind(this)); $(window.document).keyup (this.controlEvent.bind(this)); }; TankController.prototype.controlEvent = function(e) { if ($('.CodeMirror textarea').get(0)...
JavaScript
// there are all existing global vars below var bcClient, uiManager; var codeMirror = null; // todo better place? $(function() { new WidgetLangSelector(); if (typeof WebSocket == 'undefined' && typeof MozWebSocket == 'undefined') { $('.ui-block').hide().filter('#nowebsocket').show(); } else { ...
JavaScript
isArray = Array.isArray; ServerUser = function ServerUser(course) { User.call(this, arguments); this.collections = {}; this.updateCollector = {}; this.messages = 0; this.countMessageFrom = Date.now(); this.setCurrentCourse(course); }; ServerUser.maxMessages = 10; // per minute ServerUser._eve...
JavaScript
TMessageList = function TMessageList() { TList.apply(this, arguments); }; TMessageList.prototype = new TList(); TMessageList.prototype.constructor = TMessageList; TMessageList.prototype.say = function(message) { this.add(message); for (var i in this.items) { if (this.items[i].time + 5 * 60 * 1000...
JavaScript
TPremadeList = function TPremadeList() { TList.apply(this, arguments); }; TPremadeList.prototype = new TList(); TPremadeList.prototype.constructor = TPremadeList; TPremadeList.prototype.join = function(event, user) { var gameName = event.name && event.name.substr(0,20); if (!user.premade) { var p...
JavaScript
var http = require("http"), url = require("url"), path = require("path"), fs = require("fs"); // todo globals registry = {}; require('../common/event'); require('../common/list'); require('../common/game'); require('../common/premade'); require('../server/premadelist'); require('../com...
JavaScript
ExerciseList = function ExerciseList() { TList.apply(this, arguments); }; ExerciseList.prototype = new TList(); ExerciseList.prototype.constructor = ExerciseList;
JavaScript
CoursesList = function CoursesList() { TList.apply(this, arguments); this.add(new CoursePascalBasics()); this.add(new CourseAlgoritms()); }; CoursesList.prototype = new TList(); CoursesList.prototype.constructor = CoursesList;
JavaScript
Course = function Course(id, name) { this.id = id; this.name = name; // this.execises = new TList(); }; Course.prototype.serialize = function() { return [ serializeTypeMatches[this.constructor.name], // 0 this.id, // 1 this.name // 2 ]; // z is constant }; Course.protot...
JavaScript
Exercise = function Exercise(name, level) { this.name = name; this.level = level; }; Exercise.prototype.serialize = function() { return [ serializeTypeMatches[this.constructor.name], // 0 this.id, // 1 this.name, // 2 this.level // 3 ]; // z is constant }; Exercise...
JavaScript
if (!window.availableLangs['/src/edu/course-pascal-basics/ex1']) { window.availableLangs['/src/edu/course-pascal-basics/ex1'] = {}; } window.availableLangs['/src/edu/course-pascal-basics/ex1']['en'] = { 'exercise-help-content': '<h1>Exercise 1</h1>\ \ <p>In this exercise you goal is to write a program which wi...
JavaScript
if (!window.availableLangs['/src/edu/course-pascal-basics/ex2']) { window.availableLangs['/src/edu/course-pascal-basics/ex2'] = {}; } window.availableLangs['/src/edu/course-pascal-basics/ex2']['ru'] = { 'exercise-help-content': '<h1>Задача</h1>\ \ <p>Во втором упражнении вам необходимо проехать через две контр...
JavaScript
if (!window.availableLangs['/src/edu/course-pascal-basics/ex3']) { window.availableLangs['/src/edu/course-pascal-basics/ex3'] = {}; } window.availableLangs['/src/edu/course-pascal-basics/ex3']['ru'] = { 'exercise-help-content': '<h1>Задача</h1>\ \ <p>В третьем упражнении цель появляется в одном из двух мест. Н...
JavaScript
if (!window.availableLangs['/src/edu/course-pascal-basics/ex4']) { window.availableLangs['/src/edu/course-pascal-basics/ex4'] = {}; } window.availableLangs['/src/edu/course-pascal-basics/ex4']['ru'] = { 'exercise-help-content': '<h1>Задача</h1>\ \ <p>В четвертом упражнении вам нужно объехать 3 цели. Но, как вы...
JavaScript
if (!window.availableLangs['/src/edu/course-pascal-basics/ex1']) { window.availableLangs['/src/edu/course-pascal-basics/ex1'] = {}; } window.availableLangs['/src/edu/course-pascal-basics/ex1']['ru'] = { 'exercise-help-content': '<h1>Задача</h1>\ \ <p>В первом упражнении вам необходимо написать программу управл...
JavaScript
BotEmitter = function BotEmitter(x, y) { this.x = x; this.y = y; };
JavaScript
(function(){ window.images = {}; var sprites = [ 'img/tank1-down-s1.png' , 'img/tank1-down-s2.png' , 'img/tank1-up-s1.png' , 'img/tank1-up-s2.png' , 'img/tank1-right-s1.png' , 'img/tank1-right-s2.png' , 'img/tank1-left-s1.png' , 'img/tank1-left-s2.png' , ...
JavaScript
Goal = function Goal(clan) { this.clan = clan; this.status = 0; // 0 - active, 1 - done }; Eventable(Goal.prototype); Goal.prototype.check = function() { throw new Error('subclass responsibility'); }; Goal.prototype.reset = function(field) { this.status = 0; }; GoalCheckPoint = function GoalCheckPo...
JavaScript
/** * drawable * coordinates */ Bonus = function Bonus(x, y) { AbstractGameObject.call(this, 16, 16); this.x = x; this.y = y; this.z = 2; }; Bonus.prototype = new AbstractGameObject(); Bonus.prototype.constructor = Bonus; Eventable(Bonus.prototype); Bonus.prototype.serialize = function() { re...
JavaScript
AbstractGameObject = function AbstractGameObject(hw, hh) { // for intersection (when speedX > hw) this.hw = this.boundX = hw; //for intersection (when speedY > hh) this.hh = this.boundY = hh; this.speedX; // set only through setSpeedX() this.speedY; // set only through setSpeedY() this.img = [];...
JavaScript
Delimiter = function Delimiter(x, y, hw, hh) { AbstractGameObject.call(this, hw, hh); this.x = x; this.y = y; this.z = 1; this.hw = hw; // half width this.hh = hh; // half height this.img[0] = 'img/black.png'; }; Delimiter.prototype = new AbstractGameObject(); Delimiter.prototype.construct...
JavaScript
/** * drawable * coordinates */ Water = function Water(x, y) { AbstractGameObject.call(this, 8, 8); this.x = x; this.y = y; this.z = 1; this.img[0] = 'img/water1.png'; }; Water.prototype = new AbstractGameObject(); Water.prototype.constructor = Water; Eventable(Water.prototype); Water.prototy...
JavaScript
/** * drawable * coordinates */ Bullet = function Bullet(speedX, speedY) { AbstractGameObject.call(this, 4, 4); this.x = 0; this.y = 0; this.z = 1; // bullet is rectangle step of bullet this.setSpeedX(speedX); this.setSpeedY(speedY); this.finalX = 0; // for proper hit animation (todo...
JavaScript
/** * drawable * coordinates * * interface: * fire() * turn(direction) * startMove() * stopMove() * * В этом классе перемешанны: * - сама сущность * - отрисовка (setDirectionImage(), imgBase, clanN, trackStep, blink) * - пуле устанавливаются координаты напрямую, а для этого надо знать, * ч...
JavaScript
/** * drawable * coordinates */ Trees = function Trees(x, y) { AbstractGameObject.call(this, 8, 8); this.x = x; this.y = y; this.z = 2; this.img[0] = 'img/trees.png'; }; Trees.prototype = new AbstractGameObject(); Trees.prototype.constructor = Trees; Eventable(Trees.prototype); Trees.prototyp...
JavaScript
Base = function Base(x, y) { AbstractGameObject.call(this, 16, 16); this.x = x; this.y = y; this.img[0] = 'img/base.png'; this.shootDown = false; }; Base.prototype = new AbstractGameObject(); Base.prototype.constructor = Base; Base.prototype.baseEdge = { 1: [ {x: 11, y: 23} , {x: 11, ...
JavaScript
OnFieldAnimation = function OnFieldAnimation(step, hw, hh) { AbstractGameObject.call(this, hw, hh); this.firstStep = step; }; OnFieldAnimation.prototype = new AbstractGameObject(); OnFieldAnimation.prototype.constructor = OnFieldAnimation; BulletHitAnimation = function BulletHitAnimation(step, x, y) { On...
JavaScript
TankBot = function TankBot(x, y, bonus) { Tank.apply(this, arguments); // call parent constructor this.setSpeedY(this.speed); this.moveOn = true; this.bonus = bonus; this.clan = null; this.armoredTimer = 0; this.fireTimer = 0; // do not fire too fast }; TankBot.prototype = new Tank(); Tank...
JavaScript
/** * drawable * coordinates */ Wall = function Wall(x, y, hw, hh) { AbstractGameObject.call(this, hw ? hw : 4, hh ? hh : 4); this.x = x; this.y = y; this.z = 1; this.img[0] = 'img/brick-wall.png'; }; Wall.prototype = new AbstractGameObject(); Wall.prototype.constructor = Wall; Eventable(Wall....
JavaScript
/** * drawable * coordinates */ Checkpoint = function Checkpoint(x, y) { AbstractGameObject.call(this, 16, 16); this.x = x; this.y = y; this.z = 0; this.img[0] = 'img/checkpoint.png'; }; Checkpoint.prototype = new AbstractGameObject(); Checkpoint.prototype.constructor = Checkpoint; Eventable(C...
JavaScript
/** * drawable * coordinates */ Ice = function Ice(x, y) { AbstractGameObject.call(this, 8, 8); this.x = x; this.y = y; this.z = 0; this.img[0] = 'img/ice.png'; }; Ice.prototype = new AbstractGameObject(); Ice.prototype.constructor = Ice; Eventable(Ice.prototype); Ice.prototype.serialize = fu...
JavaScript
Clan = function Clan(n, defaultArmoredTimer) { this.capacity = 2; // max users this.n = n; this.defaultArmoredTimer = defaultArmoredTimer; this.timer = 0; this.enemiesClan = null; this.users = []; this.goals = new TList(); this.base = new Base(); this.base.clan = this; this.tank...
JavaScript
Field = function Field(width, height) { this.width = width; this.height = height; this.objects = null; this.clear(); this.setMaxListeners(100); // @todo }; Eventable(Field.prototype); Field.autoIncrement = 1; // todo eliminate? Field.prototype.clear = function() { this.objects = n...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water module.exports.getMap = function() { return [ [0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0], [0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,2,2,3,3,0,0,0,0], [1,1,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,2,2,2,2,0,0,0,1,1], [1,1,0,0,0,0,0,0...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,2,2,3,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,2,2,3,3...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water // 5 - ice module.exports.getMap = function() { return [ [0,0,0,0,2,2,0,0,1,1,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,1,1,0,0,1,1,3,3,0,0,1,1,1,1,1,1,1,1,0,0,0,0], [0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water // 5 - ice module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water // 5 - ice module.exports.getMap = function() { return [ [0,0,0,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,4,4,3,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0], [2,2,...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0], [0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0], [0,0,1,1,1,1,1,1...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0,0], [2,2,0,0,1,1,0,0...
JavaScript
// 1 - wall // 2 - steel wall // 3 - trees // 4 - water module.exports.getMap = function() { return [ [0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,3,3,3,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,3,3,3,0,0,0,0,0,0], [0,0,1,0,0,2,0,0,1,0,0,0,0,0,0,0,0,1,3,3,1,0,0,1,3,3], [0,0,1,0,0,2,0,0...
JavaScript