Documentation

PengCLI is a complete fantasy console environment. It features a project-based workflow, compiled binaries, a professional 256-color VGA pipeline, and built-in visual editors.

Installation & Updates

PengCLI is portable but requires its launcher for the best experience.

IMPORTANT: Always launch launcher.exe. It automatically checks for updates on GitHub, downloads new versions, and ensures your environment is up to date. Launching pengcli.exe directly will bypass the update system.
  1. Unzip PengCLI.zip into a folder.
  2. Run launcher.exe.
  3. If an update is found, type update in the terminal to install it.

The .PCP Workflow

To create a game, you must follow the Code -> Compile -> Run cycle.

> CODE MYGAME         (Initializes project)
> COMP MYGAME         (Bundles assets into MYGAME.PCP)
> RUN MYGAME          (Runs the program)

System API (peng.*)

These functions manage the console state and standard I/O.

FunctionDescription
peng.setMode(mode)Switch between "GFX" (Game) and "TERMINAL" (CLI) modes.
peng.print(text)Prints text to the terminal history.
peng.cls()Clears the terminal history buffer.
peng.save(file, content)Saves raw string data to a file.
peng.load(file)Reads raw string data from a file.

Graphics API (peng.gfx.*)

Low-level drawing using VGA palette indexes (0-255).

FunctionArgumentsDescription
clsidxClears the screen with a palette color.
setcoloridxSets the active drawing color.
putpixelx, y, idxDraws a single pixel.
linex1, y1, x2, y2Draws a line.
rectanglex1, y1, x2, y2Draws an empty rectangle.
barx1, y1, x2, y2Draws a filled rectangle.
circlex, y, rDraws an empty circle.
fillcirclex, y, rDraws a filled circle.
drawTextstr, x, y, idxDraws text at coordinates.
getWidth / getHeight-Returns screen dimensions in pixels.

Input API (Polling)

Check user input inside peng.gfx.update(dt).

FunctionDescription
peng.gfx.isKeyDown("key")Checks if a key (e.g., "space", "w", "up") is held.
peng.gfx.isMouseDown(btn)1: Left, 2: Right, 3: Middle.
peng.gfx.getMouseX() / Y()Returns current mouse coordinates.

Assets & World API

Functions to render your sprites and maps.

FunctionDescription
peng.gfx.drawspr(name, x, y)Draws a sprite from /sprites. Index 0 is transparent.
peng.gfx.drawmap(n, tx, ty, tw, th, dx, dy)Renders a section of map n. Tiles are 8x8 pixels.
peng.gfx.getmap(n, tx, ty)Returns the sprite name at the specified tile.
peng.gfx.setmap(n, tx, ty, spr)Changes a map tile during gameplay.

Sprite Editor (EDITSPR)

Sprite Editor

Map Editor (EDITMAP)

Map Editor

Edits a 64x64 tile world. Automatically imports sprites from your /sprites folder. Multi-tile sprites (e.g., 16x16) are handled automatically.

VGA Palette Reference

VGA 256 VGA HEX

Hello World

peng.cls()
print("Hello, World!")
                

Basic Game Template

peng.setMode("GFX")
local x, y = 64, 64

function peng.gfx.update(dt)
    -- Input
    if peng.gfx.isKeyDown("right") then x = x + 2 end
    if peng.gfx.isKeyDown("left")  then x = x - 2 end

    -- Collision: check tile 8 pixels ahead
    local tile = peng.gfx.getmap("t", math.floor(x/8), math.floor(y/8))
    if tile == "wall" then x = 64 end -- Simple bounce back
end

function peng.gfx.draw()
    peng.gfx.cls(0)
    peng.gfx.drawmap("t", 0, 0, 40, 30, 0, 0)
    peng.gfx.drawspr("player", x, y)
    peng.gfx.drawText("PENGCLI", 10, 10, 11)
end

PENGUIN POWER!