hey there!

a new version. it inludes a star-field now...
its the first version of the star-field.

you only have to create a pcx map with the a pixel-size of 24x24. the color should be white. the name of the pcx file: "star.pcx"

the code:

Code:
 



#include <acknex.h>
#include <default.c>

BMAP* star_map = "star.pcx";

var star_gen_pos[3];


TEXT* help = {
	string = "TEST-PROGRAMM - CREATED BY MARCEL KLEE";
	red = 255; green=255; blue=255;
	flags=VISIBLE;
}


function plActor();
function part_alphafade(PARTICLE *p);
function effect_explo(PARTICLE *p);





function main(){
	fps_max=60;
vec_set(screen_color,vector(1,1,1)); 

	wait(1);
	
	//Load the Environment
	level_load("");
	

	wait(3);
		
				
	ent_create("s1.mdl", vector(0,0,0),plActor);
		

}





function plActor()
{



var vecPos[3]   = {0,0,0};
var vecSpeed[3] = {0,0,0};
var vecAng[3]   = {0,0,0};

var mySpeed = 0;
var facCamAbst;

while(1){
mySpeed += key_force.y*time_step;
vecSpeed[1] = mySpeed*cos(my.pan);
vecSpeed[2] = mySpeed*sin(my.pan);
vecSpeed[3] = 0;

vecAng[1] -= key_force.x*10*time_step;

vec_add(vecPos[1], vecSpeed[1]);
accelerate(mySpeed, 0, 0.05);


my.pan  = vecAng[1];
my.tilt = 0;
my.roll = 0;

my.x = vecPos[1];
my.y = vecPos[2];
my.z = vecPos[3];

camera.x = my.x;
camera.y = my.y;
camera.z = my.z + 250 + facCamAbst;
camera.tilt= -90;
camera.roll= 0;
camera.pan = 0;

facCamAbst = mySpeed*12;
facCamAbst = abs(facCamAbst);
		
		vec_set(star_gen_pos[1],my.x);

effect(effect_explo,10 * time_step,star_gen_pos[1],normal);


wait(1);
 }
}



////////////////////////////////////



function part_alphafade(PARTICLE *p)
{

     
if(num_particles > 300) {   p.lifespan -= 1*time_step; p.alpha -= 1*time_step; }   


}

function effect_explo(PARTICLE *p)
{
   var temp[3];
   p.lifespan = random(500) - 200;

   p.x = star_gen_pos[1] + random(400) - random(400);
   p.y = star_gen_pos[2] + random(400) - random(400);
   p.z = star_gen_pos[3] + random(400) - random(400);
   p.size = random(8)-4;
   
   p.alpha = 50 + random(25);
   p.bmap = star_map;
   p.flags |= (BRIGHT | TRANSLUCENT);
   p.event = part_alphafade; 
}






next i will optimize the code and create a background. the ship-physic will get more "realistic".

cu
marcel


A8c, Blender, FlStudio, Unity3d