dodelani dnevnik
This commit is contained in:
39
src/systems/ZombieWorkerSystem.js
Normal file
39
src/systems/ZombieWorkerSystem.js
Normal file
@@ -0,0 +1,39 @@
|
||||
class ZombieWorkerSystem {
|
||||
constructor(scene) {
|
||||
this.scene = scene;
|
||||
this.workers = []; // Array of tames zombies
|
||||
this.graves = []; // Array of grave locations
|
||||
console.log('🧟 ZombieWorkerSystem: Initialized');
|
||||
}
|
||||
|
||||
// Dodaj zombija med delavce
|
||||
addWorker(zombieEntity) {
|
||||
this.workers.push({
|
||||
entity: zombieEntity,
|
||||
task: 'IDLE', // FARM, MINE, GUARD, REST
|
||||
energy: 100, // Decay meter
|
||||
xp: 0
|
||||
});
|
||||
console.log('🧟 New Worker Assigned!');
|
||||
}
|
||||
|
||||
// Dodelitev naloge
|
||||
assignTask(workerIndex, taskType, location) {
|
||||
if (this.workers[workerIndex]) {
|
||||
this.workers[workerIndex].task = taskType;
|
||||
this.workers[workerIndex].targetLocation = location;
|
||||
}
|
||||
}
|
||||
|
||||
update(time, delta) {
|
||||
// Logic for worker AI, decay, and farming automation
|
||||
this.workers.forEach(worker => {
|
||||
if (worker.energy > 0) {
|
||||
worker.energy -= 0.01; // Decay over time
|
||||
// TODO: Execute Task Logic
|
||||
} else {
|
||||
// TODO: Rot / Die logic
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user