Crash BASIC for Visual Studio Code
Full-featured development environment for Crash BASIC, a modern BASIC language for indie 2D game development.
Features
Language Support
- Syntax Highlighting: Complete syntax highlighting including keywords, built-in functions, type keywords, numbers, strings, comments (
REM and ' style), labels, and operators
- Code Folding: Automatic folding for all block structures (
SUB, FUNCTION, IF, FOR, WHILE, SELECT, DO, BEHAVIOR, PATTERN, COOLDOWN, DATA, etc.)
- Auto-Indentation: Smart indentation for block structures
- Bracket Matching: Parentheses and square brackets
- Theme: Includes "Crash BASIC Dark" theme optimized for BASIC code
Integrated Development
- Run with F5: Execute your program directly in CrashPlayer
- Context-Sensitive Help (F1): Press F1 on any keyword to view documentation
- Search Help: Search the full API documentation
Asset Integration
- Sprite Editor: Open and edit sprite assets
- Tile Editor: Create and modify tilesets
- Map Editor: Design tile-based maps
- Aseprite Integration: Open
.ase/.aseprite files directly in Aseprite or the built-in Sprite Editor
- Copy Load Code: Right-click any asset (images, audio, video, sprites) to copy the BASIC code needed to load it
Configuration
- Aseprite Path: Auto-detects or manually configure the path to Aseprite
Prerequisites
CrashPlayer must be installed and available on your system PATH. Download the Crash BASIC DevKit from:
https://arcade.crashbasic.com/devkit
The DevKit installer places crashplayer on your PATH automatically on most systems. The extension finds it with which crashplayer (or where crashplayer.exe on Windows) — there's no auto-install; if it isn't found, the extension just tells you to install the DevKit.
Manual PATH Configuration
If the installer didn't automatically add CrashPlayer to your PATH, you can do it manually:
macOS
Add to ~/.zshrc (or ~/.bash_profile for older systems):
export PATH="/Applications/CrashPlayer.app/Contents/MacOS:$PATH"
Then restart your terminal or run source ~/.zshrc.
Windows
- Open Start Menu and search for "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables..."
- Under "User variables", select "Path" and click "Edit..."
- Click "New" and add the CrashPlayer installation directory (e.g.,
C:\Program Files\CrashPlayer)
- Click "OK" on all dialogs and restart VS Code
Linux
Add to ~/.bashrc (or ~/.zshrc if using zsh):
export PATH="$HOME/.local/bin:$PATH"
Then restart your terminal or run source ~/.bashrc.
Keyboard Shortcuts
| Key |
Action |
| F5 |
Run program in CrashPlayer |
| F1 |
Show help for keyword at cursor |
File Extensions
This extension activates for files with the .bas extension.
Syncing with the Crash BASIC Web IDE (Git)
If you intend to round-trip a project between this extension and the Crash BASIC Web IDE over Git, initialize the Git repository inside your project's src/ folder, not at the parent project root.
- The VS Code extension treats
src/ as your game's source area
- The Web IDE treats whatever's in the repo root as the project root — which becomes the contents of the published
.crashcart
Putting git init in src/ means only the src/ contents flow through Git into the Web IDE (and from there into the eventual crashcart). Anything you keep at the parent level — build scripts, scratch .bas experiments, notes, design docs — stays out of the repo and out of the crashcart, while still being available to you locally in VS Code.
my-game/
├── src/ ← git repo lives here; Web IDE sees this as root
│ ├── main.bas
│ ├── images/
│ └── ...
├── scratch.bas ← stays out of the crashcart
├── notes.md
└── build.sh
Example
' Simple Game Loop
SCREEN 320, 200
DIM playerX AS INTEGER = 160
DIM playerY AS INTEGER = 100
SUB DrawPlayer(x AS INTEGER, y AS INTEGER)
CIRCLE x, y, 10, 14
END SUB
DO
CLS
CALL DrawPlayer(playerX, playerY)
IF KEYDOWN("LEFT") THEN
playerX = playerX - 2
ELSEIF KEYDOWN("RIGHT") THEN
playerX = playerX + 2
END IF
YIELD
LOOP
About Crash BASIC
Crash BASIC is a modern BASIC language designed for indie 2D game development. It combines the simplicity of classic BASIC with powerful features for creating games, including sprites, tilemaps, collision detection, audio, and more.
Learn more at crashbasic.com