소스 검색

Integrate steering with WASD

Colleagues 10 년 전
부모
커밋
3951160a7a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      js/controller.js

+ 5 - 1
js/controller.js

@@ -68,6 +68,7 @@ Controller.prototype.bind_events = function(){
 
 		switch (e.keyCode){
 			case 37:
+			case 65:
 				if(dir.x == 1)
 					{
 						break;}
@@ -76,6 +77,7 @@ Controller.prototype.bind_events = function(){
 						break;
 					}
 			case 38:
+			case 87:
 				if(dir.y == 1)
 					{
 						break;}
@@ -84,7 +86,8 @@ Controller.prototype.bind_events = function(){
 						break;
 					}
 			case 39:
-			if(dir.x == -1)
+			case 68:
+				if(dir.x == -1)
 					{
 						break;}
 				else {
@@ -92,6 +95,7 @@ Controller.prototype.bind_events = function(){
 						break;
 				}
 			case 40:
+			case 83:
 				if(dir.y == -1)
 					{
 						break;}