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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (kzhao, AndrewAMD), 652 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
NICE MARBLE BALST ACTION CLONE ;) #129527
05/12/07 13:44
05/12/07 13:44
Joined: Apr 2007
Posts: 29
R
Raymaker Offline OP
Newbie
Raymaker  Offline OP
Newbie
R

Joined: Apr 2007
Posts: 29
this is the code for the marble blast clone.
Apply this action to any object and add this vars:

HOPE YOU LIKE IT!!!

var ball_rotation[3];
var cam_rot[5];
var angcam_rot;
var ball_rotation2[3]



;Code:
 action ball
phent_settype(my,PH_RIGID,PH_SPHERE);
phent_setmass(my,15,PH_SPHERE);
phent_setdamping(my,5,5);
phent_setfriction(my,80);
while(1){
ball_rotation.x=0;
ball_rotation.y=0;
ball_rotation.z=0;
ball_rotation2.x=0;
ball_rotation2.y=0;
ball_rotation2.z=0;


cam_rot.pan-=2*key_a;
cam_rot.pan+=2*key_d;

angcam_rot=ang(cam_rot);


camera.x=my.x-500*cos(cam_rot);
camera.y=my.y-500*sin(cam_rot);
camera.z=my.z+250;

vec_set(my_posi,my.x);
vec_sub(my_posi,camera.x);
vec_to_angle(camera.pan,my_posi);

if(abs(angcam_rot)<=90)
{

if(angcam_rot<0){
ball_rotation.x=(90-abs(angcam_rot))*key_force.x;
ball_rotation.y=-abs(angcam_rot)*key_force.x;
ball_rotation2.y=(90-abs(angcam_rot))*key_force.y;
ball_rotation2.x=abs(angcam_rot)*key_force.y;
}if(angcam_rot>0){


ball_rotation.x=(90-abs(angcam_rot))*key_force.x;
ball_rotation.y=abs(angcam_rot)*key_force.x;
ball_rotation2.y=(90-abs(angcam_rot))*key_force.y;
ball_rotation2.x=-abs(angcam_rot)*key_force.y;
}

}

if(abs(angcam_rot)>=90)
{

if(angcam_rot<-90){
ball_rotation.x=-(abs(angcam_rot)-90)*key_force.x;
ball_rotation.y=-(180-abs(angcam_rot))*key_force.x;
ball_rotation2.y=-(abs(angcam_rot)-90)*key_force.y;
ball_rotation2.x=(180-abs(angcam_rot))*key_force.y;
}
if(angcam_rot>90){

ball_rotation.x=-(abs(angcam_rot)-90)*key_force.x;
ball_rotation.y=(180-abs(angcam_rot))*key_force.x;
ball_rotation2.y=-(abs(angcam_rot)-90)*key_force.y;
ball_rotation2.x=-(180-abs(angcam_rot))*key_force.y;
}




}

phent_addtorqueglobal(my,ball_rotation);
phent_addtorqueglobal(my,ball_rotation2);
wait(1);
}

}



Re: NICE MARBLE BALST ACTION CLONE ;) [Re: Raymaker] #129528
05/12/07 18:37
05/12/07 18:37
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
Perhaps a screenshot of it working in action? Just a suggestion


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: NICE MARBLE BALST ACTION CLONE ;) [Re: Trooper119] #129529
05/12/07 19:28
05/12/07 19:28
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
how do you want to show a marble in action?^^

Re: NICE MARBLE BALST ACTION CLONE ;) [Re: Scorpion] #129530
05/15/07 00:01
05/15/07 00:01
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Gif animation :B


Click and join the 3dgs irc community!
Room: #3dgs

Moderated by  adoado, checkbutton, mk_1, Perro 

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