Time Frack 2D – now with source code

Alright here is everything you need to compile Time Frack 2D for windows (I even included the Microsoft Visual c++ express project file and some other stuff that you dont really need) and since its using SDL and little else it should be little to no work at all getting it to compile on pretty much any other platform. The Wii and GP2X versions each had some minor changes but where effectively the same. I’ll upload everything I’ve got for them also if anybody want em.

Warnings: Along with the game just being incomplete there is some stuff in there that I am fully aware of being stupidly and inefficiently written that I didn’t get around to fixing. On top of that I’ve never worked with anyone before or even gotten any kind of real commentary on any code I’ve written before so I’m probably doing other things unconventionally or just plain stupidly that I’m not even aware of. Also there isn’t much in terms of comments in the code to explain what things are doing but I dont think its horrible unorganized or dense either so it presumably wont be difficult to read and edit.

Anyways feel free to ask any questions you have or make any kind of requests and I’ll do my best to help. All I ask is that if you post an updated version or lightly modified version or whatever of it somewhere that you mention it and link back here at some point and similarly it would be cool if you posted about it in the comments here so I can see what you’ve done with it.

Download links for source code

About these ads

12 Responses to Time Frack 2D – now with source code

  1. MCMic says:

    I love you man :D
    here is a mirror : http://mcmic.haxx.es/TimeFrack2D-source.tar.gz (I use the tar.gz format, which I prefer to rar)
    You didn’t put a licence to your code, you should. (if you don’t care you can use this simple one : http://sam.zoy.org/wtfpl/ )

    Your code seems weird organized. (you shouldn’t have code in .h files)

    I can’t get to compile it for now, but I’ll keep trying ( I have that : “$ g++ main.cpp -o test `sdl-config –cflags –libs` -lSDL
    /tmp/cciKaYX1.o: In function `IMG_LoadOptimize(std::basic_string<char, std::char_traits, std::allocator >)':
    main.cpp:(.text+0x2a5): undefined reference to `IMG_Load’
    collect2: ld a retourné 1 code d’état d’exécution” )

    • thatotherdev says:

      I also love me :) lol thanks.

      I’ve noticed a lot of the nerdier (by which I mean awesomer) sites seem to make a point of using tar.gz. I know rar is proprietary and therefore evil but I just kinda got into the habit of using it. I downloaded gzip though and I think I might start using it.

      I’ll try to remember to include a license next time I post any source code.

      What should the extension be for the extra files with additional functions and things? cpp?

      In case you haven’t figured it out yet well I may have been writing stuff in some way or another for a while now I’m still pretty much just making things up and hacking stuff together as I go along. So I’m not really super sure of the problem or how to correct it. It seems like its just a general problem with SDL though. Either with your copy of it or some problem with how its mentioned in your makefile. I dont really know how to fix it. If it is a problem with IMG_LoadOptimize in specific then you can easily comment out that function and then change each mention of IMG_LoadOptimize to IMG_Load in the Game_setup_media file. Anyways I hope you can figure it out. Good luck.

      • MCMic says:

        You should have for each class a .h file with the declaration and a .cpp file with the implementation. So the .h file only contains “class Blabla { //a lot of stuff// }” and the .cpp file contains all the “void Blabla::function() { }”
        But the makefile and the includes will have to be modified.
        I think I’ll try to re-order all this code when I’ll find the motivation to do that.

        PS: really, you should try GNU/Linux :P

      • thatotherdev says:

        ok cool :)

        I had a partition with ubuntu installed at one point but I didn’t really have a ton of motivation to use it so I almost never really did and I ended up getting rid of it after a while to free up the hard drive space. I’m planning to give GNU/Linux another try though once I’m finished They Do Not Die (a top down zombie game I’m working on) so I can port it over. Is there a specific distro that you would recommend?

      • MCMic says:

        It’s kind of complicated.
        I use ArchLinux, but it’s hard to install and use at the beginning.
        You should start with something like Ubuntu or Fedora.
        You can try Chakra : http://chakra-project.org/
        It’s user-friendly and based on ArchLinux. (But it’s a young project so maybe it’s not perfect for now)

        Anyway, for each distro you’ll can have a lot of help on the web, don’t be afraid to ask. :-)

  2. MCMic says:

    I compile it with “g++ main.cpp -o test `sdl-config –cflags –libs` -lSDL_image” and it worked.

    Before I could play I had to launch the game from the Release directory, so I has access to the medias.

    The game work under GNU/Linux ;-)

    I just can’t find the control for fire.

    • thatotherdev says:

      Awesome! You can edit the controls in Game_controls.h but right now its set to fire when you hit the r key. I know its all super unintuitive. The game was really intended for GP2X and I didn’t put much thought into the layout for the keyboard controls.

  3. Ian says:

    I too got it to compile under Linux (specifically Ubuntu 10.04). I replaced things like #include “SDL.h” with #include . I could not find sdl-draw in the repositories (though sdl-gfx was there), and downloaded it from http://sourceforge.net/projects/sdl-draw/. I installed sdl-draw, then copied the SDL_draw.h files into the Source/Generic directory. I also removed the #include “begin_code.h” and #include “close_code.h” lines inside SDL_draw.h. Compiled with the command: g++ Source/main.cpp -lSDL -lSDL_image. Changed to the Release/ directory, and then ran ../a.out. Works!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 45 other followers

%d bloggers like this: