Type your ugBASIC program in the following box. Some BASIC rules:
  • keywords must be UPPERCASE, like PRINT
  • comments that are placed at the end of a line must be preceded by a colon:
    • this is good: PRINT "OK!": ' comment
    • this is wrong: PRINT "OK!" ' comment
Click on Build menu to select the target: you will download the compiled binary file!

PROCEDURE demo ON COCO SCREEN #14 : COLOR #0,#5 CLS DOUBLE BUFFER ON scenery := LOAD IMAGE("vdg_barbarian_scenery.png") character := LOAD ATLAS("vdg_barbarian_character.png") FRAME SIZE(32,64) TRANSPARENCY background := NEW IMAGE(32,64) PUT IMAGE scenery AT 0, 0 SCREEN SWAP DIM d(FRAMES(character)) AS BYTE ox# = 49: oy# = 50 x# = 50: y# = 50 b# = 0: cd# = 0 f# = 0 DO IF x <> ox OR y <> oy THEN IF x > ox THEN cd = 0 IF x < ox THEN cd = 1 IF d(f) <> cd THEN FLIP X IMAGE character FRAME f d(f) = cd ENDIF IF b THEN PUT IMAGE background AT ox, oy ENDIF b = 1 GET IMAGE background FROM x,y PUT IMAGE character FRAME f AT x, y WITH TRANSPARENCY ADD f, 1, 0 TO FRAMES(character)-1 ox = x: oy = y SCREEN SWAP ENDIF JMOVE ,x,y,10,200,10,180,8,8 LOOP END PROCEDURE demo[] ON COCO

Welcome to the ugBASIC sandbox!

This tool was designed to quickly test whether the code you are writing compiles correctly and determines the desired results. Since the source is compiled thanks to dedicated servers, separate from the browser you are using, some commands are not available: for example, you cannot load external files or resources by using the LOAD command. If you need to develop a program with a complete tool, we recommend installing the executables or the UGBASIC-IDE.

Unless required by applicable law or agreed to in writing, this website is given on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.