v0.1.0 — M1: Project Setup + Tilemap + Combat + Backend
Frontend: - HTML5 Canvas isometric tilemap renderer - Eichenhafen starting city (procedural) - Click-to-move A* pathfinding - Player stats, HP/SP/EXP bars, skill bar, minimap - 3 NPCs (merchant, class master, innkeeper) - 6 monster spawns with aggro AI - Combat: auto-attack, damage numbers, EXP/gold - Player death + respawn Backend: - FastAPI server with SQLite - Ollama LLM bridge for events + dialogue - Event validation (no soft-lock) - NPC dialogue generation Design: - Full DESIGN.md with architecture, formulas, milestones - 6 base classes + 6 advanced classes - 3 fixed cities, dynamic events
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// camera.js — Camera follows player
|
||||
|
||||
class Camera {
|
||||
constructor() {
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.targetX = 0;
|
||||
this.targetY = 0;
|
||||
this.smoothing = 0.1;
|
||||
}
|
||||
|
||||
follow(targetX, targetY) {
|
||||
this.targetX = targetX;
|
||||
this.targetY = targetY;
|
||||
}
|
||||
|
||||
update() {
|
||||
this.x += (this.targetX - this.x) * this.smoothing;
|
||||
this.y += (this.targetY - this.y) * this.smoothing;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user