Closed Thread Icon

Topic awaiting preservation: Asteroids clone (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=27531" title="Pages that link to Topic awaiting preservation: Asteroids clone (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Asteroids clone <span class="small">(Page 1 of 1)</span>\

 
BuilderQ
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2006

posted posted 02-19-2006 21:15

Hello,

I know it isn't exactly original, but I couldn't resist creating Quasaroids. Any thoughts on it?

http://javascriptgames.50webs.com/

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 02-19-2006 21:32

Haven't had a look at the code yet, but it's painfull to no be able to hold the keys down to turn/thurst/brake/shoot like crazy. And I don't really understand what is the limit of pellets displayed. At times I have up to 12 on screen, some times I can only shot 3 bullets.



(Edited by poi on 02-19-2006 21:47)

BuilderQ
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2006

posted posted 02-19-2006 22:39

The number of shots that can be fired is controlled by the laser energy available, which is indicated in the left side bar.

What browser are you using? Opera is the only one I have tested in which I cannot hold the keys down to turn/thrust/brake.

http://javascriptgames.50webs.com/

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 02-19-2006 23:07

Indeed I'm using Opera, but there's NO technical reason for a JavaScript to not support multiple key down/up at the same time.

I've had a quick look at your code, and actually it's surprising that you receive several keydown events for a key without receiving a keyup event for it. It might be due to the lack of return in your KeyCheck() and KeyCheck2() functions. In IE and FireFox you can turn/move like crazy but you can't fire like crazy, and as soon as you press SPACE while still holding one or more ARROW the ship stops moving.

It's really easy to support multiple keydown/up on every browsers. Check some scripts on my site to see some examples. In short the idea is to have a keyDownState and keyUpState array that you update on the key events, and check the keys you need in your gameUpdate() function. And actually, unless you explicitly need to catch the keyUp events, you can get rid of the keyUpState array.

Hope that helps,



(Edited by poi on 02-19-2006 23:25)

liorean
Bipolar (III) Inmate

From: Umeå, Sweden
Insane since: Sep 2004

posted posted 02-20-2006 03:22

When it comes to key events, I like to point people to this resource:
http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/KeyEvent.htm

It's great for seeing how key events are handled in each browser.


As for the keydown/keyup and keypress events, there is one things you should remember - if the user changes focus window or control, or presses a key combo that moves focus to menu/location bar/taskmanager etc, you will no longer be detecting the keyups, so you probably should cancel those out for the blur event on the window as well as for the modifier keys and the windows key.

--
var Liorean = {
abode: "http://codingforums.com/",
profile: "http://codingforums.com/member.php?u=5798"};

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 02-21-2006 00:49

On the gameplay level, there are far too few possible directions in which the ship can face. In other words, each press of the arrow key turns the ship thirty degrees. At close range, a thirty degree arc isn't that bad, but at longer ranges it makes it very difficult to aim at an asteroid.

___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

BuilderQ
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2006

posted posted 02-21-2006 02:27
quote:
poi said: Check some scripts on my site to see some examples.



So you're the creator of http://www.p01.org/. I was particularly impressed by your paint program.

Anyways, I've modified my game based on your suggestions; how is it now?

quote:
Suho1004 said: At close range, a thirty degree arc isn't that bad, but at longer ranges it makes it very difficult to aim at an asteroid.



Well, that gives you an incentive to move the ship, no? What do you think the number of facings should be?

http://javascriptgames.50webs.com/

DmS
Maniac (V) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 02-21-2006 10:19

Doesn't work at all on safari on mac. Refuses to react on keyevents.
FF on mac works though.
I like the game, fairly quick and reacts quite solidly to input most of the time. It flickers now and then, like it's clearing the screen or something but not too bad.

Could use a bit more fuel or someplace to refuel though, same with getting a bonus recharge of the laser or something.
/D

{cell 260} {Blog}
-{"Theories without facts are just religions...}-

« BackwardsOnwards »

Show Forum Drop Down Menu