Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+3)

I love how elastic the moving the map feels. Once I figured out the puzzle (I missed the tips section) I just started moving around the mess that was my map. It has the right amount of elastic to respond to what I want and rigid enough to keep the other side in place

(1 edit) (+1)

Yeah, definitely had to fiddle with the exact numbers a lot, but the heavy lifting is done by the d3(-force) library. Check it out if you're a JS dev! https://github.com/d3/d3-force

(-1)

These elastic balls aren't that difficult to program. I do this all the time. After playing World of Goo, I reprogrammed the core gameplay in at least 5 languages/engines.

Basically you just need to do this for every connection:

fn apply_connection_force(ball1: &mut Ball, ball2: &mut Ball, goal_distance: f32, force_factor: f32) {
    let diff = ball2.pos - ball1.pos;
    let dis = diff.magnitude();
    let dir = diff / dis;
    let force = dir * (dis - goal_distance) * force_factor;
    ball1.vel += force;
    ball2.vel -= force;
}