Find the answer to your Linux question:
Results 1 to 9 of 9
Just something I've been toying with over the last few days. It's a text-mode turn based strategy game, which I've called Turious. When I started this ages ago it was ...
  1. #1
    Linux User
    Join Date
    Jan 2006
    Posts
    414

    I wrote a little game...

    Just something I've been toying with over the last few days. It's a text-mode turn based strategy game, which I've called Turious.

    When I started this ages ago it was in C++, but when I took a look at the source I wasn't happy with how I'd done some things, so I dumped the lot and rewrote it in plain C.

    It's nothing particularly special, but if you want to have a play here it is:
    http://203.143.236.125/turious.tar.gz

    It's just the source (GPL of course) so you'll have to compile it yourself (just run make, it's not that hard). I've tried it on 32 and 64 bit systems.

    The game has:
    2 classes of soldier
    3 classes of civilian
    3 levels of difficulty (setable from the options menu)
    up to 5 ai enemies (setable from the options menu - although if you feel like editing the makefile.inc you can up this to however many you want)
    same basic in-game help

    If you have a play let me know

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    I wanted to have a look at the sourcecode.
    For Reviewing what you did etc.
    And well I didnt have had a look let. Well the Make Files look nice
    But, when I started the SourceCode Revieuw I noticed this thing that is REALLY annoying (sorry to be negative) and thats that you use main.c ALL THE TIME.. its really annoying for revieuwing your sourcecode so, little advice. use 1 main.c at the most.

    Ill have a look now and let you know what I'd think off your SourceCode + the Game
    New Users, please read this..
    Google first, then ask..

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Quote Originally Posted by RobinVossen View Post
    I wanted to have a look at the sourcecode.
    Ill have a look now and let you know what I'd think off your SourceCode + the Game
    I had a peek, you did some nice 'Hacky' things in there. ^^
    Rather nice. I even like your coding style. And that is a rare thing for me to like
    New Users, please read this..
    Google first, then ask..

  4. #4
    Just Joined!
    Join Date
    Jul 2009
    Location
    Chicago, IL
    Posts
    9
    I'll give it a go next time I am on Linux. I looked though the code and it looks neat, your coding style is also good (although your file names could be named a bit better).

  5. #5
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    The main.c thing was an experiment on my part, I wanted to try it out as a means of easily tracking the main file for each section of the game (semi pointless in this case due to the small size of the project)... it worked for that, but was a pain in the *** when there's half a dozen main.c's open in the editor (another experiment, used Geany - which is quite nice), so I won't be doing that again.

    Might change it, as there's still a couple of things I'd like to add to the game. Coding style is more or less 'kernel coding standards' so glad you like it.

    btw RobinVossen, what where the 'nice little hacky things'? I didn't think I did anything particularly interesting in this (which tends to be a rather rare thing for me ).
    Last edited by darkrose0510; 11-02-2009 at 01:00 AM.

  6. #6
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    The fact that you store a Function pointer in a variable is a rather rare thing to see (well I never saw anyone use it in C besides the "HackMes" and "ProofOfConcept" ^^
    New Users, please read this..
    Google first, then ask..

  7. #7
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    My little game is growing up...



    I've been experimenting with SDL lately, I've written a widget library which is powering the game. When I get the graphical version working I'll post the code.

  8. #8
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,391
    Here's a little bug fix for src/player/main.c:

    Code:
    214c214
    <               if (sold > players[0].brigadiers) {
    ---
    >               if (brig > players[0].brigadiers) {
    without this, you have to buy a huge amount of brigadiers to attack someone with a large army.
    Linux user #126863 - see http://linuxcounter.net/

  9. #9
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    Thanks Roxoff, just made the change, and the tarball above has been updated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •