On 2025-08-10 18:25:45 +0000, Richard Damon said:
On 8/9/25 6:05 PM, fir wrote:
i might already asked that question (but then i abandoned this
and today get back to it)
i need extremally simple schem for coding paragraphs
in main game part i got two callbacks one is in
OnDraw()
{
draw_current_screen(); //<-- its callback pointer
}
OnKeyPressed(int key)
{
last_key=key;
current_key_handler(); //<-- thios is callback for keys
}
so in game i need to provide a lot of routines for drawing text
and a lot for handling keypresses
it currently look like that
start()
{
text("youre in the middle of the woods, chose what to do:");
text("1) go north");
text("2) go south");
}
start_()
{
key('1', go_north, go_north_); //this function just set callbacks
to new state
key('2', go_south, go_south_);
}
and so on i could produce hundred paragraphs of this way and it will
make a net of connected parragraphs
But it somewhat annoys me as it still seem to moe to be
to complicated and i needed to be as simple as its possible
how i could sipmplify it? note i could replace function key
by some makro to write KEY(1, go_north) probbaly
(i write probably as i dont use macros in c at all and even dont
remember how to define them, but still its maybe annoying to have 2
routines for each paragraph
isnt it possible to write this something like
start()
{
text("youre in the middle of the woods, chose what to do:");
text("1) go north"); KEY(1, go_north);
text("2) go south"); KEY(2, go_south);
}
????
as i could writhe a tons of this paragraphs (thinking about writing big
paragraph game) it would simplyfy a hours of typing
This sounds very much like would be solved with the Adventure
Construction Set. That wasn't in C, but should be able to be
translated to it. Note, the "map" wasn't done in code, but data.
https://en.wikipedia.org/wiki/Adventure_Construction_Set
For a text only game making one's own engine is as easy as to find
a good enough one (unless one already has one).
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,073 |
Nodes: | 10 (0 / 10) |
Uptime: | 222:43:11 |
Calls: | 13,783 |
Calls today: | 1 |
Files: | 186,987 |
D/L today: |
706 files (243M bytes) |
Messages: | 2,434,876 |