hedgewars/uWorld.pas
changeset 3032 9c190d3c165b
parent 3025 01682ec58eb0
child 3038 4e48c276a468
--- a/hedgewars/uWorld.pas	Sun Mar 21 13:53:47 2010 +0000
+++ b/hedgewars/uWorld.pas	Sun Mar 21 15:50:38 2010 +0000
@@ -44,6 +44,7 @@
 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
 procedure HideMission;
+procedure ShakeCamera(amount: LongWord);
 
 implementation
 uses    uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound, uAmmos, uVisualGears, uChat, uLandTexture, uLand,
@@ -925,6 +926,13 @@
     missionTimer:= 0
 end;
 
+procedure ShakeCamera(amount: LongWord);
+begin
+    amount:= max(1, amount);
+    WorldDx:= WorldDx - amount + LongInt(getRandom(1 + amount * 2));
+    WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2));
+end;
+
 procedure init_uWorld;
 begin
     fpsTexture:= nil;