Untitled
public text v1 · immutablewhile(1){
oldbutton=button;
button=(mouse_b&1);
if (oldbutton && button) { /* drag */
if(pos.x == 0){pos.x=mouse_x; pos.y=mouse_y;};
line(screen,pos.x,pos.y,mouse_x,mouse_y,makecol(69,69,69));
pos.x=mouse_x;
pos.y=mouse_y;
}
else if (button && (!oldbutton)) { /* click */
putpixel(screen,mouse_x,mouse_y,makecol(10,255,30));
pos.x=mouse_x;
pos.y=mouse_y;
}
}