|
Game using Physics
#246911
01/17/09 21:45
01/17/09 21:45
|
Joined: Nov 2008
Posts: 41 ????????????
Dansta
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 41
????????????
|
Hi i would like to make a game similar to earthball in the samples folder, but i looked at the script and saw it was too complicated, can anyone have a simpler script and explain it to me please that would be great!
Mmmmmmmmmmmmmmmmmmmmmm...Donuts!!!
|
|
|
Re: Game using Physics
[Re: Dansta]
#246920
01/17/09 22:23
01/17/09 22:23
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
I think that most scripts using physics will be more complicated than the earthball one.
If you find it too complicated post what bits you are struggling to understand and maybe someone can guide you from their.
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: Game using Physics
[Re: Blade280891]
#246926
01/17/09 22:52
01/17/09 22:52
|
Joined: Nov 2008
Posts: 41 ????????????
Dansta
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 41
????????????
|
i got my hands on a script but i dont get this bit can anyone help?
code:ph_setgravity (vector(0, 0, -386)); // set the gravity phent_settype (ball, PH_RIGID, PH_SPHERE); // set the physics entity type phent_setmass (ball, 3, PH_SPHERE); // and its mass phent_setfriction (ball, 80); // set the friction phent_setdamping (ball, 40, 40); // set the damping phent_setelasticity (ball, 50, 20); // set the elasticity while (1) { ball_speed.x = 25 * (key_cur - key_cul); // move the ball using the cursor keys ball_speed.y = 25 * (key_cuu - key_cud); // 25 sets the x / y movement speeds ball_speed.z = 0; // no need to move on the vertical axis phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball camera.x = ball.x - 300; // keep the camera 300 quants behind the ball camera.y = ball.y; // using the same y with the ball camera.z = 1000; // and place it at z = 1000 quants camera.tilt = -60; // make it look downwards wait (1);
Mmmmmmmmmmmmmmmmmmmmmm...Donuts!!!
|
|
|
Re: Game using Physics
[Re: Dansta]
#246927
01/17/09 22:54
01/17/09 22:54
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
That whole section or is there a certain line? Btw don't forget to look up functions in the manual
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: Game using Physics
[Re: Blade280891]
#246930
01/17/09 22:59
01/17/09 22:59
|
Joined: Nov 2008
Posts: 41 ????????????
Dansta
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 41
????????????
|
the manual doesnt help me but iv posted the script
Mmmmmmmmmmmmmmmmmmmmmm...Donuts!!!
|
|
|
Re: Game using Physics
[Re: Dansta]
#246943
01/17/09 23:24
01/17/09 23:24
|
Joined: Dec 2007
Posts: 706 Schortens Germany
Landixus
User
|
User
Joined: Dec 2007
Posts: 706
Schortens Germany
|
we work 1,4 Years on a Ballgame. It is not easy!  you need much time, and we are with 6 PPL. Take a look to newton game dynamics here in the forum. It can help you a bit.
|
|
|
Re: Game using Physics
[Re: Landixus]
#246944
01/17/09 23:25
01/17/09 23:25
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
Tbh if you can't understand it at all you might not be suitable for programming, i assume you have read through the lite-c tutorials.
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: Game using Physics
[Re: Blade280891]
#246949
01/18/09 00:23
01/18/09 00:23
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
The comments are right next to the code they basically explain what each command does and if you can't get the manual's description then i don't know what to say either. Did you read the physics part of the lite-c tut?
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Game using Physics
[Re: GamerX]
#247058
01/18/09 19:40
01/18/09 19:40
|
Joined: Nov 2008
Posts: 41 ????????????
Dansta
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 41
????????????
|
well... the only bits i dont get it the phent parts and the ph_setgravity other than that i no how the cameras work so any help plz?
Mmmmmmmmmmmmmmmmmmmmmm...Donuts!!!
|
|
|
Re: Game using Physics
[Re: Dansta]
#251439
02/13/09 03:35
02/13/09 03:35
|
Joined: Feb 2009
Posts: 9 united states
yourmomma
Newbie
|
Newbie
Joined: Feb 2009
Posts: 9
united states
|
first create an object; then use: phent_settype (ball, PH_RIGID, PH_SPHERE); to register it as a physics item in order for the ball to fall you need to apply an initial gravity use: ph_setgravity (vector(0, 0, -386)); then you can choose the different attributes of the physics item:
phent_setmass (ball, 3, PH_SPHERE); // controlls mass and weight distribution phent_setfriction (ball, 80); // set the friction against other objects phent_setdamping (ball, 40, 40); // set the damping which is air resistance phent_setelasticity (ball, 50, 20); // set the elasticity or bounciness
after you do that it will roll and bounce in order to make it move using controlls you need to use this:
while (1) { ball_speed.x = 25 * (key_cur - key_cul); // move the ball using the cursor keys ball_speed.y = 25 * (key_cuu - key_cud); // 25 sets the x / y movement speeds ball_speed.z = 0; // no need to move on the vertical axis phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball camera.x = ball.x - 300; // keep the camera 300 quants behind the ball camera.y = ball.y; // using the same y with the ball camera.z = 1000; // and place it at z = 1000 quants camera.tilt = -60; // make it look downwards wait (1); }
that pretty much sums up that peice of code.
if you still dont get it I don't know what to tell you.
teenage mutant ninja turtles pwn.
|
|
|
|