Skip to content

feat: Add animated blue player ship with thruster, bank, and bowwave sprites - #35

Draft
geraldHack wants to merge 1 commit into
mainfrom
cursor/blue-ship-animation-c5fc
Draft

feat: Add animated blue player ship with thruster, bank, and bowwave sprites#35
geraldHack wants to merge 1 commit into
mainfrom
cursor/blue-ship-animation-c5fc

Conversation

@geraldHack

Copy link
Copy Markdown
Owner

Summary

This PR implements an animated blue player ship for DeltaBlade, replacing the static player texture with animated sprite sheets.

Changes

New Files

  • PlayerAnimationComponent.java - Component handling sprite sheet animation with 8 frames (48x48 each, 120ms per frame)
  • BlueShipSpriteGenerator.java - Tool for generating placeholder sprite sheets programmatically
  • player_blue_thruster.png - 8-frame thruster animation (yellow rear exhaust)
  • player_blue_bank.png - 8-frame banking animation (ship tilt for strafing)
  • player_blue_bowwave.png - 8-frame bowwave animation (cyan bow wave at nose)

Modified Files

  • PlayerComponent.java - Added movement direction tracking to communicate animation states
  • DeltaBladeFactory.java - Updated player spawn to use animated sprite sheets
  • DeltaBladeApp.java - Added updateIdle() call to reset animation state
  • EmbeddedTextures.java - Added Base64-encoded texture data for new sprites

Animation States

State Sheet Trigger
IDLE thruster Default/no input
BANKING_LEFT bank Moving left
BANKING_RIGHT bank Moving right
MOVING_UP bowwave (Ready for future use)

Technical Details

  • Uses the existing custom PNG decoder (Inflater + PixelWriter, 8-bit RGBA, color type 6)
  • Does not use Image(InputStream), ImageIO, or AWT
  • Hitbox remains 48px as specified
  • Falls back to original player texture if animation sheets fail to load

Note on Placeholder Sprites

The included sprite sheets are programmatically generated placeholders. They demonstrate the animation system but should be replaced with Gerald's actual AssetForge-generated sprites.

To replace with production sprites:

  1. Update the Base64 strings in EmbeddedTextures.java, or
  2. Replace the PNG files in src/main/resources/assets/textures/

The attached images from the task (player_thruster.png, player_bowwave.png, player_bank.png) were not directly accessible in the workspace environment, so placeholder sprites were generated to wire the animation code.

Testing

  • Compile passes: mvn compile
  • The animation system is fully wired and ready
  • To see the actual blue ship from AssetForge, the sprite sheets need to be manually replaced
Open in Web Open in Cursor 

…sprites

- Add PlayerAnimationComponent for sprite sheet animation (8 frames, 48x48, 120ms)
- Update PlayerComponent with movement direction tracking for animation states
- Update DeltaBladeFactory to spawn animated player with new sprite sheets
- Add DeltaBladeApp integration to update idle animation state
- Add three new sprite sheets: player_blue_thruster.png, player_blue_bank.png, player_blue_bowwave.png
- Embed Base64 texture data in EmbeddedTextures using existing PNG decoder
- Add BlueShipSpriteGenerator tool for generating placeholder sprites

Animation states:
- IDLE: thruster loop (yellow rear exhaust) - default
- BANKING_LEFT/RIGHT: bank sheet (ship tilt when strafing)
- MOVING_UP: bowwave sheet (cyan bow wave at nose)

Note: Placeholder sprites generated programmatically. For production use,
replace with Gerald's AssetForge-generated sprites by updating the Base64
data in EmbeddedTextures.java or replacing the PNG files in assets/textures/.
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.

2 participants