Skip to content

docs: add getting started with sprites guide - #42

Open
thelocalfrogman wants to merge 1 commit into
splashkit:masterfrom
thelocalfrogman:docs/getting-started-with-sprites
Open

thelocalfrogman wants to merge 1 commit into
splashkit:masterfrom
thelocalfrogman:docs/getting-started-with-sprites

Conversation

@thelocalfrogman

Copy link
Copy Markdown

Description

Adds a getting started guide for SplashKit Sprites to the Tutorials and Guides section.

The documentation has extensive Sprites API coverage and usage examples but no Sprites guide in the Getting Started path, and the Animations guide explicitly scopes itself to animations without sprites. This guide covers creating a sprite from a bitmap, positioning and drawing, velocity and why Update Sprite is what actually moves the sprite, keyboard control, keeping a sprite inside the window, using more than one sprite from a single bitmap, and freeing sprites, then closes with a complete Example Code program matching the Audio and Camera guides.

Examples are in C++, C# top-level statements, C# object-oriented and Python. The runnable examples reuse the existing sprite_set_velocity resource bundle rather than adding duplicate game assets. The guide also includes one GIF and seven annotated stills, five of them captured from real SplashKit output and two of them diagrams.

Type of change

  • Documentation (update or new)

How Has This Been Tested?

Every code block in the guide was compiled and run against the SplashKit SDK on Linux, using the player-run.png resource the guide links to. The C++ examples compile with g++ and the complete programs run with arrow-key movement and edge clamping behaving as described, both C# variants build with 0 warnings and 0 errors, and the Python programs run.

The C# Sprite class has no Free() method, so the object-oriented example uses SplashKit.FreeSprite(playerSprite) rather than instance syntax, and the guide calls that difference out so readers don't have trouble with it.

npm run build completes with 119 pages built, no errors, and Astro's link validation reporting all internal links valid.

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Firefox
  • npm run build
  • npm run preview

Both browsers were checked against the npm run preview build. The page renders correctly in each, the images load, and both tab groups switch and stay in sync across the page.

Checklist

If involving code

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

If modified config files

  • I have checked the following files for changes:
    • package.json
    • astro.config.mjs
    • netlify.toml
    • docker-compose.yml
    • custom.css

Folders and Files Added/Modified

  • Added:
    • src/content/docs/guides/sprites/getting-started-with-sprites.mdx
    • public/gifs/guides/sprites/sprite-keyboard-movement.gif
    • src/content/docs/guides/sprites/images/ (7 PNGs)
  • Modified:
    • src/content/docs/guides/index.mdx
    • astro.config.mjs
    • scripts/json-files/guides-groups.json

Additional Notes

Related material also exists in Thoth Tech's SplashKit-Tutorial repository, including Ashley T's Getting Started With Sprites tutorial. This guide was written separately for the current Starlight documentation and expands the topic into the site's multi-language guide format.

The stills are co-located at guides/sprites/images/ rather than public/images as CONTRIBUTE.md describes. Current practice in the repository is split, and the neighbouring Audio, Animations and Camera guides all carry their own images/ folder, so this follows the sibling Getting Started guides. Happy to move them if you would rather.

This PR is limited to the guide, its images and its navigation entries. It does not change the Sprites API pages, usage-example generation, the build system, or existing examples.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant