GSoC/GCI Archive
Google Code-in 2012 Copyleft Games Group

Hedgewars: Lua GameFlags Extension

completed by: Martin Bede

mentors: Andrey Korotaev, Xeli, Sheepy, koda

Remember to join our IRC channel when working on this task! We are on #hedgewars at freenode.net. If you are new to IRC, read this tutorial from a past GCI participant.

Your task

This task is about extending the game's lua API so that it allows easy modification of the game's flags. (Game flags are the bits of the variable 'GameFlags'. They determine gameplay settings, e.g. gfLowGravity)

uScript.pas: Add the following lua API functions so that allow to enable or disable one or more Game-Flag:

EnableGameFlags(gameflag, ...) DisableGameFlags(gameflag, ...) ClearGameFlags();

Also, for testing purposes, modify one existing lua script (or make a new one) in a way that it will use these new functions.

Deliverable

A working patch, that applies cleanly to our source tree. This patch should be in the form of a pull from clone, hg export or unified diff format (in order of preference) implementing the functionality required.

See also

This task is part of issue #331, where you can find a bit more details about the motivation and goal behind this task.

But don't forget: This task is only about adding the particular functions listed in the actual GCI task description above. However, if you feel like fixing the other stuff mentioned in the issue as well we can assign you the GCI tasks for those after you completed this task.