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

Bitfighter: Parameterize Lua Constructor for Various Objects Group 1

completed by: Martin Bede

mentors: watusimoto, raptor

Remember to join our IRC channel when working on this task! We are on #bitfighter at freenode.net. We are friendly!

Your task

Parameterize Lua constructor for the following items:

                    Item              Parameter set 1  | Parameter set 2
                    =====================================================
                    Asteroid            Geom           |
                    AsteroidSpawn       Geom           | Geom, time
                    CircleSpawn         Geom           | Geom, time
                    CoreItem            Geom, team     | Geom, team, health
                    EnergyItem          Geom           | Geom, regen time
                    FlagItem            Geom           | Geom, team
                
This will allow scripters to create an object as follows: local a = Asteroid.new(100,200) rather than the more cumbersome current method: local a = Asteroid.new() a:setLoc(100,200)

Task is complete when a levelgen script and editor plugin can create the items above, with the two specified parameter sets, and new constructors are documented. This task looks complex, but is actually pretty easy. There are some good models to follow, and the mentors know exactly what needs to be written.