Well, an almost-game…
I’m working on my first tutorial to get people playing (or working) with Harfang. The idea was to create a 2D gameplay, with a 3D display and 3D physics.
The pitch is simple
A turret that can rotate on its Y axis, shoot bullets at boulders that try to reach it. The more you play, the faster the boulders will spawn. The more boulders you hit, the better the score (and lots of debris on the ground, too)
How it is implemented ?
Everything is in physics ! The turret position is contrained on the X,Y and Z axis, only the Y rotation is allowed. As an handicap factor, the damping factor of the turret is set to the maximum.
The bullets are constrained on the X,Z plane, so that they won’t fall on the ground.
As for the boulders, there is no specific constraints, except a constant linear forces applied to them, to drag them in the direction of the turret.
This capture doesn’t show the game under its full potential, but it might reflect the average gameplay session :
Here is the source code
I managed to keep the source under 300 lines of codes.
With an extra hundreds of lines, we could implement better variations of the level of difficulty, a more reliable spawn routine of the enemies or modulate the damping of the turret.