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 // Game constants
const CHUNK_SIZE = 200; const CHUNK_SIZE = 200;
const PIXEL_SIZE = 4; const PIXEL_SIZE = 4;
const GRAVITY = 0.5; const GRAVITY = 1.5; // Increased gravity (3x stronger)
const WATER_SPREAD = 3; const WATER_SPREAD = 3;
// Base Colors // Base Colors

View File

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

View File

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

View File

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