code
stringlengths
1
2.08M
language
stringclasses
1 value
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
define('ace/mode/scala', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/scala_highlight_rules'], function(require, exports, module) { var oop = require("../lib/oop"); var JavaScriptMode = require("./javascript").Mode; var Tokenizer = require("../tokenizer").Tokenize...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
define('ace/mode/csharp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/csharp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { var oop = require("../lib/oop"); var TextMode...
JavaScript
"no use strict"; var console = { log: function(msg) { postMessage({type: "log", data: msg}); } }; var window = { console: console }; var normalizeModule = function(parentId, moduleName) { // normalize plugin requires if (moduleName.indexOf("!") !== -1) { var chunks = moduleName.spl...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) { var oop = require("../lib/oop"); var JavaScriptMode = require("./javascript").Mode; var Tokenizer = require("../tokenizer").Tokeni...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * The Original Code is Ajax.org Code Editor (ACE). * * Contributor(s): * Jonathan Camile <jonathan.camile AT gmail DOT com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
define('ace/mode/golang', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/golang_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { var oop = require("../lib/oop"); var T...
JavaScript
define('ace/mode/haxe', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haxe_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = r...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Softw...
JavaScript
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * ...
JavaScript
/* Wire up the bodyload handler (set here rather than in the body element in order to avoid a HTML Help viewer bug with printing multiple topics */ window.onload = hsBodyLoad; /* Set body initially hidden unless we are printing */ document.write("<style media='screen'>div#hsbody{display: none}</style>"); /...
JavaScript
//** Simple Controls Gallery- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com //** Dec 7th, 08'- Script created //** February 6th, 09'- Updated to v 1.3: //1) Adds Description Panel to optionally show a textual description for each slide //2) In Auto Play mode, you can now set the number of cycles b...
JavaScript
/* * Copyright 2010 akquinet * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writi...
JavaScript
//Carga el enlace 'url' en el selector 'donde' function enlace(donde,url) { $(donde).fadeOut(500,function() { $(this).load(url,function() { $(this).fadeIn(500); //cambiar url a traves de javascript window.history.pushState(donde, null, url); }); }); }
JavaScript
function addClearOnClick(tag, target) { tag.onclick = function() { target.value = ''; } } function addViewOnClick(tag, target) { var href; tag.onclick = function() { href = target.value; if(href) window.open(href, 'sfMediaBrowserViewFile', ''); } } HTMLElement.prototype.getElementByTagNam...
JavaScript
/** * sfMediaBrowserWindowManager manages popup window opening and callbacks. * It also managed tinyMCE and should manage any other js based plugin extension. * * @WARNING : tinymceCallback url is hardcoded !!!!!! * @author: Vincent Agnano <vincent.agnano@particul.es> */ sfMediaBrowserWindowManager = { browser...
JavaScript
/** * This file is used for sfMediaBrowser/list template */ window.onload = function() { var tags = document.getElementById('sf_media_browser_list').getElementsByTagName('a'); var tag; for(var i=0; i<tags.length; ++i) { tag = tags[i]; if(tag.getAttribute('class') && tag.getAttribute('class').indexOf('de...
JavaScript
window.onload = function() { sfMediaBrowserFilePicker.findFiles('sf_media_browser_list'); }
JavaScript
/* * This file requires jquery , jquery-ui-draggable, jquery-ui-droppable * It manages interactions in the sfMediaBrowser/list template */ /** * Throws an error if a required variable is undefined or if it is empty * @param variable name of the variable to check * @param message error message to throw * @return ...
JavaScript
/** * sfMediaBrowserFilePicker is a class that enables picking * a file in a "select" popup context in an unobstrusive way. * It exists as such for no dependency with any JS framework. */ function sfMediaBrowserFilePicker(){} sfMediaBrowserFilePicker = { findFiles: function(container_id) { if(container_id == ...
JavaScript
/* * Autocomplete - jQuery plugin 1.1pre * * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete...
JavaScript
var sfDoubleList = { init: function(id, className) { form = sfDoubleList.get_current_form(id); callback = function() { sfDoubleList.submit(form, className) }; if (form.addEventListener) { form.addEventListener("submit", callback, false); } else if (form.attachEvent) { var r...
JavaScript
function addClearOnClick(tag, target) { tag.onclick = function() { target.value = ''; } } function addViewOnClick(tag, target) { var href; tag.onclick = function() { href = target.value; if(href) window.open(href, 'sfMediaBrowserViewFile', ''); } } HTMLElement.prototype.getElementByTagNam...
JavaScript
/** * sfMediaBrowserWindowManager manages popup window opening and callbacks. * It also managed tinyMCE and should manage any other js based plugin extension. * * @WARNING : tinymceCallback url is hardcoded !!!!!! * @author: Vincent Agnano <vincent.agnano@particul.es> */ sfMediaBrowserWindowManager = { browser...
JavaScript
/** * This file is used for sfMediaBrowser/list template */ window.onload = function() { var tags = document.getElementById('sf_media_browser_list').getElementsByTagName('a'); var tag; for(var i=0; i<tags.length; ++i) { tag = tags[i]; if(tag.getAttribute('class') && tag.getAttribute('class').indexOf('de...
JavaScript
window.onload = function() { sfMediaBrowserFilePicker.findFiles('sf_media_browser_list'); }
JavaScript
/* * This file requires jquery , jquery-ui-draggable, jquery-ui-droppable * It manages interactions in the sfMediaBrowser/list template */ /** * Throws an error if a required variable is undefined or if it is empty * @param variable name of the variable to check * @param message error message to throw * @return ...
JavaScript
/** * sfMediaBrowserFilePicker is a class that enables picking * a file in a "select" popup context in an unobstrusive way. * It exists as such for no dependency with any JS framework. */ function sfMediaBrowserFilePicker(){} sfMediaBrowserFilePicker = { findFiles: function(container_id) { if(container_id == ...
JavaScript
/** * @license * * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
JavaScript
/** * Creates a new level control. * @constructor * @param {IoMap} iomap the IO map controller. * @param {Array.<string>} levels the levels to create switchers for. */ function LevelControl(iomap, levels) { var that = this; this.iomap_ = iomap; this.el_ = this.initDom_(levels); google.maps.event.addList...
JavaScript
/** * Creates a new Floor. * @constructor * @param {google.maps.Map=} opt_map */ function Floor(opt_map) { /** * @type Array.<google.maps.MVCObject> */ this.overlays_ = []; /** * @type boolean */ this.shown_ = true; if (opt_map) { this.setMap(opt_map); } } /** * @param {google.maps.M...
JavaScript
// Copyright 2011 Google /** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wri...
JavaScript
Wami = function() { } Wami.utils = function() { } Wami.utils.debug = function(message) { if (typeof console == 'undefined') { // No Firebug console, so no logging. } else { console.log(message); } } Wami.utils.gup = function(name) { var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp(regexS);...
JavaScript
///////////////////////////////////////////////////////////////// //// Public WamiApp API //// ///////////////////////////////////////////////////////////////// // Create a new Wami.App object. Note, you should never create more than one // Wami.App object on your page. // // ...
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