Giter VIP home page Giter VIP logo

ld25's Introduction

Colorful

Colorful is a simple 2D side-shooter game, originally created in 48 hours for the Ludum Dare event, 25th edition (December 2012).

This is the "post-compo" version of the game - it has received numerous enhancements and bug fixes.

Building the game

To build Colorful, you'll need the following dependencies:

Getting the SDL2 units

Before you can build, you need to get a copy of Pascal SDL2 units. The recommended version to use can be found in the PGD SDL2-For-Pascal repository, although you're free to try compiling the game using any others.

The repo links to aforementioned headers by the means of a git submodule, so if you don't want to experiment, run the following commands:

$ git submodule init
$ git submodule update

This should fetch the SDL2 headers for you.

Configuring the build

The build process includes a custom configuration script, which can be used to tailor the build process to your needs. The script takes the following options:

  • --android
    Controls whether Android-specific build settings are enabled. The default value is false.

  • --assets <bundle, standalone, systemwide>
    Specifies where the game should expect asset files to be located.

    • bundle: Assets are expected to be found two directory levels above the executable, like in the following structure:
      • bin/linux64
      • bin/win64
      • gfx/
    • standalone: Assets are expected to be found in the same directory, right next to the executable.
    • systemwide: Assets are expected to be found in /usr/share/suve/colorful.

    The default value is standalone.

  • --debug
    Controls whether debugging features are enabled. The default value is false.

  • --donate
    Controls whether the "Donate" option appears in the main menu. The default value is true.

  • --fpc PATH
    Use the Free Pascal Compiler located at PATH. The default is to use fpc.

  • --flags FLAGS
    Pass FLAGS to fpc. Can be specified multiple times.

  • --ogg-quality QUALITY
    Encode sound effects to .ogg with this quality setting. The default value is 10.

  • --platform <auto, desktop, mobile>
    Controls whether the game should be built in desktop mode (keyboard focus, no touch controls) or mobile mode (touch, extra menus for accessibility). The default value is auto, which resolves to mobile when building for Android, and desktop otherwise.

  • --strip
    Controls whether the built executable should be stripped of debug symbols. The default value is false.

The option syntax is --option=value. Passing --option value will result in an error. For boolean options, the value can be omitted; it will be treated as true.

The script generates a Makefile, so once you've configured everything to your liking (or just decided to go with the defaults), you can build the game through the usual method:

$ make all

Installing the game

If you set assets to standalone (the default value) during the configuration phase, the game is ready to go. You can launch the executable found at build/colorful and enjoy yourself. Since the game stores its configuration file and savestates inside the user's home directory, it should continue to work even if moved to a non-writeable location.

If you're trying to package the game for Linux, go back and ensure you've configured assets to systemwide. If everything checks out, you can go ahead and use the install target defined in the Makefile.

$ make install [DESTDIR=]

Note that, currently, there is no support for specifying the installation prefix; it is hard-coded to /usr.

Building for Android

Android is a bit of a tough cookie. You can find all the extra code (Java/JNI glue, manifests, etc.) and build scripts in the pl.suve.colorful.android repository.

Licensing

Colorful is subject to two different licences.

  • Game code (found in the src/ directory) is available under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation. The full text of this licence is available in the LICENCE-CODE.txt file.

  • Anything not covered by the point above is made available under the terms of the "zlib with acknowledgement" licence. The full text of this licence is available in the LICENCE-ASSETS.txt file.

Random rambling

The code, as you can expect from a game made for a 48h compo, is quite crappy. Since this is a post-compo version, some cleanup has been made, functions have been moved, comments have been added. But it's still far from being state-of-the-art, so don't expect me to cover the damage if you hurt your eyes looking at it.

While getting the game to compile for Android was fairly easy, making it run in a sensible matter was a whole other issue. As such, the code is riddled with Android-specific quirks and workarounds. Some of these should be fairly obvious in what they do, but some are quite literally workarounds for behaviour I didn't bother to properly diagnose.

So anyway, feel free to read, observe, and despair. I mean, learn. Like, you know, I made a game and you didn't, so you can learn from me. Yeah.

ld25's People

Contributors

mattmattv avatar pandicornzombie avatar progesteves avatar pushkyn avatar romeluko avatar sconetto avatar sdmoko avatar shiifu avatar suve avatar tomg777 avatar yotam180 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ld25's Issues

Add player stat tracking

It would be cool to have the game track some player stats and then display them on the victory screen.

Some stats that could be collected:

  • Play time
  • Number of deaths
  • Hits taken / total damage taken
  • Shots fired / hits made / accuracy
  • Enemies defeated / total damage made
  • Enemies killed by contact

Use CMake for building

The current setup with a hand-written configure script that generates a Makefile is quite rudimentary, unfriendly for newcomers and very hard to integrate into other build systems (most notably Gradle, which is used for Android builds).

Migrating the game to CMake seems like a good idea.

  • It is a popular and well-understood build system (even if it has its own flaws).
  • CMake integrates nicely with Gradle. This would make it possible to simplify Android builds so that everything can be done via Gradle / Android Studio, without the need for the current hodgepodge of shell scripts.

Foreseeable problems:

  • CMake, out-of-the-box, does not have Pascal support. Some extra CMake scripting would be needed for adding Pascal support.
  • Support for different target OS / processors is needed. Currently, this is handled by simply passing some flags to the configure script, e.g. --flags="-Tandroid -Paarch64" when building for Android on 64-bit ARM.
  • Apart from code compilation, the build process also includes asset optimization. This would also need to be preserved in the CMake scripting.

Translate manpages

While the game itself doesn't currently support multiple languages, it can always be helpful for new users to translate the manpage.

The English manpage (pkg/colorful-english.man) is probably the best starting point. Originally we had only English and Polish; now we also have Dutch, French, German, Hebrew, Indonesian, Portuguese and Romanian.

When starting your work, please create a new branch, branching off from devel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.