Skip to content

Commit

Permalink
added audio, credits
Browse files Browse the repository at this point in the history
  • Loading branch information
Armen138 committed Feb 27, 2013
1 parent 57f2e9e commit 72e7a96
Show file tree
Hide file tree
Showing 25 changed files with 227 additions and 67 deletions.
Binary file added audio/enemyshoot.wav
Binary file not shown.
Binary file added audio/error.wav
Binary file not shown.
Binary file added audio/explosion.wav
Binary file not shown.
Binary file added audio/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added audio/pickup.wav
Binary file not shown.
Binary file added audio/power.wav
Binary file not shown.
Binary file added audio/rapidfire.wav
Binary file not shown.
Binary file added audio/rocket.wav
Binary file not shown.
Binary file added audio/rocket2.wav
Binary file not shown.
Binary file added audio/select.wav
Binary file not shown.
Binary file added audio/shoot.wav
Binary file not shown.
Binary file added audio/shoot2.wav
Binary file not shown.
Binary file added audio/shoot3.wav
Binary file not shown.
Binary file added audio/strange.ogg
Binary file not shown.
Binary file added images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/spacedefender800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 48 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,57 @@
overflow: hidden;
height: 100%;
}
.container {
width: 800px;
height: 600px;
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
}
.credits {
display: none;
position: absolute;
width: 800px;
height: 600px;
top: 0px;
background-color: white;
left: 0px;
padding: 50px;
font-size: 30px;
font-family: Arial, sans-serif;
text-align: center;
text-shadow: 0 2px 2px black;
}
.credits a {
text-decoration: none;
color: #52dcff;
}
.credits a:hover {
color: #007c9b;
}
</style>
<script data-main="js/main" src="js/require.js"></script>
</head>
<body>
<canvas>One does not simply play games without a canvas-capable browser</canvas>
<div class="container">
<canvas>One does not simply play games without a canvas-capable browser</canvas>
<div class="credits" id="credits">
Programming: <br/>
<a href="http://armen138.com">Armen138</a><br/>
Particle System: <br/>
<a href="https://github.com/Raveler/particlus">Karel Crombecq</a><br/>
Space Ships: <br/>
<a href="http://opengameart.org/users/skorpio">Skorpio</a><br/>
<a href="http://opengameart.org/users/wuhu">Wuhu</a><br/>
<a href="http://opengameart.org/users/ghosa">Ghosa</a><br/>
Icons:<br/>
<a href="http://game-icons.net">Game-Icons.net</a><br/>
Music: <br/>
<a href="https://soundcloud.com/toastmedia/verystrangespace">ToastMedia</a>
<hr>
<a href="#" onclick="document.getElementById('credits').style.display = 'none';">back</a>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion js/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define(function() {
case "shield":
e = {"emitterStartLocation":{"x":0,"y":0},"emitterStopLocation":{"x":0,"y":0},"systemLifeSpan":0,"particleSpawnArea":{"x":0,"y":0},"maxParticles":300,"averageLifeSpan":0.3,"lifeSpanVariance":0.1,"startColor":{"red":63,"green":167,"blue":255,"alpha":1},"stopColor":{"red":0,"green":0,"blue":0,"alpha":1},"averageVelocity":{"horizontal":0,"vertical":0},"velocityVariance":{"x":0.3,"y":0.3},"minParticleSize":2,"maxParticleSize":4,"particleFadeTime":0.6,"globalCompositeOperation":"lighter","renderType":"spriteSheet","type":"relative"};
break;
case "powerup":
case "powerup":
e = {"emitterStartLocation":{"x":0,"y":0},"emitterStopLocation":{"x":0,"y":0},"systemLifeSpan":1,"particleSpawnArea":{"x":32,"y":32},"maxParticles":100,"averageLifeSpan":0.4,"lifeSpanVariance":0.1,"startColor":{"red":255,"green":167,"blue":63,"alpha":1},"stopColor":{"red":13,"green":141,"blue":0,"alpha":1},"averageVelocity":{"horizontal":0,"vertical":0},"velocityVariance":{"x":2,"y":2},"minParticleSize":5,"maxParticleSize":10,"particleFadeTime":0.5,"globalCompositeOperation":"lighter","renderType":"image","image":image || "images/star.png","type":"absolute"};
break;
case "explosion":
Expand Down
3 changes: 2 additions & 1 deletion js/enemy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(["canvas", "events"], function(Canvas, events) {
var enemy = function(image, position, weapon, bullets, tile, options) {
var enemy = function(image, position, weapon, bullets, tile, options, sound) {
var start = Date.now();
var speed = options.speed || 0.2;
var dead = false;
Expand Down Expand Up @@ -46,6 +46,7 @@ define(["canvas", "events"], function(Canvas, events) {
if(Date.now() - lastShot > weapon.loadTime) {
lastShot = Date.now();
bullets.push(weapon.ammo({X: position.X, Y: position.Y}));
sound.play();
}
lastFrame = now;
if(position.Y > Canvas.height || dead) {
Expand Down
20 changes: 10 additions & 10 deletions js/enemyTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ define(["bullet", "canvas"], function(Bullet, Canvas) {
return Bullet(position, [ship], {"south": true, damage: 3});
}
},
doubleBarrel: {
doubleBarrel: {
loadTime: 1000,
ammo: function(position, enemies) {
return Bullet(position, [ship], { "south": true, "double" : true, damage: 6 });
}
}
},
rocket: {
rocket: {
loadTime: 2000,
ammo: function(position, enemies) {
return Bullet(position, [ship], { "south": true, damage: 8, rocket: true });
}
}
}
}
};
var ships = {
"pirate": {
Expand All @@ -41,7 +41,7 @@ define(["bullet", "canvas"], function(Bullet, Canvas) {
weapon: weapons.doubleBarrel,
options: {}
},
"zipper": {
"zipper": {
sprite: {
width: 31,
height: 33,
Expand All @@ -56,14 +56,14 @@ define(["bullet", "canvas"], function(Bullet, Canvas) {
if(!position.direction) {
position.direction = 1;
}
position.Y = startPosition.Y + ((Date.now() - start) * speed);
position.Y = startPosition.Y + ((Date.now() - start) * speed);
position.X += delta * speed * position.direction;
if(position.X > Canvas.width - 33) {
position.direction = -1;
}
if(position.X < 33) {
position.direction = 1;
}
}
}
}
},
Expand All @@ -77,11 +77,11 @@ define(["bullet", "canvas"], function(Bullet, Canvas) {
weapon: weapons.gun,
options: {
movePattern: function(startPosition, position, start, speed) {
position.Y = startPosition.Y + ((Date.now() - start) * speed);
position.Y = startPosition.Y + ((Date.now() - start) * speed);
position.X = startPosition.X + (100 * Math.cos(((Date.now() - start) / 500)));
}
}
},
},
"tube": {
sprite: {
width: 45,
Expand Down
Loading

0 comments on commit 72e7a96

Please sign in to comment.