Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, vicknick, VoroneTZ, BrainSailor), 827 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Kugel mit realer Physic [Re: Kai008] #153059
09/13/07 19:32
09/13/07 19:32
Joined: Feb 2006
Posts: 20
K
Kai008 Offline OP
Newbie
Kai008  Offline OP
Newbie
K

Joined: Feb 2006
Posts: 20
Gibt es vielleicht eine Möglichkeit die Physic kurz zu deaktivieren?
Hab mir eine kleine Steuerschleife geschrieben:

while (1)
{
camera.x = ball.x;
camera.y = ball.y;

if(key_w)
{
ball.y -= 20 * time;
}
if(key_a)
{
ball.x += 20 * time;
}
if(key_d)
{
ball.x -= 20 * time;
}
wait(1);
}

Nichts großartiges aber es funktioniert irgendwie nicht wenn es sich um ein phent handelt. ._."
Deshalb dachte ich dass ich es vor dem Steuern deaktiviere und später wieder aktiviere, da ich vor allem die Schwerkraft brauche.

PS: Ach ja, und wie kann man die Kugel vertikal drehen lassen? Also quasi das Gegenteil von ".pan"? Damit ein Rolleffekt entsteht.

Last edited by Kai008; 09/13/07 19:34.

Scr für my bad Englisch >_<
Re: Kugel mit realer Physic [Re: Kai008] #153060
09/13/07 20:04
09/13/07 20:04
Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
TSG_Torsten Offline

User
TSG_Torsten  Offline

User

Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
ich mache es meistens mit phent_settype(me,0,0); //Deaktiviert die physik
(mit phent_enable hatte ich öfters Probleme)
Dann warte ein Frame, verschiede das Objekt, aktiviere die Physik per

phent_settype(me,PH_RIGID,PH_SPHERE);

wieder.
Danach musst du aber alle Eigenschaften wie Gewicht, Reibung, usw. wieder definieren.

Gruß
TSGames

Re: Kugel mit realer Physic [Re: TSG_Torsten] #153061
09/13/07 20:24
09/13/07 20:24
Joined: Feb 2006
Posts: 20
K
Kai008 Offline OP
Newbie
Kai008  Offline OP
Newbie
K

Joined: Feb 2006
Posts: 20
Schaut jetzt so aus:

entity* ball;
var total_score;

action p_ball
{
ball = my;

my.scale_x = 1.5;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;

def_physic();
}

function def_physic
{
phent_settype (ball, ph_rigid, ph_sphere);
phent_setmass (ball, 80, ph_sphere);
phent_setfriction (ball, 40);
phent_setdamping (ball, 80, 80);
phent_setelasticity (ball, 80, 50);
while(1)
{
vec_set (temp, nullvector);
temp.z = 0;
vec_rotate (temp, vector(camera.pan, 0, 0));
vec_normalize (temp, 200 * time);
phent_addtorqueglobal (ball, temp);
wait (1);
}
}

function main()
{
time_smooth = 0;
fps_max = 140;
fps_lock = on;
load_level("index.wmb");
wait (3);
ph_setgravity (vector(0, 0, -7888));
while (1)
{
phent_settype (ball, 0, 0);
wait(1);

camera.x = ball.x;
camera.y = ball.y;

if(key_w)
{
ball.y -= 20 * time;
}
if(key_a)
{
ball.x += 20 * time;
}
if(key_d)
{
ball.x -= 20 * time;
}
def_physic();
wait(1);
}
wait(1);
}

Aber bekomme den Fehler "Entity not a physics object in def_physic: phent_addtorqueglobal(ball, temp)".


Scr für my bad Englisch >_<
Page 2 of 2 1 2

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