|
Re: 2.5D Spaceshooter - OpenSource
[Re: maslone1]
#240825
12/12/08 20:04
12/12/08 20:04
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
u wont believe me, but "you could use this code" for a game like gta 1 or gta 2. with some new variables and functions it would be possble. but we create a "space-game". a new version again: (comments will follow, but you can ask me if you have questions)
#include <acknex.h>
#include <default.c>
BMAP* star_map = "star.pcx";
BMAP* star_map2= "starmap.dds";
var star_gen_pos[3];
var star_map_pos[25][3];
ENTITY* plSHIP;
TEXT* help = {
string = "TEST-PROGRAMM - CREATED BY MARCEL KLEE";
red = 255; green=55; blue=55;
flags=VISIBLE;
}
function plActor();
function part_alphafade(PARTICLE *p);
function effect_explo(PARTICLE *p);
function main(){
video_mode = 6; // create a program window of 640x480 pixels
//Load the Environment
level_load("");
wait(3);
fps_max=60;
ent_create("s1.mdl", vector(0,0,0),plActor);
}
function plActor()
{
plSHIP = me;
var vecPos[3] = {0,0,0};
var vecSpeed[3] = {0,0,0};
var vecAng[3] = {0,0,0};
var vecForce1[3] = {0,0,0};
var mySpeed = 0;
var facCamAbst;
var shipmass = 80; //80tons
while(1){
mySpeed += key_force.y*time_step/shipmass;
vecSpeed[1] += mySpeed*cos(my.pan);
vecSpeed[2] += mySpeed*sin(my.pan);
vecSpeed[3] = 0;
vecAng[1] -= key_force.x*15*time_step;
vec_add(vecPos[1], vecSpeed[1]);
accelerate(mySpeed, 0, 0.05);
accelerate(vecSpeed[1], 0, 0.05);
accelerate(vecSpeed[2], 0, 0.05);
accelerate(vecSpeed[3], 0, 0.05);
vecForce1[1] -= mySpeed*key_force.x/shipmass*cos(my.pan-90);
vecForce1[2] -= mySpeed*key_force.x/shipmass*sin(my.pan-90);
vecForce1[3] = 0;
vec_add(vecPos[1], vecForce1[1]);
accelerate(vecForce1[1], 0, 0.05);
accelerate(vecForce1[2], 0, 0.05);
accelerate(vecForce1[3], 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 + 550 + facCamAbst;
camera.tilt= -90;
camera.roll= 0;
camera.pan = 0;
facCamAbst = mySpeed*15*shipmass;
facCamAbst = abs(facCamAbst);
vec_set(star_gen_pos[1],my.x);
if(num_particles < 300) { effect(effect_explo,50 * time_step,star_gen_pos[1],normal); }
wait(1);
}
}
////////////////////////////////////
function part_alphafade(PARTICLE *p)
{
var distanz;
var rand_alpha;
p.alpha = 1;
rand_alpha = random(100)-50;
if(p.alpha < rand_alpha) { p.alpha+=1;}
p.lifespan = 1;
distanz = vec_dist(p.x, plSHIP.x);
if(num_particles > 1000) { p.lifespan = 0; }
if(distanz > 600) { p.lifespan = 0; }
}
function effect_explo(PARTICLE *p)
{
var temp[3];
p.lifespan = random(500) - 200;
p.x = star_gen_pos[1] + random(600) - random(600);
p.y = star_gen_pos[2] + random(600) - random(600);
p.z = star_gen_pos[3] + random(600) - random(600);
p.size = random(8)-4;
p.alpha = 50 + random(25);
p.bmap = star_map;
p.flags |= (BRIGHT | TRANSLUCENT);
p.event = part_alphafade;
}
the star-field looks better now (i think so, but you can tell me if u dont like it) greetings marcel
Last edited by maslone1; 12/12/08 21:25.
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: 2.5D Spaceshooter - OpenSource
[Re: dracula]
#245743
01/11/09 16:41
01/11/09 16:41
|
Joined: Apr 2008
Posts: 437
dracula
Senior Member
|
Senior Member
Joined: Apr 2008
Posts: 437
|
|
|
|
Re: 2.5D Spaceshooter - OpenSource
[Re: dracula]
#245923
01/12/09 17:43
01/12/09 17:43
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Hey Drac! sorry for my late answere...(i have lot of other work to do) i will integrate new things if i find time again. But feel free to try scripting some new functions. cu Marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: 2.5D Spaceshooter - OpenSource
[Re: ryangregory]
#246565
01/15/09 17:35
01/15/09 17:35
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
hey ryangregory!
thanx, but what demo u mean??
I had a look at your website, i realy like your conzept-art! Realy nice work!
cheers! Marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: 2.5D Spaceshooter - OpenSource
[Re: Xarthor]
#247031
01/18/09 17:35
01/18/09 17:35
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Hi Xarthor!
The starmap.dds have no function in this version of the code. Maybe i'll use it for a new version of the star-filed... maybe.
I am sorry, i havent continued the work for this project. I have to complete an another project first.
CU Marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
|