New engine features

Top  Previous  Next

path_create

 

This new instruction creates an actor path and attaches to it; you can specify its number of nodes and edges.

 

#include <default.c>

#include <ackphysx.h>

 

var dist = 0;

 

void main()

       level_load(NULL);

       me = ent_create(SPHERE_MDL, NULL, NULL);         

       path_create(me, 4, 4); // create a path with 4 nodes and 4 edges and attach the sphere to it

       path_setnode(me, 1, vector(600, 200, -100), NULL);

       path_setnode(me, 2, vector(600, -200, -100), NULL);

       path_setnode(me, 3, vector(800, -200, 100), NULL);

       path_setnode(me, 4, vector(800, 200, 100), NULL);

       while(1)

       {

         path_spline(me, my.x, dist += 8 * time_step);

          wait(1);

}

}

 

 

Netport I/O modules support

 

Gamestudio now supports netport I/O modules, a series of intelligent I/O modules with Ethernet and USB interfaces, over the network. This way, any Gamestudio application can control external motors, lamps, servos, or solenoids.

 

aum102_beta1

pan_getpos

 

This function retrieves the xy position of a panel element.
 

BMAP* picture1on_pcx = "picture1on.pcx";

BMAP* picture1off_pcx = "picture1off.pcx";

 

BMAP* pointer_tga = "pointer.tga";

 

VECTOR button_pos;

 

PANEL* main_pan =

{

       bmap = "main.tga";

       layer = 15;

       button(40, 30, picture1on_pcx, picture1off_pcx, picture1on_pcx, NULL, NULL, NULL);

       digits(160, 10, "Button coordinate on the x axis: %.f", *, 1, button_pos.x);

       digits(160, 30, "Button coordinate on the y axis: %.f", *, 1, button_pos.y);

       flags = SHOW;

}

 

function button_startup() // get the xy coordinates of the 1st button on main_pan

{

       wait (-5);

       pan_getpos(main_pan, 3, 1, button_pos);

}

 

function mouse_startup()

       mouse_mode = 2;

       mouse_map = pointer_tga;

       while (1)

       

               vec_set(mouse_pos, mouse_cursor);

               wait(1);

       }

}