The sprite/BG engine was not enabled when only sprites are used, and the ANSI terminal emulation caused the crash when switching screen modes. I have also fixed the incorrect default color space.
Note that I have been working on a somewhat disruptive change for a while now and I need to review that stuff before I push the next update, so this may take a day or two until it shows up in a git build.
Some more tips in the meantime:
- It is not necessary to use
STR$() here, PRINT/GPRINT accept both numbers and strings.
- [edit] You can avoid the funny character at the end of the
GPRINT output by appending ;
- No need to tell VSYNC explicitly what frame to wait for here; just
VSYNC will do.
SCREEN does CLS already, no need to do it manually.
BTW, with the bugs fixed your original program works almost perfectly, only the sprite size is wrong. š
[While we're here, I'd also like to point out how loading images with a mask is different if you load it in the off-screen pixel memory vs. the visible screen:
In the first case, all pixels are drawn, but the "keyed" pixels get an alpha value of 0. That allows you to BLIT or SPRITE the image without having to explicitly specify a key again, which is something that was not possible on the ESP8266.
In the second case, only the non-keyed pixels are drawn in the first place, because that's usually what you want, and the text screen does not have an alpha channel anyway. [At least not one that is actually used. [That might be a bit too much useless detail. [And too many brackets.]]]]