Skip to content

Conversation

pethers
Copy link
Member

@pethers pethers commented Aug 2, 2025

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.

…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.
@github-actions github-actions bot added documentation Documentation updates infrastructure CI/CD and build infrastructure assets Game assets and resources labels Aug 2, 2025
pethers added 2 commits August 2, 2025 15:53
…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
@pethers pethers requested a review from Copilot August 2, 2025 16:08
Copy link
Contributor

@Copilot Copilot AI left a 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 {
Copy link
Preview

Copilot AI Aug 2, 2025

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.

Comment on lines +155 to +160
* 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);
Copy link
Preview

Copilot AI Aug 2, 2025

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.

Suggested change
* 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(
Copy link
Preview

Copilot AI Aug 2, 2025

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(
Copy link
Preview

Copilot AI Aug 2, 2025

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.

Comment on lines +131 to +134
// await playerSpritesheet.loadArchetypeSpritesheetFromFile(
// archetype,
// `/assets/spritesheets/${archetype}_spritesheet.json`
// );
Copy link
Preview

Copilot AI Aug 2, 2025

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.

Suggested change
// 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(
Copy link
Preview

Copilot AI Aug 2, 2025

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.

Copy link

sonarqubecloud bot commented Aug 2, 2025

@pethers pethers merged commit 9d13313 into main Aug 2, 2025
13 checks passed
@pethers pethers deleted the spritesheet1 branch August 2, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Game assets and resources documentation Documentation updates infrastructure CI/CD and build infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant