Gamestudio Links
Zorro Links
Newest Posts
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
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
0 registered members (), 1,459 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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 | 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