wow I randomly learned about cohong watching a video on the opium wars, the name makes sense. Also love how you change the size of everything to indicate distance, really makes the whole world feel bigger than it is
mehimme
Creator of
Recent community posts
This is my first time making anything resembling a game (unless you like playing with engineering simulations), so I appreciate it!
I started with a pretty naive implementation where normal/tangential impulses are applied to velocity only, followed by a single position update which integrates velocity at each time step. This probably would've worked better for very small time steps, but at 60Hz it caused all sorts of no-clip issues, balls slowly sinking, balls being pushed through walls by other balls, etc.
Apparently a solution for this is called sequential impulses, where you update velocity/position multiple times each frame to iteratively separate colliding entities, but obviously it hurt performance (I don't think it helped that I was using float64 for everything either). I ended up just adding a step right before integration where any two objects still intersecting will have their normal velocities clamped to 0 (I only did ball-wall intersections for the submission, but ball-ball also ended up working pretty well).
Your game looks so much more polished and like a game, can't believe you had time to squeeze my game into yours :P
Hi, I'm interested in using hoot, but I'm new to wasm and web dev in general. I have some questions wrt hoot's FFI.
Following the example from the documentation: https://files.spritely.institute/docs/guile-hoot/latest/Foreign-function-interfa..., I created hello.scm as follows:
(use-modules (hoot ffi)) (define-foreign make-text-node "document" "createTextNode" (ref string) -> (ref extern))
Then, I compiled it to wasm:
guild compile-wasm --bundle -o hello.wasm hello.scm
Then, I loaded it into guile repl:
(use-modules (wasm parse))
(use-modules (hoot reflect))
(hoot-instantiate (call-with-input-file "hello.wasm" parse-wasm)
(("document" .
(("createTextNode" . ,(lambda (str) (text ,str))))))) Then, I tried to use the make-text-node function:
(define hello (make-text-node "Hello, world!"))
But it always gives me the error: Unbound variable: make-text-node.
I'm not sure if I'm fundamentally missing something. I'm just wondering if there's a way to test these kinds of procedures in a guile repl.