BMAP* arrow_pcx = "arrow.pcx";
PANEL* size_pan =
{
digits(100, 50, 3.3, *, 1, mouse_ent.scale_z);
flags = visible;
}
function mouse_startup()
{
mouse_mode = 2;
mouse_map = arrow_pcx;
while (1)
{
vec_set(mouse_pos, mouse_cursor);
wait(1);
}
}
function change_entities_startup()
{
while (1)
{
if (mouse_ent) // if the mouse is touching an entity
{
if (key_1) {mouse_ent.scale_z += 0.1 * time_step;}
if (key_2) {mouse_ent.scale_z -= 0.1 * time_step;}
}
wait (1);
}
}
action players_code() // simple player and 1st person camera code
{
player = my; // I'm the player
set (my, INVISIBLE); // no need to see player's model in 1st person mode
while (1)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (my, vector(10 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
vec_set (camera.x, player.x); // use player's x and y for the camera as well
camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)
camera.pan -= 5 * mouse_force.x * time_step; // rotate the camera around by moving the mouse
camera.tilt += 3 * mouse_force.y * time_step; // on its x and y axis
player.pan = camera.pan; // the camera and the player have the same pan angle
wait (1);
}
}