+ 5

Why the second red block didnt get to the top again?

once again help pls😅 https://code.sololearn.com/W8HXrbOFOD1l/?ref=app

23rd Oct 2018, 5:44 AM
Jingga Sona
Jingga Sona - avatar
4 Antworten
+ 9
This comparison (line 60) if(aPosY == HEIGHT-20){ Is too specific (expecting a very accurate scenario) If you set it to if(aPosY >= HEIGHT-20){ it will work probably better to set it to if(aPosY >= HEIGHT){ also it seems that the score increment only occurs once (first time) probably another condition which is too specific
23rd Oct 2018, 5:48 AM
Burey
Burey - avatar
+ 9
Nahh, not a genuis, just encountered the same issues at some point ;)
23rd Oct 2018, 5:57 AM
Burey
Burey - avatar
+ 2
Oh Yesss!! Thanks Burey! You are a genius!👍👍👍
23rd Oct 2018, 5:51 AM
Jingga Sona
Jingga Sona - avatar
+ 2
Okay! Thanks again Burey!👍
23rd Oct 2018, 5:58 AM
Jingga Sona
Jingga Sona - avatar