equal
deleted
inserted
replaced
3384 end; |
3384 end; |
3385 |
3385 |
3386 procedure doStepPortalShot(newPortal: PGear); |
3386 procedure doStepPortalShot(newPortal: PGear); |
3387 var |
3387 var |
3388 iterator: PGear; |
3388 iterator: PGear; |
3389 begin |
3389 s: hwFloat; |
|
3390 begin |
|
3391 s:= Distance (newPortal^.dX, newPortal^.dY); |
|
3392 |
|
3393 // Adds the hog speed (only that part in/directly against shot direction) |
|
3394 // to the shot speed (which we triple previously btw) |
|
3395 // (This is done my projecting the hog movement vector onto the shot movement vector and then adding the resulting length |
|
3396 // to the scaler) |
|
3397 s := _3 * s + (newPortal^.dX * CurrentHedgehog^.Gear^.dX + newPortal^.dY * CurrentHedgehog^.Gear^.dY ) / s; |
|
3398 newPortal^.dX := newPortal^.dX * s; |
|
3399 newPortal^.dY := newPortal^.dY * s; |
|
3400 |
3390 newPortal^.IntersectGear := nil; |
3401 newPortal^.IntersectGear := nil; |
3391 |
3402 |
3392 if CurrentHedgehog <> nil then |
3403 if CurrentHedgehog <> nil then |
3393 With CurrentHedgehog^ do |
3404 With CurrentHedgehog^ do |
3394 begin |
3405 begin |