MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / collision

Function collision

assets/js/snake.js:81–91  ·  view source on GitHub ↗
(head,array)

Source from the content-addressed store, hash-verified

79
80//check collision function
81function collision(head,array){
82 for(let i=0;i<array.length;i++){
83 if(head.x==array[i].x && head.y==array[i].y)
84 {
85 return true;
86 }
87 else{
88 return false;
89 }
90 }
91}
92
93//draw everything to the canvas
94

Callers 1

drawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected