微信图片_20200301130417.png method void moveUp() {
if (y > 1) {
do Screen.setColor(false);
do Screen.drawRectangle(x, (y + size) - 1, x + size, y + size);
let y = y - 2;
do Screen.setColor(true);
do Screen.drawRectangle(x, y, x + size, y + 1);
}
return;
}
After running the upper code, the changes should be like in the file which I upload. ( the red line marks the process )
I think the consequences didn't meet with the goal to move the square up by 2 pixels, instead, It left the area(x,y-1,x+size,y+2) in white.
I guess the right code should be
method void moveUp() {
if (y > 1) {
do Screen.setColor(false);
do Screen.drawRectangle(x, (y + size) - 2, x + size, y + size);
let y = y - 2;
do Screen.setColor(true);
do Screen.drawRectangle(x, y, x + size, y + 2);
}
return;
}