stanje 4am
This commit is contained in:
@@ -30,7 +30,31 @@ class PreloadScene extends Phaser.Scene {
|
||||
// Wait for load completion then process transparency
|
||||
this.load.once('complete', () => {
|
||||
this.processAllTransparency();
|
||||
this.createAnimations();
|
||||
});
|
||||
|
||||
// New Processed Animations (Standardized 64x64 strips)
|
||||
this.load.spritesheet('player_walk', 'assets/sprites/player_walk_strip.png', { frameWidth: 64, frameHeight: 64 });
|
||||
this.load.spritesheet('zombie_walk', 'assets/sprites/zombie_walk_strip.png', { frameWidth: 64, frameHeight: 64 });
|
||||
}
|
||||
|
||||
createAnimations() {
|
||||
if (this.anims.exists('player_walk_anim')) return;
|
||||
|
||||
this.anims.create({
|
||||
key: 'player_walk_anim',
|
||||
frames: this.anims.generateFrameNumbers('player_walk', { start: 0, end: 5 }),
|
||||
frameRate: 12,
|
||||
repeat: -1
|
||||
});
|
||||
|
||||
this.anims.create({
|
||||
key: 'zombie_walk_anim',
|
||||
frames: this.anims.generateFrameNumbers('zombie_walk', { start: 0, end: 5 }),
|
||||
frameRate: 8,
|
||||
repeat: -1
|
||||
});
|
||||
console.log('🎞️ Animations created!');
|
||||
}
|
||||
|
||||
processAllTransparency() {
|
||||
|
||||
Reference in New Issue
Block a user