Gamestudio Links
Zorro Links
Newest Posts
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
NOMAX undeclared identifier.
by Petra. 01/09/26 21:12
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (kzhao, 1 invisible), 3,723 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joe_kane, Namitha_NN, Syndrela, agasior, mosfet
19189 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[Newton] my ball dont turn when move #240671
12/11/08 20:38
12/11/08 20:38
Joined: Jul 2007
Posts: 69
fat32 Offline OP
Junior Member
fat32  Offline OP
Junior Member

Joined: Jul 2007
Posts: 69
hi .
i have ball in my environment and move that by change gravity factor and use "friction " , "mass " but dont turn (glid in the environment ). where is my code have problem .can you tell me .thanks wink

Code:
// ball.wdl 2008-12-09
function main {
	level_load("ball.wmb");
	wait(3);
}
var earthgravity[3]=0,0,-386;

entity* ball_ent;
action ball_act{
	my.polygon=on;
	
	var earthgravity[3] = 0,0, -386;
	ball_ent=me;
	while(me==null){wait(1);}
	var start_pos_tmo;
	phent_settype ( me, PH_RIGID, 0 );

	phent_settype ( me, 0, 0 );
	ph_setgravity( earthgravity );
	phent_settype ( me, PH_RIGID, PH_box );	
	move_car_func();
}

function move_car_func{
	var tmp;
	while(1){
		wait(time);
		if(key_cul){earthgravity.x-=10;wait(5);}
		if(key_cur){earthgravity.x+=10;wait(5);}
		phent_setmass(me, 25, PH_SPHERE);
		ph_setgravity( earthgravity );
		phent_setfriction(my, 10);

		if(key_0){phent_enable( me, 0 );}
		if(key_1){phent_enable( me, 1 );}
		
	}
}


Last edited by fat32; 12/12/08 08:07.

dobidob hosein_dig and max_man7000 game

HAPPY NEW YEAR !!
Re: [Newton] my ball dont turn when move [Re: fat32] #243520
12/30/08 15:03
12/30/08 15:03
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
This does not look like the Newton PH-Engine. It's the build in engine of Gamestudio(you added the prefix NEWTON to your post, remove it. you dont need it for build in related questions)

Dont use the gravity for entity movement. Gravity is a var you want to change if there is a differen gravitation. This var is global(counts for all entities).
use phent_addcentralforce instead.

GReets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Moderated by  HeelX, Spirit 

Gamestudio download | 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