Nimbin[12]?Games / Entropie / entropie/src/world/bigtree.h

Entropie git · main

Entropie festival game; first steps

sdl c game entropie cmake · first commit 2026-10-10 · last commit 2026-11-02 (18 hours ago) · synced 10 hours ago

C 88.5% Markdown 9.1% GLSL 2.3%
git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gz
entropie/src/world/bigtree.h 1.9 KB · 37 lines raw
#ifndef WORLD_BIGTREE_H
#define WORLD_BIGTREE_H

/*
 * The big old tree between the Obstwiese and the Kartoffelacker (world/site.c
 * plants it): it leans towards the road, and over the road runs the phone
 * line. Enrico (Go-Darmstadt) fells it the other way: a rope thrown up over a
 * branch as high as it'll go (a job for you), the notch cut on the side it
 * should fall to, a few people pulling on the rope from well out, the back
 * cut. Where it comes down depends on how many pull, how high the rope is, a
 * gust - the people's part is ai_jobs.c, the rest game_bigtree.c. Here: where
 * everything is.
 */

#include "world/world.h"

#define BT_ROPE_OUT   28.0f /* m out from the tree (the way it should fall): where the rope's pulled from */
#define BT_PULLERS    4     /* places along the rope's end (the crew; you make one more) */
#define BT_PULL_GAP   1.3f  /* m between them */
#define BT_NOTCH_WORK 0.8f  /* person-hours of chainsaw work for the notch */
#define BT_CUT_TIME   22.0f /* real s for the back cut ... */
#define BT_CUT_GOES   16.0f /* ... it starts to go at this */

/* The tree (standing or down), or NULL. */
Object *BigTree_tree(const World *world);
/* Where the rope's tied (on the trunk at its height), and its end out in the meadow (hand height). */
Vec3    BigTree_attach(const World *world);
Vec3    BigTree_ropeEnd(const World *world);
/* The puller places (k 0 .. BT_PULLERS-1, from the end of the rope in), and where a hand goes on the rope there. */
Vec3    BigTree_pullerSpot(const World *world, int k);
Vec3    BigTree_ropeAt(const World *world, Vec3 near);
/* Where Enrico cuts the notch (the side it should fall to), the back cut (the other side), and gets out of the way to. */
Vec3    BigTree_notchSpot(const World *world);
Vec3    BigTree_backSpot(const World *world);
Vec3    BigTree_escapeSpot(const World *world, float sign); /* (sign: which side, 1 or -1) */

#endif /* WORLD_BIGTREE_H */