How to stop the left rectangle to move out of screen? [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to stop the left rectangle to move out of screen? [SOLVED]

https://code.sololearn.com/W53q7FUqkmVF/?ref=app

13th Apr 2020, 11:50 AM
Abhay
Abhay - avatar
4 Answers
+ 2
ask urself what r u gonna do if it goes out of the screen,probably u want to keep it still,or back to it original position..from that,try to implement that in ur code eg:if (something){do something}else{do something else}
13th Apr 2020, 12:00 PM
durian
durian - avatar
+ 3
Ok I did it !
13th Apr 2020, 12:16 PM
Abhay
Abhay - avatar
+ 1
Yup I did that but it got stuck in a forever loop with while loop but I will see what can I do ,thks
13th Apr 2020, 12:02 PM
Abhay
Abhay - avatar
0
👍
13th Apr 2020, 12:29 PM
durian
durian - avatar