Game Collision Detection Issue | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Game Collision Detection Issue

Hi, i am trying to build a Block Breaker game and am struggling with the collision behaviour of the blocks. the blocks are stored in an array. i give every array item a custom eventlistener and check for collision with the ball in the function "moveBall"; if a collision is detected, the event is dispatched and the block should be removed from the field. however, the block removed is always the last in the block array. if you dont move the panel and wait for about 10 sec, the ball reaches the second row and the behaviour is even stranger: now all the blocks from the array index of collision to the array length are removed; can anyone help me with my problem? thank you ๐Ÿ˜ƒ https://code.sololearn.com/WYY3u607E2f8/?ref=app

10th Sep 2019, 3:01 PM
Daniel Asherov
1 Answer
+ 5
Daniel Asherov wait bro i will share your problem then you fix it your problem.. ok โ˜บโ˜บโ˜บ๐Ÿ‘๐Ÿ‘๐Ÿ‘Œ๐Ÿ‘Œ๐Ÿ‘Œ game is to good .๐Ÿ‘๐Ÿ‘๐Ÿ‘
11th Sep 2019, 3:30 AM
๐Ÿ‡ฎ๐Ÿ‡ณAbhay Pratap Singh๐Ÿ‡ฎ๐Ÿ‡ณ
๐Ÿ‡ฎ๐Ÿ‡ณAbhay Pratap Singh๐Ÿ‡ฎ๐Ÿ‡ณ - avatar