fix: Add default isWater implementation and water movement penalty

This commit is contained in:
Kacper Kostka (aider)
2025-04-02 12:10:55 +02:00
parent d506ee1714
commit 1ce5abc901
2 changed files with 9 additions and 0 deletions

View File

@@ -46,6 +46,14 @@ function randInt(min, max) {
/**********************************************************************
* MOVE & DISTANCE
**********************************************************************/
// Default implementation of isWater - will be overridden by terrain.js
function isWater(x, y) {
return false; // Default to no water
}
// Water movement penalty constant
const WATER_MOVEMENT_PENALTY = 0.5;
function moveToward(obj, tx, ty, speed=0.4) {
let dx = tx - obj.x;
let dy = ty - obj.y;