Type your ugBASIC program here (remember: keywords like PRINT must be UPPERCASE!).
Click on Build menu to select the target: you will download the compiled binary file!

OPTION EXPLICIT DEFINE IMAGE FREE HEIGHT DEFINE MSPRITE ASYNC BITMAP ENABLE COLOR BORDER GREEN DIM forestImage AS IMAGE DIM dragonBirdImage AS IMAGE DIM dragonBirdSprite AS MSPRITE DIM dragonBirdMove AS PATH DIM dragonBirdLeftMove AS PATH DIM dragonBirdRightMove AS PATH DIM dragonBirdX AS POSITION, dragonBirdY AS POSITION forestImage := LOAD IMAGE("forest.png") dragonBirdLeftMove = CREATE PATH( 300, 52 TO 0, 52 ) dragonBirdMove = dragonBirdRightMove dragonBirdImage := LOAD IMAGE("dragonbird.png") dragonBirdSprite = MSPRITE(dragonBirdImage IGNORE COLOR LIGHT RED) CLS PUT IMAGE forestImage AT 0, 0 DO TRAVEL dragonBirdMove TO dragonBirdX, dragonBirdY SPRITE dragonBirdSprite AT dragonBirdX, dragonBirdY IF dragonBirdX = 0 THEN dragonBirdMove = dragonBirdLeftMove ENDIF MSPRITE UPDATE LOOP

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.