chaging postion of panel

Posted By: DeD

chaging postion of panel - 09/02/09 13:01

how do i change the postion of a panel.
when a enity move past another.
Posted By: Dillinger

Re: chaging postion of panel - 09/03/09 16:06

a bit vauge, but it sounds like you want to make it so the collision area is larger than the model. You can define that the old fashioned way, like in Pong. You know:

if ( ent_pos_X > panelLeftSide && ent_pos_X < panelRightSide
&& ent_pos_Y > panelTop && ent_pos_X < panelBottom )
{
panelName.pos_x = whatever ;
panelName.pos_y = whatever ;
}

OR

instead of a panel, you can use:
ent_create( "myImage.tga" , vector ( 400,0,0 ) , 0 ) ;

Now your bmap is an Entity with all the built in collision detection, etc.
Posted By: DeD

Re: chaging postion of panel - 09/04/09 23:46

its for the postion of a car. so the panel will change when a car is in 1st 2bd 3rd an 4th.

how do i tell the panel this?
Posted By: DJBMASTER

Re: chaging postion of panel - 09/04/09 23:59

You mean like positions in a race? When a car overtakes another one you can just use Panel.pos_x/pos_y in a function.
Posted By: DeD

Re: chaging postion of panel - 09/05/09 00:34

yea i mean like that. i know how the panel moves but i dont know how to tell it to move when the car changes postion.
Posted By: DJBMASTER

Re: chaging postion of panel - 09/05/09 02:04

ahh thats a completely different problem, you want to trigger a function when a car overtakes.

That will most likely involve some tracing/scanning to see what is infront of you. You can check out c_trace/c_scan for that.
© 2024 lite-C Forums