if you play with the a and b values you'll get a somewhat parabolic movement, so you will if you use the last code with the sin equation.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
function shoot(){
if (go == true){
float middle_virtual_x;
float middle_virtual_z;
middle_virtual_x = (IntToFloat(stat_mouse_x) - 200.0)/75.0;
middle_virtual_z = (150.0 - IntToFloat(stat_mouse_y))/75.0;
if (middle_virtual_x == 0.0) middle_virtual_x = 0.1;
if (middle_virtual_z == 0.0) middle_virtual_z = 0.1;
float tan1 = 50.0 /middle_virtual_x;
if (tan1 <= -0.75) {
if (person[cBall.ID].virtual_x < -200.0){
go = false;
return;
}
}
if (tan1 >= 0.75) {
if (person[cBall.ID].virtual_x > 200.0){
go = false;
return;
}
}
float tan2 = 50.0 /middle_virtual_z;
if (tan2 <= -1.0) {
if (person[cBall.ID].virtual_z < -150.0){
go = false;
return;
}
}
if (tan2 >= 1.0) {
if (person[cBall.ID].virtual_z > 150.0){
go = false;
return;
}
}
if (person[cBall.ID].virtual_y > 150.0){
go = false;
return;
}
person[cBall.ID].virtual_y++;
person[cBall.ID].virtual_x = person[cBall.ID].virtual_y /tan1;
person[cBall.ID].virtual_z = person[cBall.ID].virtual_y /tan2;
cBall.y = 150 - FloatToInt(person[cBall.ID].virtual_y);
cBall.x = 200 + (FloatToInt(person[cBall.ID].virtual_x) *GetScalingAt(200, FloatToInt(person[cBall.ID].virtual_y)) /100);
cBall.z = 150 + (FloatToInt(person[cBall.ID].virtual_z) *GetScalingAt(200, FloatToInt(person[cBall.ID].virtual_y)) /100);
}
}
...
else if (mouse.Mode == eModeAim) {
person[cBall.ID].virtual_x = 0.0;
person[cBall.ID].virtual_y = 0.0;
person[cBall.ID].virtual_z = 0.0;
stat_mouse_x = mouse.x;
stat_mouse_y = mouse.y;
go = true;
}
.. in room script
function room_RepExec(){
shoot();
}
QuoteWhat bothers me is when you have a shitload of inventory items that will solve a particular puzzle logically but only one ridiculous solution works. A perfect example of this is going back to the crowbar thing. I've played so many games where you'll have 2-3 items in your inventory that could be used to pry something open (a hammer, a metal pipe, a common screwdriver), but then you need to specifically find a crowbar to do it.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.078 seconds with 14 queries.