-
Notifications
You must be signed in to change notification settings - Fork 1
Add new spritesheets and utility functions for characters #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t sprite utility functions - Created `jeongbo_operative.json` and `musa_warrior.json` spritesheets with animations for idle, walk, and attack states. - Implemented `spriteUtils.ts` with utility functions for sprite management, including movement direction calculation, player animation retrieval, and spritesheet initialization.
…rative, and Crime Fighter guides with refined combat focuses and effects; add new organized crime spritesheet
…Musa Warrior, Amsalja Assassin, Hacker, and Intelligence Operative guides with complete AI generation prompts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive spritesheet infrastructure for the Korean martial arts combat game, adding character animations for multiple archetypes and implementing sprite management utilities. The changes establish a foundation for character visualization and animation handling in the game.
Key Changes
- Implemented sprite utility functions for movement direction calculation and animation management
- Added complete spritesheet JSON definitions for five character archetypes with Korean martial arts animations
- Created comprehensive PlayerSpritesheet class for managing all character animations and textures
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
File | Description |
---|---|
src/utils/spriteUtils.ts | New utility functions for sprite management, movement direction calculation, and animation handling |
src/assets/spritesheets/PlayerSpritesheet.ts | Core spritesheet management system with placeholder textures and animation definitions |
src/assets/spritesheets/*.json | Character spritesheet data for Musa Warrior, Jeongbo Operative, Jojik Crime, Hacker Cyber, and Amsalja Assassin |
src/assets/spritesheets/ai-guides/*.md | AI generation guidelines for creating character sprites with Korean martial arts themes |
/** | ||
* Create PIXI.AnimatedSprite from animation data | ||
*/ | ||
export function createAnimatedSpriteFromAnimation(animation: any): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function uses 'any' types instead of proper TypeScript types. Should define specific interfaces for animation parameters and return types, following PixiJS UI component patterns from the coding guidelines.
Copilot generated this review using guidance from repository custom instructions.
* Create PIXI.AnimatedSprite from animation data | ||
*/ | ||
export function createAnimatedSpriteFromAnimation(animation: any): any { | ||
if (!animation || !animation.frames) return null; | ||
|
||
const textures = animation.frames.map((frame: any) => frame.texture); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function signature uses 'any' types which removes type safety. Should define proper interfaces for animation data structure and return type to ensure API consumers understand the expected data format.
* Create PIXI.AnimatedSprite from animation data | |
*/ | |
export function createAnimatedSpriteFromAnimation(animation: any): any { | |
if (!animation || !animation.frames) return null; | |
const textures = animation.frames.map((frame: any) => frame.texture); | |
* Animation frame structure for sprite animations | |
*/ | |
export interface AnimationFrame { | |
texture: any; // Replace 'any' with PIXI.Texture if available | |
anchor?: { x: number; y: number }; | |
} | |
/** | |
* Animation data structure for sprite animations | |
*/ | |
export interface AnimationData { | |
frames: AnimationFrame[]; | |
speed: number; | |
loop: boolean; | |
} | |
/** | |
* Return type for createAnimatedSpriteFromAnimation | |
*/ | |
export interface AnimatedSpriteObject { | |
textures: any[]; // Replace 'any' with PIXI.Texture[] if available | |
animationSpeed: number; | |
loop: boolean; | |
anchor: { x: number; y: number }; | |
} | |
/** | |
* Create PIXI.AnimatedSprite from animation data | |
*/ | |
export function createAnimatedSpriteFromAnimation( | |
animation: AnimationData | |
): AnimatedSpriteObject | null { | |
if (!animation || !animation.frames) return null; | |
const textures = animation.frames.map((frame: AnimationFrame) => frame.texture); |
Copilot uses AI. Check for mistakes.
/** | ||
* Calculate movement direction based on velocity | ||
*/ | ||
export function getMovementDirection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function lacks explicit return type annotation. According to the coding guidelines, functions should ALWAYS use explicit return types.
Copilot generated this review using guidance from repository custom instructions.
/** | ||
* Get appropriate animation for player state | ||
*/ | ||
export function getPlayerAnimation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function lacks explicit return type annotation. According to the coding guidelines, functions should ALWAYS use explicit return types.
Copilot generated this review using guidance from repository custom instructions.
// await playerSpritesheet.loadArchetypeSpritesheetFromFile( | ||
// archetype, | ||
// `/assets/spritesheets/${archetype}_spritesheet.json` | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function contains commented-out code that should be removed or replaced with proper implementation. Leaving commented code creates confusion about intended functionality.
// await playerSpritesheet.loadArchetypeSpritesheetFromFile( | |
// archetype, | |
// `/assets/spritesheets/${archetype}_spritesheet.json` | |
// ); | |
// TODO: Load actual spritesheet files for each archetype in production. |
Copilot uses AI. Check for mistakes.
/** | ||
* Load actual spritesheet from file | ||
*/ | ||
async loadArchetypeSpritesheetFromFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function lacks explicit return type annotation. According to the coding guidelines, functions should ALWAYS use explicit return types.
Copilot generated this review using guidance from repository custom instructions.
…ctory; remove coverage report upload step
|
Introduce new spritesheets for Jeongbo Operative and Musa Warrior, including animations for various states. Implement sprite utility functions for improved sprite management and animation handling.