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
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
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; }
← Return to game
Comments
Log in with itch.io to leave a comment.
This is one of my favorite terminal games. Glad to see this as a smooth browser game, good job!
i'm obsessed with this game. 10/10; would recommend
:)
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
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
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;
}