Código:
/******************************************************************************/.
#include stdafx.h.
/******************************************************************************/.
// global variables.
Mesh meshplane.
Matrix matrixplane.
Char8 *cctext[7]={player,dificulty,start,easy,normal,expert,insert name}.
Flt posiciontexto[6][4]={0.514f,0.357f,0.885f,0.235f, 0.443f,0.058f,0.952f,-0.06f, 0.552f,-0.243f,0.855f,-0.354f, 0.55f,0.357f,0.847f,0.239f, 0.495f,0.056f,0.912f,-0.052f, 0.498f,-0.243f,0.906f,-0.357f}.
Str name.
I8 indicemenu (0), dificulty(0).
Flt incx, incy, incz.
// general functions.
Void actualizarraton(vec2 pos) {.
Switch (indicemenu) {.
Case 0 : {.
Frep(3) if ((pos.x>posiciontexto[i][0])&&(pos.x<posiciontexto[i][2])&&(pos, y<posiciontexto[i][1])&&(pos, y>posiciontexto[i][3])) indicemenu=i+1.
Break.
}.
Case 2 : {.
Frep(3) if ((pos.x>posiciontexto[i+3][0])&&(pos.x<posiciontexto[i+3][2])&&(pos, y<posiciontexto[i+3][1])&&(pos, y>posiciontexto[i+3][3])) dificulty=i.
}.
}.
}.
/******************************************************************************/.
Void initpre ().
{.
App, name (Volumetric clouds).
App, flag=ap_full_togle.
Iopath(./data).
Pakadd(engine, pak).full(true), ambmode (amb_high4), ambpower(0.3), HDR(true), hdrmaxbright(1.5), hdrexposure (0.7).
}.
/******************************************************************************/.
Bol init().
{.
Sky, set().
Sun &sun=suns. New(), // create a new Sun in suns container.
Sun, set(*gfxs(GFX/sky/sun, GFX)), // set image.
Sun, pos=.vec(-20000,-5800,-5000), // set custom position.
Sun, rays, color, set(0.3f,0.2f,0.1f).
Sun, size=0.2f.
Sun, rays, mode=sun_rays_high.
Clouds, Volumetric, set(gfxs(localdata/cloud, GFX),gfxs(localdata/detail, GFX)).
Clouds, Volumetric, load(localdata/volumetric_clouds).
Meshplane, load(localdata/obj/glider/glider, Mesh).
Meshplane, mirrory().
Setrender().
Matrixplane, setscale (1).
Move (vec(-62,76,34)).
Orn, setrotatey(-1.7f).
Scale (40).
Cam, Matrix.move (vec(0,65,0)).
Cam, setangle (Cam, Matrix.pos,1.57f,0.2f,3.1415f), updatevelocities(), set().
Incx=randomf()/10, incy=randomf()/10, incz=randomf()/10.
Return true.
}.
/******************************************************************************/.
Void Shut().
{.
}.
/******************************************************************************/.
Bol main().
{.
If(kb, bp(kb_esc)) if (indicemenu==0) {return false;} else {indicemenu=0, return true;}.
If ((kb, bp(kb_back)) && (indicemenu==1) && (name, length()>0)) {name, removelast(), return true;}.
If((kb, c()) && (indicemenu==1) && (name, length()<15)) {name+=kb, c(), return true;}.
If (ms, b(0)) actualizarraton(ms, pos).
// if (indicemenu==3) run_game.
Clouds, Volumetric, update (vec2(4,4)).
Return true.
}.
/******************************************************************************/.
Void render().
{.
Switch(renderer()).
{.
Case rm_solid:
Matrixplane, move (vec(incx,incy,incz)).
If ((matrixplane, pos.x>-42) || (matrixplane, pos.x<-82)) incx=-incx.
If ((matrixplane, pues, y>96) || (matrixplane, pues, y<56)) incy=-incy.
If ((matrixplane, pues, z>54) || (matrixplane, pues, z<20)) incz=-incz.
Meshplane, draw(matrixplane).
Break.
}.
}.
Void draw().
{.
Renderer(render).
Textds TDS.
Tds, color=grey_dark.
Tds, scale*=2.
Tds, shadow=64.
Switch (indicemenu) {.
Case 0 : {.
Frep(3) d.text(TDS,0.7f,0.3f-i*0.3f, cctext[i]).
Break.
}.
Case 1 : {.text(TDS,0.75f,0.25f, cctext[6]).
Tds, align, set(1,0).
Tds, color=grey_dark2.
Tds, shadow=0.
If ((int)tm, time ()%2==0) d.text(TDS,0.25f,0,s+name+_), else d.text(TDS,0.25f,0,name).
Break.
}.
Case 2 : {.
Frep (3) {.
If (dificulty==i) {TDS, color=grey_dark2;} else {TDS, color=grey;}.text(TDS,0.7f,0.3f-i*0.3f, cctext[i+3]).
}.
}.
}.
//d.text(0,-0.8,s+ms, pos).
}.
/******************************************************************************/.