remix-add-sprite
Original:🇺🇸 English
Translated
Generate and add sprites to a Remix game
14installs
Added on
NPX Install
npx skill4agent add farworld-labs/remix-skills remix-add-spriteTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Add Sprite to Game Workflow
Overview
This skill guides you through generating sprite sheets for canvas-based games
on the Remix platform.
Prerequisites
- The game HTML file must already exist (follow the game-creation workflow first if starting from scratch).
- A game must be created on the Remix platform (you need a game ID).
- The environment variable must be set.
REMIX_API_KEY
Steps
1. Check for Existing Game ID
Read in the current directory. If it exists and contains
a , use that value.
.remix-settings.jsongameIdOnly if does not exist or has no should you
follow the upload-game workflow to create one.
.remix-settings.jsongameId2. Generate the Sprite Sheet
Call the sprite generation endpoint:
POST https://api.remix.gg/v1/games/{gameId}/sprites/generate
Authorization: Bearer $REMIX_API_KEY
Content-Type: application/json
{
"prompt": "a pixel-art knight walking animation, 4 frames",
"gridSize": 4,
"imageUrl": null
}Parameters:
- (required) -- description of the sprite and animation
prompt - (optional) -- number of frames in the sprite sheet grid
gridSize - (optional) -- reference image URL to base the sprite on
imageUrl
The response returns and directly (already
hosted -- no separate upload step needed).
spriteUrltransparentSpriteUrl3. Integrate the Sprite Sheet into the Game
Use the returned URL with canvas to render individual frames:
drawImagejs
const sprite = new Image();
sprite.src = "https://returned-sprite-url.png";
const frameWidth = 64; // width of a single frame
const frameHeight = 64; // height of a single frame
const totalFrames = 4;
let currentFrame = 0;
sprite.onload = () => {
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Draw the current frame from the sprite sheet
ctx.drawImage(
sprite,
currentFrame * frameWidth, 0, // source x, y in the sprite sheet
frameWidth, frameHeight, // source width, height
player.x, player.y, // destination x, y on canvas
frameWidth, frameHeight // destination width, height
);
currentFrame = (currentFrame + 1) % totalFrames;
requestAnimationFrame(animate);
}
animate();
};Use when you need the sprite rendered over other
game elements without a background.
transparentSpriteUrlTips
- Be specific about frame count and action. "4-frame walk cycle" is better than "walking character".
- Specify art style. Include "pixel-art", "hand-drawn", "flat vector", etc. in your prompt.
- Frame layout is horizontal. Frames are arranged left-to-right in a single
row. Divide the image width by to get individual frame dimensions.
gridSize - Use for in-game sprites that need to overlay backgrounds or other elements.
transparentSpriteUrl - Preload before gameplay. Wait for before starting the game loop.
onload