Yeah, I had something like -20 when I first played. Now I got +30. So I see what you are saying about the bullets getting faster.
My first JS/HTML5 game (yet another space shooter)
I'm getting owned. It would be cool if you could shoot faster, or move faster lol.
The bullets will get faster the more you kill
Thanks for information about the .ogg. I will change to that and then I hope the music will work properly in at least both chrome and firefox since those are the most important browsers!
EDIT: I've converted the music to .ogg now. It should work! Please tell me if it doesn't.
I've found a small issue in your game. You're not preventing default events on up and down key arrows press which results in scrolling the page on screens that can't contain all the content. I suggest you add the e.preventDefault() in your checkKeyDown function so the window won't jump anymore when steering the spaceship.
EDIT: I've converted the music to .ogg now. It should work! Please tell me if it doesn't.
It works just fine on Firefox.
BTW. The music bring back memories of the out-of-time-world in Chrono Trigger. I like it!
Thanks for noticing that and liking my song :)
It this the correct way to implement the preventDefault?
function checkKeyDown(e) {
var keyID = e.keyCode || e.which;
e.preventDefault();
if (keyID === 38 ) { //up arrow
jet1.dy = -3;
}
if (keyID === 39 ) { //right arrow
jet1.direction = 1;
jet1.dx = 3;
}
if (keyID === 40 ) { //down arrow
jet1.dy = 3;
}
if (keyID === 37 ) { //left arrow
jet1.dx = -3;
jet1.direction = -1;
}
}
I suggest you put the e.preventDefault() in the all 'if' statements. This won't look good but right now you're preventing all default events that are fired after any key press. This holds true even for combinations like 'Ctrl + / -' for resizing the page or 'Ctrl + U' for source code. Even more -- you could prevents these events only if the game (canvas) is focused, so that when user clicks outside of it he will have the arrow keys scrolling functionality back.
Thanks for noticing that and liking my song
It this the correct way to implement the preventDefault?
function checkKeyDown(e) { var keyID = e.keyCode || e.which; e.preventDefault(); if (keyID === 38 ) { //up arrow jet1.dy = -3; } if (keyID === 39 ) { //right arrow jet1.direction = 1; jet1.dx = 3; } if (keyID === 40 ) { //down arrow jet1.dy = 3; } if (keyID === 37 ) { //left arrow jet1.dx = -3; jet1.direction = -1; } }