Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (OptimusPrime, AndrewAMD), 14,580 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 6 of 6 1 2 3 4 5 6
Re: forum code game [Re: 3run] #435184
01/03/14 19:13
01/03/14 19:13
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
party time
Code:
vec_set(camera.x,vec_add(vector(-50-80*sinv(cycle(cycle(player.skill99+=0.05*time_step,0,1)*180,0,180))*player.scale_z*3,0,0),player.x));



Code:
#include <acknex.h>
#define PRAGMA_PATH "%EXE_DIR%\templates\images\"

void doSomething (ENTITY* ent);
void deformTerrain(ENTITY* ent);
void movePlayer();
void moveEnemy();
void drawText3DRotate(STRING* str_txt, VECTOR* pos, COLOR* color);

void main()
{
	warn_level = 6;
	fps_max = 60;
	d3d_lines = 3;
	level_load(NULL);
	camera.x = -96;
	ENTITY* ent=ent_create(CUBE_MDL,nullvector,NULL);
	ENTITY* entTerrain = ent_createterrain(NULL, vector(0, 0, -20), 45, 45, 100);
	
	video_set(sys_metrics(0) * 0.85, sys_metrics(1) * 0.85, 0, 2);
	
	doSomething(ent);
}

void doSomething (ENTITY* ent)
{
	player = ent;
	movePlayer();

	while(1)
	{
		ent.pan+=time_step;
		vec_fill(ent.scale_x, 0.1 + abs(2 * sinv(ent.pan)));
		c_setminmax(ent);
		vec_set(sky_color,vector(random(255),random(255),random(255)));
		ent.z+=random(ent.scale_x*2)-ent.scale_x;	

		if(ent.z-16*ent.scale_z < -32 || ent.z+16*ent.scale_z > exp(log(32)))
		{
			drawText3DRotate("Hold your horses!", ent.x, vector(random(255),random(255),random(255)));
		}
		
		wait(2+floor(random(10)));
	}
}

void deformTerrain(ENTITY* ent)
{
	while(ent != NULL)
	{
		wait(1);
	}
}

void movePlayer()
{
	VECTOR speed;
	vec_zero(speed);
	while(player != NULL)
	{
		speed.y = (key_a - key_d) * 3 * time_step;
		speed.z += (speed.y/time_step*2.5*player.scale_z-speed.z)*0.25*time_step;
		c_move(player,nullvector,vector(0,0,speed.z*time_step),IGNORE_PASSABLE);
		vec_set(camera.x,vec_add(vector(-50-80*sinv(cycle(cycle(player.skill99+=0.05*time_step,0,1)*180,0,180))*player.scale_z*3,0,0),player.x));
		wait(1);
	}
	
}

void drawText3DRotate(STRING* str_txt, VECTOR* pos, COLOR* color)
{
}


Re: forum code game [Re: oliver2s] #435203
01/03/14 20:23
01/03/14 20:23
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
added:
Code:
var i;



Code:
#include <acknex.h>
#define PRAGMA_PATH "%EXE_DIR%\templates\images\"

void doSomething (ENTITY* ent);
void deformTerrain(ENTITY* ent);
void movePlayer();
void moveEnemy();
void drawText3DRotate(STRING* str_txt, VECTOR* pos, COLOR* color);

void main()
{
	warn_level = 6;
	fps_max = 60;
	d3d_lines = 3;
	level_load(NULL);
	camera.x = -96;
	ENTITY* ent=ent_create(CUBE_MDL,nullvector,NULL);
	ENTITY* entTerrain = ent_createterrain(NULL, vector(0, 0, -20), 45, 45, 100);
	
	video_set(sys_metrics(0) * 0.85, sys_metrics(1) * 0.85, 0, 2);
	
	doSomething(ent);
}

void doSomething (ENTITY* ent)
{
	player = ent;
	movePlayer();

	while(1)
	{
		ent.pan+=time_step;
		vec_fill(ent.scale_x, 0.1 + abs(2 * sinv(ent.pan)));
		c_setminmax(ent);
		vec_set(sky_color,vector(random(255),random(255),random(255)));
		ent.z+=random(ent.scale_x*2)-ent.scale_x;	

		if(ent.z-16*ent.scale_z < -32 || ent.z+16*ent.scale_z > exp(log(32)))
		{
			drawText3DRotate("Hold your horses!", ent.x, vector(random(255),random(255),random(255)));
		}
		
		wait(2+floor(random(10)));
	}
}

void deformTerrain(ENTITY* ent)
{
	var i;
	while(ent != NULL)
	{
		wait(1);
	}
}

void movePlayer()
{
	VECTOR speed;
	vec_zero(speed);
	while(player != NULL)
	{
		speed.y = (key_a - key_d) * 3 * time_step;
		speed.z += (speed.y/time_step*2.5*player.scale_z-speed.z)*0.25*time_step;
		c_move(player,nullvector,vector(0,0,speed.z*time_step),IGNORE_PASSABLE);
		vec_set(camera.x,vec_add(vector(-50-80*sinv(cycle(cycle(player.skill99+=0.05*time_step,0,1)*180,0,180))*player.scale_z*3,0,0),player.x));
		wait(1);
	}
	
}

void drawText3DRotate(STRING* str_txt, VECTOR* pos, COLOR* color)
{
}


Page 6 of 6 1 2 3 4 5 6

Gamestudio download | 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