fix: Add default isWater implementation and water movement penalty
This commit is contained in:
8
utils.js
8
utils.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user