Hey there!
I've started a little opne-source project for the 3dgs-users.
I started this little project for the newbies.
It should help to learn scripting little projects.
here is the first version of the code.
#include <acknex.h>
#include <default.c>
TEXT* help = {
string = "TEST-PROGRAMM - CREATED BY MARCEL KLEE";
red = 255; green=255; blue=255;
flags=VISIBLE;
}
function plActor();
function main(){
fps_max=60;
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.2);
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;
facCamAbst = abs(facCamAbst);
wait(1);
}
}
with the arrow-keys you can handle the ship.
There is no level yet, so you can't see the ship-movement.
But you can load a level you made.
Some new code will follow...
cheers
Marcel