Open PalashBansal opened 4 years ago
Too much code duplicacy. Redundant code can be removed from both index.htm and Game.js
Code snippets like-
DetectCollision("whiteDot1"); DetectCollision("whiteDot2"); DetectCollision("whiteDot3"); DetectCollision("whiteCircle"); DetectCollision("whiteSquare"); DetectCollision("whiteRect"); DetectCollision("whiteSquare1"); DetectCollision("whiteSquare2"); DetectCollision("whiteSquare3"); DetectCollision("whiteSquare4"); DetectCollision("whiteSquare5"); DetectCollision("whiteSquare6"); DetectCollision("whiteSquare7"); DetectCollision("whiteSquare8");
Can be created in one line after pushing all obstacles in an array and passing to DetectCollision(); like-
var whiteObstaclesArr[] = {"whiteDot1","whiteDot2",....}; foreach(var whiteObstacle in whiteObstaclesArr) DetectCollision(whiteObstacle);
Up for grab :)
Too much code duplicacy. Redundant code can be removed from both index.htm and Game.js
Example-
Code snippets like-
Can be created in one line after pushing all obstacles in an array and passing to DetectCollision(); like-