List of things I need help with

Posted By: JakeBilbe

List of things I need help with - 05/17/11 16:33

Instead of me keep creating different topics which must annoy others including me! Ill just list what I need help with here.

1. Camera, I want the camera to follow my model but it doesnt do what I want properly, when the model turns so does the camera. I want the camera to always be behind the model and not turning out of view.

2. File path, I have too many files now and I would like to organize them I saw that "pragma_path" is what I need but I am not quite sure how to use this properly?

3. I want to create a main menu, just one that says start, options and exit. I looked on AUM like a member suggested but it listed a script and never gave a location for it.

4. Fullscreen, I have looked for this on search also but can't find any solution to make the game start in fullscreen mode.
Posted By: Schubido

Re: List of things I need help with - 05/17/11 17:02

Hi,

(1) camera that follows player can be done this way :
Code:
assume variable player is the pointer to the player entity ...
... if you move the code in the players action you can replace "player" by "my"


#define CAM_DISTANCE 200 		// distance to player
VECTOR v;				// helper variable for vector

vec_set(camera.x,player.x);		// camera on players position
vec_set(camera.pan,player.pan);		// look same direction as player
vec_for_angle(v, camera.pan);		// get the vector for the direction
vec_normalize(v,CAM_DISTANCE);		// set lenght of vector to distance of camera to player
vec_sub(camera.x,v);			// subtract vector from camera position (= move backwards)



(2)
Have a look into the online manual section Precompiler->#define; PRAGMA_PATH is explained there.
You can also use add_folder(). (necessary if you want to have a directory structure also in the published game)

(3)
Have a look here fore menues LBGUI

(4)
Full screen :
video_screen = 1;
Posted By: JakeBilbe

Re: List of things I need help with - 05/17/11 20:16

Camera is finally sorted grin although it is a little high, as for the rest thank you ever so much laugh.
Posted By: Redeemer

Re: List of things I need help with - 05/18/11 01:04

Schubido, your camera code is unnecessarily complex and difficult to accurately adjust. Here's a better alternative:

Code:
vec_set( camera.x, vector(-100,0,50) ); // change this number to move camera relative to player
vec_rotate( camera.x, player.pan );
vec_add( camera.x, player.x );
vec_set( camera.pan, player.pan );



Also Jake, you can change the video mode at any time during your game by using the video_switch() function.
Posted By: JakeBilbe

Re: List of things I need help with - 05/18/11 08:56

I actually figured Schubido's code out lol, but I shall use that because I might need to change the angle or something later on so thanks. Also what would be a proper jump code? at the moment I am using:

Code:
if (key_space) 
{
me.z +=16; //if space is pressed jump
ent_animate(me,"jump",jump_percentage,ANM_CYCLE);
//ent_playsound(me,woosh,100); //jumping plays woosh sound
}
if (me.z > 52) 
{
c_move(me,vector(0,0,-4.7),nullvector,GLIDE); //if the player is above z.20 then glide down at 0.8 speed, enable collision
//ent_animate(me,"jump",jump_percentage,ANM_CYCLE);
}



also, how can I set video_switch() to (key_o)?
© 2024 lite-C Forums