Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 8 1 2 3 4 5 6 7 8
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 Offline OP
Senior Member
maslone1  Offline 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". wink


a new version again:

(comments will follow, but you can ask me if you have questions)

Code:

#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: maslone1] #244622
01/05/09 19:12
01/05/09 19:12
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Next instalment please !!

Drac.

Re: 2.5D Spaceshooter - OpenSource [Re: dracula] #245743
01/11/09 16:41
01/11/09 16:41
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
speak to me !

Drac.

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 Offline OP
Senior Member
maslone1  Offline OP
Senior Member

Joined: Jul 2007
Posts: 424
EUROPE
Hey Drac!

smile smile


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: maslone1] #245931
01/12/09 18:05
01/12/09 18:05
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Thanks, I look forward to it !

Drac.

Re: 2.5D Spaceshooter - OpenSource [Re: dracula] #246109
01/13/09 17:08
01/13/09 17:08
Joined: Dec 2007
Posts: 156
England
ryangregory Offline
Member
ryangregory  Offline
Member

Joined: Dec 2007
Posts: 156
England
Great little demo, I really like it. I could see this making a good game if you develop it further.

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 Offline OP
Senior Member
maslone1  Offline 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: maslone1] #246613
01/15/09 21:08
01/15/09 21:08
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
hi maslone1,
great project!
I got one question though, what is this:
starmap.dds

I know that its an image file, could you maybe upload yours or describe how it should look?

thanks, I'm looking forward to contribute to this nice project.

greetings
xarthor

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 Offline OP
Senior Member
maslone1  Offline 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
Re: 2.5D Spaceshooter - OpenSource [Re: maslone1] #247033
01/18/09 17:42
01/18/09 17:42
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Hi maslone,

Shooting & collisions would be good !

If you got a simple (expandable) game completed, I don't see why Conitec shouldn't ask you to add it to their work folder. The only complete game example there at the moment is Pong. This is crazy. People want starter examples in one place, they shouldn't have to hunt all over the forums, wiki, AUM etc, etc

Drac.

Page 2 of 8 1 2 3 4 5 6 7 8

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1