File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191
9292 function toggleMute ( ) {
9393 game . mute ( ) ;
94- document . getElementById ( "muteLink" ) . innerText = game . sounds . mute ? "unmute " : "mute " ;
94+ document . getElementById ( "muteLink" ) . innerText = game . sounds . mute ? "Unmute " : "Mute " ;
9595 }
9696 </ script >
9797 < script type ="text/javascript ">
Original file line number Diff line number Diff line change @@ -344,37 +344,17 @@ PlayState.prototype.update = function(game, dt) {
344344 // event for smooth movement, otherwise the ship would move
345345 // more like a text editor caret.
346346
347- // Left Arrow Key
348- if ( game . pressedKeys [ 37 ] ) {
347+ // Left Movement Keys : A Key / Left Arrow Key
348+ if ( game . pressedKeys [ 65 ] || game . pressedKeys [ 37 ] ) {
349349 this . ship . x -= this . shipSpeed * dt ;
350350 }
351351
352- // Right Arrow Key
353- if ( game . pressedKeys [ 39 ] ) {
352+ // Right Movement Keys: D Key / Right Arrow Key
353+ if ( game . pressedKeys [ 68 ] || game . pressedKeys [ 39 ] ) {
354354 this . ship . x += this . shipSpeed * dt ;
355355 }
356- // Space Key
357- if ( game . pressedKeys [ 32 ] ) {
358- this . fireRocket ( ) ;
359- }
360-
361- // A Key
362- if ( game . pressedKeys [ 65 ] ) {
363- this . ship . x -= this . shipSpeed * dt ;
364- }
365-
366- // D Key
367- if ( game . pressedKeys [ 68 ] ) {
368- this . ship . x += this . shipSpeed * dt ;
369- }
370-
371- // W Key
372- if ( game . pressedKeys [ 87 ] ) {
373- this . fireRocket ( ) ;
374- }
375-
376- // Up Key
377- if ( game . pressedKeys [ 38 ] ) {
356+ // Fire Keys : Space Key / W Key / Up Key
357+ if ( game . pressedKeys [ 32 ] || game . pressedKeys [ 87 ] || game . pressedKeys [ 38 ] ) {
378358 this . fireRocket ( ) ;
379359 }
380360
You can’t perform that action at this time.
0 commit comments