1 registered members (AndrewAMD),
718
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Jumping ball, bad timing
#253872
02/27/09 13:13
02/27/09 13:13
|
Joined: Mar 2008
Posts: 104
theDust
OP
Member
|
OP
Member
Joined: Mar 2008
Posts: 104
|
Hello again. My goal is a ball that should always jump in the same way. At my testlevel the ball is only jumping, no other movement, so its easier to see the problem. When the ball is jumping continuously you see that sometimes the ball is jumping right in the moment when he has touched the ground. But sometimes he sticks to the ground a few millisecs and makes a jump half of the height as the jump before. Here the whole project (keep pressing space to jump, maybe wait a little bit at the beginning until the ball doesn't rotate any more): http://www.file-upload.net/download-1487600/testjump.rar.htmlHere the code:
#include <acknex.h>
#include <default.c>
ENTITY* pointer;
VECTOR jump;
function main()
{
video_screen = 2;
video_mode = 8;
mouse_mode = 1;
fps_max = 60;
wait(-1);
ph_fps_max_lock = 120;
level_load ("level1.wmb");
ph_setgravity (vector(0, 0, -700));
}
function coll() {
jump.x = 0; jump.y = 0; jump.z = 500;
if(key_space )
{
phent_addvelcentral(pointer,jump);
}
}
action playerj()
{
pointer = my;
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
my.event = coll;
phent_settype (pointer, PH_RIGID, PH_SPHERE);
phent_setmass (pointer, 1, PH_SPHERE);
phent_setfriction (pointer, 500);
phent_setdamping (pointer, 50, 50);
phent_setelasticity (pointer, 0, 0);
}
When I raise the ph_fps_max_lock it gets a bit better, but the problem remains. So, help would be great.
|
|
|
Re: Jumping ball, bad timing
[Re: theDust]
#253922
02/27/09 18:40
02/27/09 18:40
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
Random guess; is that because it is using physics ?
My Avatar Randomness V2"Someone get me to the doctor, and someone call the nurse And someone buy me roses, and someone burned the church"
|
|
|
Re: Jumping ball, bad timing
[Re: theDust]
#254147
03/01/09 12:51
03/01/09 12:51
|
Joined: Mar 2008
Posts: 104
theDust
OP
Member
|
OP
Member
Joined: Mar 2008
Posts: 104
|
After intense research, no answers and hours of experimenting, I can assume that the physics from gamestudio are not able to let a object jump properly(!). Or maybe: Im not able to let a object jump properly. So please, let's fill this ridiculous knowledge gap PS: And no, I can't try to use newton, because I can't update my A7-version, because I can't download the update, because someone has ruined my adsl and downloading 1 mb needs 2 hours (and costs 2 €)
Last edited by theDust; 03/01/09 12:52.
|
|
|
|