hedgewars/GSHandlers.inc
changeset 3342 b4f01613dcd7
parent 3320 506f7d6a82b3
child 3350 5cd02aafc612
equal deleted inserted replaced
3341:3de60a5986e9 3342:b4f01613dcd7
  3024 
  3024 
  3025         DeleteGear(Gear);
  3025         DeleteGear(Gear);
  3026         exit
  3026         exit
  3027     end;
  3027     end;
  3028 end;
  3028 end;
       
  3029 
       
  3030 procedure doStepPortal(Gear: PGear);
       
  3031 begin
       
  3032 (*
       
  3033 A portal will have a few things it does.
       
  3034 1) At first, it will move through the air until it collides with a surface. Once it does, it will stop.  At this point we might try a check to verify there is enough terrain for it to be spawned against, and delete. Or we could just let it kinda stick out for now.
       
  3035 
       
  3036 2) From then on, if doStepPortal is called and a gear of a radius less than or equal to the portal is within X pixels of the portal (we could also check on moving toward the portal I guess, depends how accurate this needs to be) the portal will then locate the first other portal of the opposite type (there should only be one other one), and move that gear's X/Y to that other portal's location, and modify dX/dY to be relative to that other portal's orientation relative to this portal's orientation.  This might require some tweaking with offsets of a few pixels to avoid getting gears stuck in land.
       
  3037 
       
  3038 3) At end of turn, all gtPortal will be deleted.
       
  3039 
       
  3040 *)
       
  3041 end;
       
  3042 procedure doStepPortalGun(Gear: PGear);
       
  3043 begin
       
  3044 (*
       
  3045 Ok. Here's where I plan to go with this.
       
  3046 1) Restrict portal gun to X shots.
       
  3047 2) If on first shot, delete all existing gtPortal
       
  3048 3) On any other shot, delete any existing portals of type X%2, and spawn a new portal of type X%2 oriented at angle 180° from the portal gun.  It might possibly be worth linking portals with a Gear reference, to save time on scanning through the Gear list every time we need a portal.
       
  3049 *)
       
  3050 end;