New engine features |
Top Previous Next |
pX_stats
This new instruction returns the number of registered physics entities that are currently in the level.
#include <default.c> #include <ackphysx.h>
var physics_ents;
function main() { physX_open(); level_load(""); // load an empty level vec_set(camera.x,vector(-100, 0, 30)); pXent_settype(NULL, PH_STATIC, PH_PLANE); // create a static plane at groundlevel zero while (1) { ENTITY* ball = ent_create(SPHERE_MDL, vector(random(100), random(50), 100), NULL); pXent_settype(ball, PH_RIGID, PH_SPHERE ); // create a ball pXent_setelasticity(ball, 50); pXent_addvelcentral(ball, vector(0, 0, 10)); physics_ents = pX_stats(1); wait(-5); } }
PANEL* counter_pan = { layer = 15; digits(20, 20, 4, *, 1, physics_ents); flags = SHOW; }
PhysX engine update
GameStudio 8.30 now uses the 2.8.4 PhysX engine; this allows us to deploy physics-based Gamestudio applications without having to install the PhysX System Software on the target system.
inkey_active improvements
The inchar( ) function can now be terminated prematurely by setting inkey_active to 0.
#include <default.c>
STRING* input_string = "";
var code_guess;
function main() { level_load(""); // load an empty level while (1) { code_guess = inchar(input_string); // pressed the "Enter" key? (scan code for enter = 13) if (code_guess == 13) { printf("Honored to serve you, safe cracker"); break; } else { printf("Ha ha ha! You'll never break the code!"); } wait (1); } }
function abort_startup() { while (1) { if (key_q) // the Q ("quit") key was pressed? { inkey_active = 0; // don't wait for player's input anymore printf ("Code input aborted"); sys_exit (NULL); } wait (1); } }
|