mardi 30 août 2016

One page back from the past :). Please ask me if you want the binaries!
A (future) tutorial to use Ogre, OgreNewt&Newton and OpenAL. Piston trows a "piston" in the air, pushing a small projectile. This one separate if high enough, and spawns 30 other projectiles after 10 secondes. Each of these projectiles explodes (or implodes) each 2 secondes, with the corresponding effect:

It allows to illustrate several different mechanisms, and, if it looks impressive, is very simple. It includes:
- user force & torque callbacks for a lot of interactions (throwing the piston, the explosions, the particule effects, the sound effects),
- a collision callback to play sound and render some particules (but should evolve),
- the use of dotScene to have different levels (only three simple as example, but the mechanism is complete),
- a score system (with load and save in XML, keeping the highest speed of one projectile),
- OpenAL for localised sound using the evolved wiki sound manager (though it gives the last remaining leaks :( ),
- a pause (for the physics now, not for the particules),
- a title page,
- some overlays and bitmaps :) ("starting" frames, lives... ),
- basic use of raycast (to push some objects on the ground), it is the simpler use of raycast I know, might be a beginner version of the great ONewt raycast example.

Limitations and things to be done:
- cut it in small parts and explain it :),
- use the treeCollision serialiser instead of my adapted dotScene loader,
- clean my C-like classes (clean in a C way, not in a C++ one :( ),
- clean my use of Ogre (I might use some strange way to do things, like my delScene, not sure it is not too much (still it works),
- change the gfx and the sound !!! (mostly the sounds)
- limit the creation of buildings (because it crashes Newton now quite easily) linked to the total number of cube in the scene,
- use the collision callback to destruct object (so we show the classical shoot-em up use of collision). I might do it later (quite easy to do, I just need more time).
- change the input (mostly for the score text, it is crappy as hell :) ).

How to play it:

The first time, you can just wait, the piston will be pushed after 30 secondes, and then everything will happen automatically. When you want to finish, press F4, it will consume one life :) . You have four "trials" per scene, and three scenes. But you can interact too:

To move the camera: mouse and arrows, PgUp and PgDown to go up and down. 'C' to change camera: free, inside the projectile down, tracking the projectile, inside the projectile up.

To change the force to throw the piston: 'W': +1, 'S': -1, 'A': -10,'D': +10.
To throw the piston (so apply the selected force): SPACE
To change the force of the explosion: 'U':+0.5, 'J':-0.5, SHIFT+'U','J': faster change. The factor can be negative, the projectiles will implode then.
To apply a huge force on the piston: 'T' (if you push it too long, the piston will arrive outside the Newton world, in this case you will not see the timers running, as they are into the piston callback (crappy I know) )
To create more object: F6 (some) or F7 (more)
To spawn some building: '1' to '0'. The '5' building is not "touched" by the explosion, it does not use the simple explosion callback. The '2' tower is a killer for Newton, so never spawn two!!! (I wrote this building creation for Novodex, Newton does not like the stack as much as it :) ). The buildings first create a base for them so they can be horizontal... It is a little bit ugly and not cleaned (size, position, building look...).
To quit: ESC
Throw some balls: 'x' or 'b' (not sensible to explosions).
Pause: 'P'

Aucun commentaire:

Publier un commentaire