Hey guys smile ,
I'm new here in the forum and would like to learn how to programiert games. grin
I bought a book that something helps me. However, I have the same at the beginning a problem with my script ...

Although the level loads but the function with the camera can not be performed. I thank you in advance for the help.

and sorry for my bad english tired


Script:
Code:
#include <acknex.h>
#include <default.c>

#define WALK_SPEED 5

function moveCamera() {
	
	VECTOR* vecNewAngle = NULL;
	VECTOR* vecNewPosition = NULL;
	
	while(1) {
		vecNewAngle = vector(
			(camera.pan+(key_a-key_d)*time_step*WALK_SPEED)%360,
				0,
				0
			);
		
		vec_set(camera.pan,vecNewAngle);
		
		vecNewPosition = vector(
		camera.x+(key_w-key_s)*cosv(camera.pan)*time_step*WALK_SPEED,
		camera.y+(key_w-key_s)*sinv(camera.pan)*time_step*WALK_SPEED,
		0
		);
		
		vec_set(camera.x, vecNewPosition);
		
		wait(1);	
	}
}

function main() {
	level_load("terrain1.hmp");
	VECTOR* vecPosition = vector(0,0,0);
	ent_create("world1.mdl",vecPosition,NULL);
	moveCamera();
}



Last edited by NiceOneX; 08/31/16 15:50.