Okay, so, interesting bug/feature: print("^a") with just the beep and not the text introduces a new line at the last cursor point.
If this is the first print() in the game, and if x/y coordinates are not specified, the new line will insert at the bottom of the screen and force the screen to scroll, potentially disrupting previously drawn graphics.
In the game of the attached screenshot, the blue case and UPLR button are drawn first, then a beep via print("^a"), then the "Vortex" in the next print(). Note the scrolling of the lower buttons by one character height.
Specifying x/y coords prevents this corruption from happening, e.g.: print("\^a", 0, -20).
The expected behavior was that since the print() was called with only a beep code and no text, it would not force a new line.
A solution might be to check if pixel width of a print equals zero, and if so, to prevent the new line at the end of the print.
This is actually as per documented:
print str x y [col] print str [col] ... If x and y are not supplied, newline will automatically be appended. This can be ommited by ending the string in an explicit termination command: ?"the quick brown fox\0" |
As you've already observed, specifying x,y prevents the newline being added.
If you don't want to specify x,y try print("^a\0")
I must have missed that in the documentation. Or maybe I was looking at an older version. Thanks!
[Please log in to post a comment]