Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, TraderTom, Akow), 1,388 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bouncing Shells? #29677
06/29/04 09:01
06/29/04 09:01
Joined: Oct 2002
Posts: 760
Sudbury, Ontario, Canada
Shummy_dup1 Offline OP
Developer
Shummy_dup1  Offline OP
Developer

Joined: Oct 2002
Posts: 760
Sudbury, Ontario, Canada
How would I partake in doing such work. Say I have my normal emiter:

Code:
 if(weapon_number==1)//////
{
ent_vertex(temp,765);///vertex shell
CREATE <case.mdl>,temp,Part_shell;
}



Now i got my Shell code where it does the normal random flips out of the case. How could i add physics to this...im thinking on using newtons.

Code:
 function Part_Shell()
{
my.passable = on;
my.metal = on;
my.scale_x *= 0.4;
my.scale_y *= 0.4;
my.scale_z *= 0.4;

// throw part
my._speed_x = random(6) - 3;
my._speed_y = random(6) - 3;
my._speed_z = random(3) + 8;

//reset:
my._aspeed_pan = 0 + random(20);
my._aspeed_tilt = 0 + random(70);
my._aspeed_roll = 0;

MY.PAN = YOUR.PAN;
MY.TILT = YOUR.TILT;

//Animate
my.skill9 = 20 + random(50);

while(my.skill9 > -16)
{
move_mode=ignore_models;
abspeed[0] = my._speed_x * time;
abspeed[1] = my._speed_y * time;
abspeed[2] = my._speed_z * time;

my.pan += my._aspeed_pan * time;
my.tilt += my._aspeed_tilt * time;
my.roll += my._aspeed_roll * time;

vec_scale(absdist,movement_scale); // scale absolute distance by movement_scale
move(my,nullvector,abspeed);

if(bounce.z)
{
my._speed_z = -(my._speed_z/2);
if(my._speed_z < 0.25)
{
my._speed_x = 0;
my._speed_y = 0;
my._speed_z = 0;
my._aspeed_pan = 0;
my._aspeed_tilt = 0;
my._aspeed_roll = 0;
}
}

my._speed_z -= 2*time;
my.skill9 -= 1;

//fade out:

my.alpha -= 2*time;
if(my.alpha <=0)
{
//remove
wait(1);
remove(me);


}
wait(1);
}

}



Any ideas...i want it to bounce on ground i can call a sound....and then remove(me);

Thanks.


version 4 simple www.ebsdesign.com stay updated on the aftermath click here for the gallery
Re: Bouncing Shells? [Re: Shummy_dup1] #29678
07/01/04 08:39
07/01/04 08:39
Joined: May 2004
Posts: 94
United States
not_my_name Offline
Junior Member
not_my_name  Offline
Junior Member

Joined: May 2004
Posts: 94
United States
Newtons Physics are excelent and easy to use, but this forum is strictly for A6 physics engine. if you cannot find your answer with this physics engine, newton is much easier, if you can figure out how to implement it in realtime. Give newton a try, and post questions at newtons forum.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1