- server.zip
- Local.testsettings
- packages
- Fleck.0.8.2.1
- Fleck.0.8.2.1.nupkg
- lib
- net40
- Fleck.dll
- HttpClient.0.6.0
- HttpClient.0.6.0.nupkg
- lib
- 40
- JsonValue.0.6.0
- JsonValue.0.6.0.nupkg
- lib
- 40
- Newtonsoft.Json.4.0.5
- repositories.config
- SpaceShooterServer.sln
- SpaceShooterServer.vsmdi
- SpaceShooterServer
- Test
- bin
- Debug
- Release
- Fleck.dll
- Microsoft.Json.dll
- Microsoft.Json.xml
- Microsoft.Server.Common.dll
- SpaceShooterServer.exe
- Test.dll
- Local.testsettings
- obj
- Debug
- TempPE
- Release
- TempPE
- packages.config
- Properties
- SpaceShooterServer.vsmdi
- Test.csproj
- Test.csproj.user
- TraceAndTestImpact.testsettings
- UnitTests.cs
- TraceAndTestImpact.testsettings
- client.zip
|
var generateAsteroid = function() {
var size = Math.random() * 50 + 25;
var life = 10;
var angle = 0;
var rotation = Math.random() * 6 - 3;
if(Math.random() < 0.5) {
var x = Math.random() * c.canvas.width;
var y = Math.random() < 0.5 ? -size / 2 : c.canvas.height + size / 2;
} else {
var x = Math.random() < 0.5 ? -size / 2 : c.canvas.width + size / 2;
var y = Math.random() * c.canvas.height;
}
var vx = Math.random() * 6 - 3;
var vy = Math.random() * 6 - 3;
asteroids.push(new asteroid(size, life, angle, rotation, x, y, vx, vy));
};
var generateHealthpack = function() {
var x = Math.random() * c.canvas.width;
var y = Math.random() * c.canvas.height;
packs.push(new pack(x, y, spriteSheets.get('health'), function(ship) {
ship.points += 20;
var init = ship.life;
ship.life += 30;
if(ship.life > MAX_LIFE) {
ship.life = MAX_LIFE;
return '+' + (ship.life - init) + 'HP';
}
return '+30HP';
}));
};
var generateAmmopack = function() {
var x = Math.random() * c.canvas.width;
var y = Math.random() * c.canvas.height;
packs.push(new pack(x, y, spriteSheets.get('ammo'), function(ship) {
ship.points += 15;
var init = ship.ammo;
ship.ammo += 20;
if(ship.ammo > MAX_AMMO) {
ship.ammo = MAX_AMMO;
return '+' + (ship.ammo - init) + 'AM';
}
return '+20AM';
}));
};
var generateBombpack = function() {
var x = Math.random() * c.canvas.width;
var y = Math.random() * c.canvas.height;
packs.push(new pack(x, y, spriteSheets.get('bomb'), function(ship) {
ship.points += 25;
var init = ship.bombs;
ship.bombs += 2;
if(ship.bombs > MAX_BOMBS) {
ship.bombs = MAX_BOMBS;
return '+' + (ship.bombs - init) + 'BO';
}
return '+2BO';
}));
};
var generateDrone = function() {
var alpha = 0;
if(Math.random() < 0.5) {
var x = Math.random() * c.canvas.width;
var y = Math.random() < 0.5 ? -3 : c.canvas.height + 3;
alpha = y > 0 ? 0 : 180;
} else {
var x = Math.random() < 0.5 ? -3 : c.canvas.width + 3;
var y = Math.random() * c.canvas.height;
alpha = x > 0 ? 270 : 90;
}
drones.push(new drone(x, y, 3, DRONE_MAX_LIFE, 6, alpha));
};
var generateShield = function() {
var x = Math.random() * c.canvas.width;
var y = Math.random() * c.canvas.height;
packs.push(new pack(x, y, spriteSheets.get('shield'), function(ship) {
ship.points += 15;
ship.shield = MAX_SHIELDS;
ship.decay = SHIELD_DECAY_TIME;
return '+DEF';
}));
};
var hardcoreMode = function() {
for(var i = 100; i--; ) {
generateAsteroid();
generateDrone();
}
};
var ultraHardcoreMode = function() {
for(var i = 20; i--; )
hardcoreMode();
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Florian lives in Munich, Germany. He started his programming career with Perl. After programming C/C++ for some years he discovered his favorite programming language C#. He did work at Siemens as a programmer until he decided to study Physics.
During his studies he worked as an IT consultant for various companies. After graduating with a PhD in theoretical particle Physics he is working as a senior technical consultant in the field of home automation and IoT.
Florian has been giving lectures in C#, HTML5 with CSS3 and JavaScript, software design, and other topics. He is regularly giving talks at user groups, conferences, and companies. He is actively contributing to open-source projects. Florian is the maintainer of AngleSharp, a completely managed browser engine.