+ 2

Help me!!!

Help me figure out how to move the square. So that it does not stretch, but moves. the square only moves to the left and stretches to the right. help? https://code.sololearn.com/W7j5enMu6Dut/?ref=app

29th Mar 2021, 3:28 PM
УГцГцГГвщп Š™Š“Ń†Š»ŃˆŠ°Š¾ŠæŠ»Ń‹
УГцГцГГвщп Š™Š“Ń†Š»ŃˆŠ°Š¾ŠæŠ»Ń‹ - avatar
3 Answers
+ 1
Zachiah sawyer how to do it
30th Mar 2021, 8:52 AM
Alexander Sokolov
Alexander Sokolov - avatar
0
In clearRect you are always doing -2 use a conditional just like when you modified the x
29th Mar 2021, 5:55 PM
Zachiah sawyer
Zachiah sawyer - avatar
0
https://code.sololearn.com/WRNTz4sv9Ded/?ref=app you can just clear the whole rectangle if you don't want to manage previous state like this
30th Mar 2021, 1:02 PM
Zachiah sawyer
Zachiah sawyer - avatar