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 (decimal, hex
&H, octal &O), 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
Alternatively, the latest can be installed if you have Node.js and npm available. Use the following command:
npx @crashcontinuum/crashplayer-install
This will automatically select the latest verison of Crash Player for your system and install it.
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.
Installation
From VSIX (Local Install)
- Download the
.vsix file
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click the "..." menu at the top of the Extensions panel
- Select "Install from VSIX..."
- Choose the downloaded file
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
SYNC
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