Hi people, its my first post on this forum.
Sorry about my poor english language... ^^
I'm developing a game with no templates, and I have some problems with the colision and the jump codes...
The colision problem is: I can move ok, but when I'm moving sometimes I can go inside of objects... and can't move back because its colided...
Other bug in colision is that when I go to a wall, if I stay much close to this the player goes up...

The jump problem is: how can I do that? I'm newbie in the gameprogramming, and no know how it works... need I deactivate de gravity while I'm jumping?

Here is the code of my player:

function andarfc
{
var snd;
if tocando == 0
{
snd=snd_play(andarsnd,70,0);
tocando = 1;
wait(16);
snd_stop(snd);
tocando = 0;
}
}

action Playerprinc
{
var move_var; //We're going to use this as our move vector (X,Y,Z)
var tempmypos;
player = me;
my.invisible = on;
while(1) //while the player object exists
{
move_var.x = 0; //resets them all back to 0
move_var.y = 0; //if we don't do thist hen the variables will addup
move_var.z = 0; //making the player move faster and faster with no stopping

if movimento == 1
{
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 100;
camera.pan = player.pan;
if fase3cn == 0
{player.pan -= sensi*mouse_force.x;
camera.tilt += sensi*mouse_force.y;}
if camera.tilt > 90 {camera.tilt = 90;}
if camera.tilt < -90 {camera.tilt = -90;}

}
tempmypos.x = my.x;
tempmypos.y = my.y;
//tempmypos.z = my.z;
colissssao = c_trace(tempmypos,move_var,ignore_me + ignore_you + ignore_passents + ignore_passable);
vec_set(temp,my.x); //copies the second vector to the first
temp.z -= 8000; //lets make the trace point way way below us
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual
result = trace(my.x,temp);
/* if(result > 5) //if from my pos to temp is greater than 5
{ move_var.z -= gravidade; }*/ //fall speed of 20 (higher number, faster falling speed)
if(result > 100) { show_health -= 1; wait(1);}
if(result <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z += 2; } //not touching the floor but extremely close

if(key_w == on) && (show_health > 0) && (fase3cn == 0) //if we press the up arrow key
{
if (key_shift == on)
{
move_var.x = 8 + fase3; //give the X parameter a value of 4
andarfc();
}
else
{
move_var.x = 4 + fase3; //give the X parameter a value of 4
andarfc();
}
}
if(key_s == on) && (show_health > 0) && (fase3cn == 0) //if we press the down arrow key
{
if (key_shift == on)
{
move_var.x = -6 - fase3; //give the X parameter a value of 4
andarfc();
}
else
{
move_var.x = -2 - fase3; //give the X parameter a value of 4
andarfc();
}
}
if(key_a == on) && (show_health > 0) && (fase3cn == 0) //if we press the left arrow key
{
move_var.y = 4 + fase3; //add to the pan value
andarfc();
}
if(key_d == on) && (show_health > 0) && (fase3cn == 0) //if we press the right arrow key
{
move_var.y = -4 - fase3; //subtract the pan value
andarfc();
}
if(key_space == on) && (pulando == 0) && (show_health > 0) && (fase3cn == 0) //if we press the right arrow key
{
wait(1);
}
if (show_health <= 0)
{
wait(1);
}
move_friction = 0;
c_move(me,move_var,nullvector,IGNORE_PASSABLE+GLIDE+USE_BOX);
wait(1);
}
}

Last edited by Sputnicker; 05/17/07 15:03.