xr-game

a small rts-game written in c with the xlib.

in fact it is too basic to be really called a rts.

but this is in the spirit of a rts, and to try to improve our c-skill's.

being very simple, because my c-skill's are limited, you can probably read this source if you are a beginner.


Files:


compile with:

$ gcc xlib_bw_120x80.c -o xlib_bw_120x80 -lX11

then it can be call'd with:

$ ./xlib_bw_120x80

there are three controller's, 'd', 'c', and 'p'.

with 'd', you will give food to the entities ('d' being the last letter of 'food')

but even if there is some food arround, the entities will not go catch it yet. you will have to tell them to do it with 'c' (like in 'catch'.)

with 'p', informations will be print'd about the entities, thier number, their position, their direction convert'd into an integer, followed by their destination if any.

if an entity has no destination, (-1, -1) will be print'd, and if you clic on 'c', the nearest collectible will be affected to this field.

when you clic on 'p', the list of collectibles will also be print'd if any.

after an entity caught a pixel, we can call it an electron, the entity will walk around again, until the next call to 'c', catch.


license for the code:

to the extent permitted by law: spdx=any