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
On 2025-08-09 22:05:33 +0000, fir said:
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
You have a set of situations. Each situation involves a place and possibly some state information. For each place you need a paragraph of text that
you need to write. You also need a (hopefully short) paragraph of text
for each possible value of each state variable.
The program is simple. The function start does not write anything.
It just initializes the situation variables and calls the function
that displays texts as required by the situation variables. On key
input update situation variables according to the key and call the
same function as start does.
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
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
Richard Damon pisze:
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
it doesnt seem to be answer to my question ..what i say thet paragraph
game (paragraph game is just a set os paragraphs/screens of text where
below yu got options to chose (like 2 or 5) and you jump to another paragraphs
in dos c it could be done like this
start()
{
 clear_screen*(;
 text("youre near river and see the boat");
 text("1. go inside the boat");
 text("2. go to the forest");
 k =getch();
if(k=='1') boat()
if(k=='2') forest()
}
boat()
{
 clear_screen*(;
 text("you sit in boat you swim 1. down the river 2. up the river");
 k =getch();
if(k=='1') swim_down_river()
if(k=='2') swim_up_river()
}
forest()
{
 clear_screen*(;
 text("youre in the forest 1. walk north 2. walk east");
}
but in windowsc you got two roots - event handlers and you need to draw
text in one and take keys in another
notabene it seem maybe that DOS way witch GETCH() is woser this getch
just could ba generalized to pop any event that occurs
Mikko pisze:
On 2025-08-09 22:05:33 +0000, fir said:
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
You have a set of situations. Each situation involves a place and possibly >> some state information. For each place you need a paragraph of text that
you need to write. You also need a (hopefully short) paragraph of text
for each possible value of each state variable.
The program is simple. The function start does not write anything.
It just initializes the situation variables and calls the function
that displays texts as required by the situation variables. On key
input update situation variables according to the key and call the
same function as start does.
its not an answer to the question..question it hovever maybe not easy
as it needs some back focus i think
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
On 2025-08-10 13:22:17 +0000, fir said:
Mikko pisze:
On 2025-08-09 22:05:33 +0000, fir said:
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
You have a set of situations. Each situation involves a place and
possibly
some state information. For each place you need a paragraph of text that >>> you need to write. You also need a (hopefully short) paragraph of text
for each possible value of each state variable.
The program is simple. The function start does not write anything.
It just initializes the situation variables and calls the function
that displays texts as required by the situation variables. On key
input update situation variables according to the key and call the
same function as start does.
its not an answer to the question..question it hovever maybe not easy
as it needs some back focus i think
Sometimes it is easier to not answer a qesstion but to do something else
that does not need the answer.
Mikko pisze:
On 2025-08-10 13:22:17 +0000, fir said:i answered to myself..it seems the best to write whoel game mechanic in OnKeyDown keyboard handler
Mikko pisze:
On 2025-08-09 22:05:33 +0000, fir said:
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
You have a set of situations. Each situation involves a place and possibly >>>> some state information. For each place you need a paragraph of text that >>>> you need to write. You also need a (hopefully short) paragraph of text >>>> for each possible value of each state variable.
The program is simple. The function start does not write anything.
It just initializes the situation variables and calls the function
that displays texts as required by the situation variables. On key
input update situation variables according to the key and call the
same function as start does.
its not an answer to the question..question it hovever maybe not easy
as it needs some back focus i think
Sometimes it is easier to not answer a qesstion but to do something else
that does not need the answer.
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,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 163:52:59 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
9,181 files (2,736M bytes) |
Messages: | 2,411,516 |