Some fixes in AirRace.c4s

floating-point
Maikel de Vries 2010-09-24 23:03:08 +02:00
parent d11a4f92ec
commit 6b8992fa07
3 changed files with 11 additions and 8 deletions

View File

@ -24,13 +24,13 @@ protected func FxIntFlightTimer(object target, int num, int time)
SetYDir(-Cos(angle, speed), 100); SetYDir(-Cos(angle, speed), 100);
// Check if there is a vehicle - other than this - to explode at. // Check if there is a plane to explode at.
if (time > 40) if (time > 10)
if (FindObject(Find_ID(Plane), Find_Exclude(shooter), Find_Exclude(this), Find_AtPoint())) if (FindObject(Find_ID(Plane), Find_Exclude(shooter), Find_Exclude(this), Find_AtPoint()))
DoFireworks(); DoFireworks();
// Follow nearest other vehicle. // Follow nearest other vehicle.
for (var to_follow in FindObjects(Find_Category(C4D_Vehicle), Find_Exclude(shooter), Find_Exclude(this), Find_Distance(300), Sort_Distance())) for (var to_follow in FindObjects(Find_ID(Plane), Find_Exclude(shooter), Find_Exclude(this), Find_Distance(300), Sort_Distance()))
{ {
// Vehicle must be in 60 degree front wedge. // Vehicle must be in 60 degree front wedge.
var angle = Angle(GetX(), GetY(), to_follow->GetX(), to_follow->GetY()); var angle = Angle(GetX(), GetY(), to_follow->GetX(), to_follow->GetY());
@ -55,7 +55,8 @@ protected func FxIntFlightTimer(object target, int num, int time)
fuel--; fuel--;
} }
func Definition(def) { func Definition(def)
{
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(30,0,0,1),Trans_Rotate(-30,1,0,0),Trans_Scale(1300)),def); SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(30,0,0,1),Trans_Rotate(-30,1,0,0),Trans_Scale(1300)),def);
} }
local Collectible = 1; local Collectible = 1;

View File

@ -70,9 +70,9 @@ protected func FxIntFlightTimer(object target, int num, int time)
SetXDir(Sin(angle, speed), 100); SetXDir(Sin(angle, speed), 100);
SetYDir(-Cos(angle, speed), 100); SetYDir(-Cos(angle, speed), 100);
// Check if there is a vehicle - other than this - to explode at. // Check if there is a plane to explode at.
if (time > 40) if (time > 10)
if (FindObject(Find_Category(C4D_Vehicle), Find_Exclude(shooter), Find_Exclude(this), Find_AtPoint())) if (FindObject(Find_ID(Plane), Find_Exclude(shooter), Find_Exclude(this), Find_AtPoint()))
DoFireworks(); DoFireworks();
var sizemod = ignition*ignition/5; var sizemod = ignition*ignition/5;

View File

@ -19,6 +19,9 @@ protected func Initialize()
// Vegetation. // Vegetation.
PlaceGrass(100); PlaceGrass(100);
// Environment.
CreateObject(Environment_Clouds);
return; return;
} }
@ -130,7 +133,6 @@ protected func PlrHasRespawned(int plr, object cp)
else if (mode & PARKOUR_CP_Respawn) else if (mode & PARKOUR_CP_Respawn)
{ {
var angle = FindPlaneAngle(cp); var angle = FindPlaneAngle(cp);
Log("%v", angle);
plane->StartInstantFlight(angle, 15); plane->StartInstantFlight(angle, 15);
} }
return; return;