ewrogers/sgdk-skills

sgdk-scenes

Build SGDK game flow with title screens, character select, levels, pause, continue and credits; manage fades, input handoff, audio and resource cleanup between screens.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/ewrogers/sgdk-skills --skill sgdk-scenes

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

SGDK Scenes

Make each screen own its resources and decide exactly when gameplay stops, loading happens and input becomes active again. SGDK supplies the hardware services; a scene enum and update loop are ordinary game code.

Choose a small flow

  1. List the screens and what survives between them: player choices, options,

score and checkpoint. Keep that session data separate from sprites, maps, callbacks and temporary buffers.

  1. Pick what Continue restores. A level-start checkpoint is simpler than a

full mid-frame save. Validate the complete record before changing the live session, and preserve the previous valid slot if a write fails.

  1. Decide whether pause freezes gameplay only or also animation and sound.

Keep input polling and VBlank service running. See timing, input and saves.

  1. Pull ewrogers/sgdk:latest, run doctor, and verify APIs against its

headers/source. The linked references were checked with SGDK 2.11.

Give transitions one owner

  • Request the next screen from game code. Apply that request in the main loop,

after the current update finishes; avoid resource changes inside IRQ or joypad callbacks.

  • Stop outgoing producers, fade out, then drain the final queued transfers

while their source data still exists. SGDK clears the fade flag before its last queued palette transfer has been flushed.

  • Hide the display, remove only callbacks the screen owns, and release its

maps, sprites and scratch allocations. Clear stale handles.

  • Reset the planes, Window, scrolling and palettes needed by the next screen.

Build the incoming screen while hidden; flush its initial sprite/graphics uploads before fading in.

  • Check each allocation. Clean up partial entry before trying a safe title or

error screen. Do not repeatedly retry a failing load forever.

Follow resource ownership and cleanup for the actual APIs and their limits. Do not cancel the global DMA queue or reset unrelated services merely to make a transition appear to work.

Prove the flow

The standalone Transition Lab includes Title, Continue, Options, Credits, two-player character selection, four rooms and pause. Its boss encounter exercises bounded projectiles, dropped coins, effects and a final reward without creating another scene framework.

Test both success and failure:

  • Either player joins first; simultaneous joins and held buttons behave once.
  • Countdown, manual animation and pause follow the intended clock at 50/60 Hz.
  • Fades drain before resource cleanup; repeated transitions return to a

comparable heap baseline; partial loads clean up before fallback.

  • Missing, corrupt and interrupted saves preserve the older valid checkpoint.
  • Emulator checks cover menus, both players, music, fades, Continue and the

complete game. Console timing and SRAM retention need separate tests.

Report the ownership rules, checkpoint policy, tool versions and tests actually performed. A host fixture checks ordering and game behavior; compiling a ROM checks API compatibility. Neither proves VDP timing or real hardware behavior.

タスクに関連する項目

同じリポジトリから

関連する Skills

すべての Skills
ewrogers
コミュニティ

sgdk-ai

Implement enemy behavior in SGDK games with patrol/chase/attack states, sight cones, target selection, bounded pathfinding and staggered updates. Use when enemies see through walls, get stuck, switch targets erratically, return stale paths or cause frame spikes while searching.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-assets

Prepare, import and troubleshoot Mega Drive graphics, palettes, spritesheets, tiles, maps, fonts and audio resources with SGDK ResComp in Docker. Use for .res files, palette or tile budgets, broken imports, sprite cutting and asset pipeline changes.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-best-practices

Write or review SGDK C for defined arithmetic, clear module boundaries, resource lifetimes, safe queued transfers and interrupt sharing. Use for implementation quality and project code organization, rather than toolchain setup, game design or performance profiling alone.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-cartridge

Plan and implement large SGDK cartridges with Sega/SSF bank switching, FAR resources, pinned shared code and audio, and safe SRAM access. Use when a ROM exceeds the linear address window, stage assets live in separate banks, a FAR pointer becomes invalid, or saving interferes with banked content.

導入数
1
GitHub Stars
0
更新日
10月20日