Write and run a Gosu program

You can run a Gosu program from a command prompt. The Gosu program uses the same keywords and syntax as a Gosu class.

Before you begin

The following instructions describe running a basic Gosu program after you set up the gosu command-prompt tool.

See also

Procedure

  1. Create a file called myprogram.gsp containing only the following line:
    print("Hello World")
  2. Open a command prompt.
  3. Change your working directory to the directory that contains your program.
  4. Type the following command:
    gosu myprogram.gsp

    If you have not yet added the gosu executable folder to your system path, instead type the full path to the gosu executable.

    The tool runs the program.

    The program prints the following output:

    Hello World