feat: Increase gravity strength by 3x and enhance element fall mechanics

This commit is contained in:
Kacper Kostka (aider) 2025-04-05 17:07:03 +02:00
parent 7cabd79d5f
commit 2067dad1d3
4 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
// Game constants
const CHUNK_SIZE = 200;
const PIXEL_SIZE = 4;
const GRAVITY = 0.5;
const GRAVITY = 1.5; // Increased gravity (3x stronger)
const WATER_SPREAD = 3;
// Base Colors

View File

@ -1,7 +1,7 @@
// Basic element behaviors (sand, water, dirt)
function updateSand(x, y) {
// Try to move down with stronger gravity (up to 3 pixels at once)
let maxFall = 3;
// Try to move down with stronger gravity (up to 5 pixels at once)
let maxFall = 5;
let newY = y;
// Check how far down we can fall
@ -62,8 +62,8 @@ function updateWater(x, y) {
setMetadata(x, y, metadata);
}
// Try to move down with stronger gravity (up to 2 pixels at once)
let maxFall = 2;
// Try to move down with stronger gravity (up to 4 pixels at once)
let maxFall = 4;
let newY = y;
// Check how far down we can fall
@ -154,8 +154,8 @@ function updateWater(x, y) {
}
function updateDirt(x, y) {
// Try to move down with stronger gravity (up to 3 pixels at once)
let maxFall = 3;
// Try to move down with stronger gravity (up to 5 pixels at once)
let maxFall = 5;
let newY = y;
// Check how far down we can fall

View File

@ -1,7 +1,7 @@
// Plant element behaviors (grass, seeds, trees)
function updateGrass(x, y) {
// Grass behaves like dirt for physics with stronger gravity
let maxFall = 3;
let maxFall = 5;
let newY = y;
// Check how far down we can fall
@ -61,7 +61,7 @@ function updateGrass(x, y) {
function updateSeed(x, y) {
// Seeds fall like sand with stronger gravity
let maxFall = 3;
let maxFall = 5;
let newY = y;
// Check how far down we can fall

View File

@ -1,7 +1,7 @@
// Tree element behaviors
function updateTreeSeed(x, y) {
// Tree seeds fall like other seeds with stronger gravity
let maxFall = 3;
let maxFall = 5;
let newY = y;
// Check how far down we can fall