Eren Yilmaz 6 роки тому
коміт
4dee4b3cf8
74 змінених файлів з 8096 додано та 0 видалено
  1. 82 0
      .gitignore
  2. 16 0
      BringRandomazeToFront.ahk
  3. BIN
      DelphiSockets.res
  4. BIN
      Not Used/ExploLane.jpg
  5. 144 0
      Randomaze.dof
  6. 28 0
      Randomaze.dpr
  7. 186 0
      Randomaze.dproj
  8. BIN
      Randomaze.res
  9. 621 0
      Randomaze/ChangeLog.txt
  10. 21 0
      Randomaze/HowToPlay.txt
  11. 1 0
      Randomaze/NetworkLog.txt
  12. 52 0
      Randomaze/PanelConfigs.ini
  13. 254 0
      Randomaze/Roomtypes.ini
  14. 101 0
      Randomaze/Settings.ini
  15. 18 0
      Randomaze/Special Thanks.txt
  16. 3 0
      Randomaze/SystemRequirements.txt
  17. BIN
      Randomaze/Texturen/Arrow.jpg
  18. BIN
      Randomaze/Texturen/ArrowSpawner.jpg
  19. BIN
      Randomaze/Texturen/Background.jpg
  20. BIN
      Randomaze/Texturen/BlackExplosion.jpg
  21. BIN
      Randomaze/Texturen/BlueSpeed.jpg
  22. BIN
      Randomaze/Texturen/Bonbon.jpg
  23. BIN
      Randomaze/Texturen/Ceiling.jpg
  24. BIN
      Randomaze/Texturen/CeilingLowRes.jpg
  25. BIN
      Randomaze/Texturen/ContaminationDown.jpg
  26. BIN
      Randomaze/Texturen/ContaminationUp.jpg
  27. BIN
      Randomaze/Texturen/Explosion.jpg
  28. BIN
      Randomaze/Texturen/Goal.jpg
  29. BIN
      Randomaze/Texturen/Grass.jpg
  30. BIN
      Randomaze/Texturen/GreenSpeed.jpg
  31. BIN
      Randomaze/Texturen/GreenWall.jpg
  32. BIN
      Randomaze/Texturen/HalfWall.jpg
  33. BIN
      Randomaze/Texturen/InkDown.jpg
  34. BIN
      Randomaze/Texturen/InkUp.jpg
  35. BIN
      Randomaze/Texturen/Lightning.jpg
  36. BIN
      Randomaze/Texturen/Muh.jpg
  37. BIN
      Randomaze/Texturen/PortDownUp.jpg
  38. BIN
      Randomaze/Texturen/PortUpDown.jpg
  39. BIN
      Randomaze/Texturen/PusherDown.jpg
  40. BIN
      Randomaze/Texturen/PusherUp.jpg
  41. BIN
      Randomaze/Texturen/RandomSpeed.jpg
  42. BIN
      Randomaze/Texturen/RedSpeed.jpg
  43. BIN
      Randomaze/Texturen/Turner.jpg
  44. BIN
      Randomaze/Texturen/Wall.jpg
  45. BIN
      Randomaze/Texturen/YSNP.jpg
  46. BIN
      Randomaze/Texturen/grey.jpg
  47. BIN
      Randomaze/Wall.ico
  48. 4 0
      Randomaze/reini.bat
  49. 2 0
      Randomaze/restart.bat
  50. BIN
      Randomaze_Icon.ico
  51. BIN
      Randomaze_Icon1.ico
  52. BIN
      Randomaze_Icon2.ico
  53. BIN
      Randomaze_Icon3.ico
  54. 616 0
      Spielprofile.xml
  55. 25 0
      UCadencer.dfm
  56. 536 0
      UCadencer.pas
  57. 125 0
      UCheckmaze.pas
  58. 46 0
      UColorByID.pas
  59. 182 0
      UCreateRaum.pas
  60. 736 0
      UIni.pas
  61. 215 0
      UMainMenu.pas
  62. 37 0
      UMaterials.dfm
  63. 141 0
      UMaterials.pas
  64. 65 0
      UMessageThread.pas
  65. 442 0
      UMoveToRoom.pas
  66. 298 0
      UMyUtils.pas
  67. 44 0
      UNetwork.dfm
  68. 893 0
      UNetwork.pas
  69. 405 0
      Unit1.dfm
  70. 1753 0
      Unit1.pas
  71. 1 0
      Unit1.vlb
  72. 1 0
      falling calculation.gcw
  73. 1 0
      jumping calculation.gcw
  74. 1 0
      jumpstrength.gcw

+ 82 - 0
.gitignore

@@ -0,0 +1,82 @@
+# links
+*.lnk
+
+# old archive files
+/Old
+
+# other archive fiels
+*.rar
+
+# dont know what this is
+*.dd
+
+
+
+# Uncomment these types if you want even more clean repository. But be careful.
+# It can make harm to an existing project source. Read explanations below.
+#
+# Resource files are binaries containing manifest, project icon and version info.
+# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
+#*.res
+#
+# Type library file (binary). In old Delphi versions it should be stored.
+# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
+#*.tlb
+#
+# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
+# Uncomment this if you are not using diagrams or use newer Delphi version.
+*.ddp
+#
+# Visual LiveBindings file. Added in Delphi XE2.
+# Uncomment this if you are not using LiveBindings Designer.
+#*.vlb
+#
+# Deployment Manager configuration file for your project. Added in Delphi XE2.
+# Uncomment this if it is not mobile development and you do not use remote debug feature.
+#*.deployproj
+# 
+# C++ object files produced when C/C++ Output file generation is configured.
+# Uncomment this if you are not using external objects (zlib library for example).
+#*.obj
+#
+
+# Delphi compiler-generated binaries (safe to delete)
+*.exe
+*.dll
+*.bpl
+*.bpi
+*.dcp
+*.so
+*.apk
+*.drc
+*.map
+*.dres
+*.rsm
+*.tds
+*.dcu
+*.lib
+*.a
+*.o
+*.ocx
+
+# Delphi autogenerated files (duplicated info)
+*.cfg
+*.hpp
+*Resource.rc
+
+# Delphi local files (user-specific info)
+*.local
+*.identcache
+*.projdata
+*.tvsconfig
+*.dsk
+
+# Delphi history and backups
+__history/
+__recovery/
+*.~*
+
+# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
+*.stat
+Contact GitHub API Training Shop Blog About
+© 2017 GitHub, Inc. Terms Privacy Security Status Help

+ 16 - 0
BringRandomazeToFront.ahk

@@ -0,0 +1,16 @@
+;
+; AutoHotkey Version: 1.x
+; Language:       English
+; Platform:       Win9x/NT
+; Author:         A.N.Other <myemail@nowhere.com>
+;
+; Script Function:
+;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
+;
+
+#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
+SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
+SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
+
+
+WinActivate, Randomaze, 

BIN
DelphiSockets.res


BIN
Not Used/ExploLane.jpg


+ 144 - 0
Randomaze.dof

@@ -0,0 +1,144 @@
+[FileVersion]
+Version=7.0
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+NamespacePrefix=
+SymbolDeprecated=1
+SymbolLibrary=1
+SymbolPlatform=1
+UnitLibrary=1
+UnitPlatform=1
+UnitDeprecated=1
+HResultCompat=1
+HidingMember=1
+HiddenVirtual=1
+Garbage=1
+BoundsError=1
+ZeroNilCompat=1
+StringConstTruncated=1
+ForLoopVarVarPar=1
+TypedConstVarPar=1
+AsgToTypedConst=1
+CaseLabelRange=1
+ForVariable=1
+ConstructingAbstract=1
+ComparisonFalse=1
+ComparisonTrue=1
+ComparingSignedUnsigned=1
+CombiningSignedUnsigned=1
+UnsupportedConstruct=1
+FileOpen=1
+FileOpenUnitSrc=1
+BadGlobalSymbol=1
+DuplicateConstructorDestructor=1
+InvalidDirective=1
+PackageNoLink=1
+PackageThreadVar=1
+ImplicitImport=1
+HPPEMITIgnored=1
+NoRetVal=1
+UseBeforeDef=1
+ForLoopVarUndef=1
+UnitNameMismatch=1
+NoCFGFileFound=1
+MessageDirective=1
+ImplicitVariants=1
+UnicodeToLocale=1
+LocaleToUnicode=1
+ImagebaseMultiple=1
+SuspiciousTypecast=1
+PrivatePropAccessor=1
+UnsafeType=0
+UnsafeCode=0
+UnsafeCast=0
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=16777216
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=B:\Randomaze\Randomaze
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=
+Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;dclOfficeXP;GLS_ODE7;GLCg7;GLSS_BASS7;GLSS_OpenAL7
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=
+UseLauncher=0
+DebugCWD=
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=0
+MajorVer=2
+MinorVer=166
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+[Version Info Keys]
+CompanyName=
+FileDescription=Randomaze
+FileVersion=2.166.0.0
+InternalName=Randomaze
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=Randomaze.exe
+ProductName=Randomaze
+ProductVersion=1.0.0.0
+Comments=Made by EBY aka Eror
+[Excluded Packages]
+c:\program files (x86)\borland\delphi7\Bin\dclIntraweb_50_70.bpl=Intraweb 5.0 Design Package for Delphi 7
+[HistoryLists\hlUnitAliases]
+Count=1
+Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=B:\Randomaze\Randomaze

+ 28 - 0
Randomaze.dpr

@@ -0,0 +1,28 @@
+program Randomaze;
+
+uses
+  Forms,
+  Unit1 in 'Unit1.pas' {Form1},
+  UMaterials in 'UMaterials.pas' {Form2},
+  UNetwork in 'UNetwork.pas' {Form3},
+  UCadencer in 'UCadencer.pas' {Form4},
+  UMoveToRoom in 'UMoveToRoom.pas',
+  UColorByID in 'UColorByID.pas',
+  UCreateRaum in 'UCreateRaum.pas',
+  UCheckmaze in 'UCheckmaze.pas',
+  UMessageThread in 'UMessageThread.pas',
+  UIni in 'UIni.pas',
+  UMainMenu in 'UMainMenu.pas',
+  UMyUtils in 'UMyUtils.pas';
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.Title := 'Randomaze';
+  Application.CreateForm(TForm1, Form1);
+  Application.CreateForm(TForm2, Form2);
+  Application.CreateForm(TForm3, Form3);
+  Application.CreateForm(TForm4, Form4);
+  Application.Run;
+end.

+ 186 - 0
Randomaze.dproj

@@ -0,0 +1,186 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{E6DE0F7D-417A-4E34-BC92-0EC5CAF6DD77}</ProjectGuid>
+        <MainSource>Randomaze.dpr</MainSource>
+        <Base>True</Base>
+        <Config Condition="'$(Config)'==''">Debug</Config>
+        <TargetedPlatforms>1</TargetedPlatforms>
+        <AppType>Application</AppType>
+        <FrameworkType>VCL</FrameworkType>
+        <ProjectVersion>14.6</ProjectVersion>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+        <Base_Win32>true</Base_Win32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+        <Base_Win64>true</Base_Win64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
+        <Cfg_1>true</Cfg_1>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+        <Cfg_1_Win32>true</Cfg_1_Win32>
+        <CfgParent>Cfg_1</CfgParent>
+        <Cfg_1>true</Cfg_1>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
+        <Cfg_2>true</Cfg_2>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+        <Cfg_2_Win32>true</Cfg_2_Win32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base)'!=''">
+        <Manifest_File>None</Manifest_File>
+        <Icon_MainIcon>Randomaze_Icon3.ico</Icon_MainIcon>
+        <VerInfo_MinorVer>168</VerInfo_MinorVer>
+        <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <VerInfo_MajorVer>3</VerInfo_MajorVer>
+        <VerInfo_Keys>CompanyName=;FileDescription=Randomaze;FileVersion=3.168.0.0;InternalName=Randomaze;LegalCopyright=;LegalTrademarks=;OriginalFilename=Randomaze.exe;ProductName=Randomaze;ProductVersion=1.0.0.0;Comments=Made by EBY aka Eror</VerInfo_Keys>
+        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+        <DCC_MaxStackSize>16777216</DCC_MaxStackSize>
+        <DCC_F>false</DCC_F>
+        <DCC_ExeOutput>C:\Users\Eren\Randomaze\Randomaze\</DCC_ExeOutput>
+        <DCC_N>true</DCC_N>
+        <DCC_E>false</DCC_E>
+        <DCC_S>false</DCC_S>
+        <DCC_ImageBase>00400000</DCC_ImageBase>
+        <DCC_K>false</DCC_K>
+        <DCC_UsePackage>vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;dclOfficeXP;GLS_ODE7;GLCg7;GLSS_BASS7;GLSS_OpenAL7;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win32)'!=''">
+        <DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=3.168.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+        <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win64)'!=''">
+        <Icon_MainIcon>Randomaze_Icon3.ico</Icon_MainIcon>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1)'!=''">
+        <DCC_DebugInformation>false</DCC_DebugInformation>
+        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=3.168.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+        <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2)'!=''">
+        <DCC_ExeOutput>C:\Users\Eren\Randomaze\Randomaze\</DCC_ExeOutput>
+        <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+        <DCC_Optimize>false</DCC_Optimize>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+        <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+    </PropertyGroup>
+    <ItemGroup>
+        <DelphiCompile Include="$(MainSource)">
+            <MainSource>MainSource</MainSource>
+        </DelphiCompile>
+        <DCCReference Include="Unit1.pas">
+            <Form>Form1</Form>
+        </DCCReference>
+        <DCCReference Include="UMaterials.pas">
+            <Form>Form2</Form>
+        </DCCReference>
+        <DCCReference Include="UNetwork.pas">
+            <Form>Form3</Form>
+        </DCCReference>
+        <DCCReference Include="UCadencer.pas">
+            <Form>Form4</Form>
+        </DCCReference>
+        <DCCReference Include="UMoveToRoom.pas"/>
+        <DCCReference Include="UColorByID.pas"/>
+        <DCCReference Include="UCreateRaum.pas"/>
+        <DCCReference Include="UCheckmaze.pas"/>
+        <DCCReference Include="UMessageThread.pas"/>
+        <DCCReference Include="UIni.pas"/>
+        <DCCReference Include="UMainMenu.pas"/>
+        <DCCReference Include="UMyUtils.pas"/>
+        <BuildConfiguration Include="Debug">
+            <Key>Cfg_2</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Base">
+            <Key>Base</Key>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Release">
+            <Key>Cfg_1</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Delphi.Personality>
+                <Source>
+                    <Source Name="MainSource">Randomaze.dpr</Source>
+                </Source>
+                <VersionInfo>
+                    <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
+                    <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+                    <VersionInfo Name="MajorVer">2</VersionInfo>
+                    <VersionInfo Name="MinorVer">166</VersionInfo>
+                    <VersionInfo Name="Release">0</VersionInfo>
+                    <VersionInfo Name="Build">0</VersionInfo>
+                    <VersionInfo Name="Debug">False</VersionInfo>
+                    <VersionInfo Name="PreRelease">False</VersionInfo>
+                    <VersionInfo Name="Special">False</VersionInfo>
+                    <VersionInfo Name="Private">False</VersionInfo>
+                    <VersionInfo Name="DLL">False</VersionInfo>
+                    <VersionInfo Name="Locale">1033</VersionInfo>
+                    <VersionInfo Name="CodePage">1252</VersionInfo>
+                </VersionInfo>
+                <VersionInfoKeys>
+                    <VersionInfoKeys Name="CompanyName"/>
+                    <VersionInfoKeys Name="FileDescription">Randomaze</VersionInfoKeys>
+                    <VersionInfoKeys Name="FileVersion">2.166.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="InternalName">Randomaze</VersionInfoKeys>
+                    <VersionInfoKeys Name="LegalCopyright"/>
+                    <VersionInfoKeys Name="LegalTrademarks"/>
+                    <VersionInfoKeys Name="OriginalFilename">Randomaze.exe</VersionInfoKeys>
+                    <VersionInfoKeys Name="ProductName">Randomaze</VersionInfoKeys>
+                    <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="Comments">Made by EBY aka Eror</VersionInfoKeys>
+                </VersionInfoKeys>
+                <Excluded_Packages>
+                    <Excluded_Packages Name="c:\users\public\documents\rad studio\11.0\bpl\GLScene_Cg_RunTime.bpl">GLScene Cg Shaders</Excluded_Packages>
+                    <Excluded_Packages Name="c:\users\public\documents\rad studio\11.0\bpl\GLScene_RunTime.bpl">GLScene OpenGL 3D library</Excluded_Packages>
+                    <Excluded_Packages Name="c:\users\public\documents\rad studio\11.0\bpl\GLScene_Parallel_RunTime.bpl">GLScene GPU Computing</Excluded_Packages>
+                    <Excluded_Packages Name="c:\users\public\documents\rad studio\11.0\bpl\GLScene_Physics_RunTime.bpl">GLScene Physics Managers</Excluded_Packages>
+                    <Excluded_Packages Name="c:\users\public\documents\rad studio\11.0\bpl\GLScene_Sounds_RunTime.bpl">GLScene Sound Managers</Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl180.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dcloffice2k180.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp180.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
+                </Excluded_Packages>
+            </Delphi.Personality>
+            <Platforms>
+                <Platform value="Win32">True</Platform>
+                <Platform value="Win64">False</Platform>
+            </Platforms>
+        </BorlandProject>
+        <ProjectFileVersion>12</ProjectFileVersion>
+    </ProjectExtensions>
+    <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
+    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
+</Project>


+ 621 - 0
Randomaze/ChangeLog.txt

@@ -0,0 +1,621 @@
+3.168
+Überflüssige Buganfällige Räume entfernt
+Multiplayer wieder zum laufen gebracht
+Überprüfung auf Lösbarkeit verbessert
+
+3.167
+Update auf Delphi XE4
+
+
+2.166
+Bugfix:Farbe von BlackBoom
+Bugfix:Speed-Felder
+
+2.165
+Bugfix:Panel-Anzeige
+
+2.164
+Bugfix: fehlendes Leerzeichen
+
+2.163
+Bugfix:Absprungeschwindigkeit
+Kein endloser Fall mehr möglich
+
+2.162
+Festes Sichtfeld
+
+2.161
+Bugfix:Boom-Schrift
+Performance
+Graphiken intern skaliert
+
+2.160
+Bugfix beim Raum erstellen
+Bugfix:Am Regenbogen aus der Map fallen
+
+2.159
+viel mehr Panelconfig
+
+2.158
+kein Crash bei fehlender Datei
+
+2.157
+Random Speed gebufft und seltener
+
+2.156
+Bugfix mit MP-only Räumen
+Menüauswahl verbessert
+
+2.155
+Ini-Dateien verbessert (TMyIni)
+
+2.154
+Speedanzeige besser sichtbar
+
+2.153
+eine Räume nicht nebeneinander
+mehr RainbowTrap (4,5%)
+weniger sichtbare Regenbögen (1%,2%,2%)
+MP-Räume im SP unsichtbar
+
+
+2.152
+Pusher stark gebufft: Kontrollierte Bewegung (WASD) darauf nicht mehr möglich
+
+2.151
+Fallenmeldungen nach Sieg nicht anzeigen
+Bugfix:kurze Distanz zum Ziel führt zu endlosen Ladezeiten
+Bugfix: Bestimmung, ob man sich außerhalb des Labyrinths befindet 
+
+2.150
+Bugfix:crash bei extrem hoher Geschwindigkeit
+Lightning häufiger
+Bugfix: Lightning nicht auf sich selbst (Host)
+
+2.149
+Minimum GoalProtectionRadius auf 2 erhöht
+Kein Auslösen von Räumen außerhalb der Map mehr (auch nicht nach Sieg)
+
+2.148
+Bugfix:Settings-Menü
+Bigfix:Difficulty-Menü
+Erkennung wenn das Spiel zu lange lädt
+
+2.147
+Bugfix:Kontamination von Server ausgelöst
+
+2.146
+Performance
+nicht mehr durch grüne Wände schauen ohne durchzugehen
+
+2.145
+Dialoge überarbeitet
+
+2.144
+Bugfix:Zu viel grün
+
+2.143
+Bugfix:Texte
+
+2.142
+Einige Panels in INI ausgelagert
+
+2.141
+Bugfix:Abprallen von halber Wand
+
+2.140
+Ziel weiter weg
+
+2.139
+Kontaminations-Wahrscheinlichkeiten geändert
+
+2.138
+Performance
+
+2.137
+Bonbon-Raum
+
+2.136
+Performance-Verbesserung
+
+2.135
+Leicht verbesserte Performance
+
+2.134
+Bugfix:Spawnradius
+
+2.133
+Zielraumtyp umgestaltet
+
+2.132
+Bugfix: Speedverlust nach Sieg
+Bugfix: Speedanzeige nach Sieg
+
+2.131
+Mauerwahrscheinlichkeiten in Ini
+
+2.130
+Rotes Speed gebufft und seltener
+Multiplayer-Einstellungen in Ini
+keine Client-Open-Meldung mehr
+
+2.129
+Menüfunktion Viewing distance entfernt
+Blaue Speedfelder gebufft (2)
+Bugfix: Blitz
+
+2.128
+BugFix: ThrustBar bei Fullscreen in der Mitte
+ThrustBar nach Respawn auf Max
+
+2.127
+Kontamination breitet sich zu 50% aus
+Kontamination verschwindet beim betreten zu 25% (Radius: sqrt(2)Räume)
+Bugfix: Kontamination Multiplayer
+
+2.126
+Maus außerhalb von Menüs ignorieren
+Drehung im Menü beschleunigt
+Maximale FPS:60
+
+2.125
+Bugfix: Freeze nach Multiplayersieg
+Neuer Raum: Öffnung
+Tinte gebufft (verschwindet nur zu 20%)
+
+2.124
+Thrustbalken
+
+2.123
+Bugfix:Regenbogenfalle
+Bugfix:Respawn von der Decke aus
+Bugfix:Textur: Tinte an der Decke
+
+2.122
+Balancing:Raumhäufigkeit
+Neuer Raum: Zufallsgeschwindigkeit (+-0 bis +-10)
+
+2.121
+Bugfix: Schwarze Kreise nach Sieg
+Neuer Raum: Pfeilspawner
+Special Thanks-Datei
+
+2.120
+Schellerer Restart (n)
+
+2.119
+OP-Raum mit tanzenden Gegnern, die Muh sagen
+
+2.118
+Balancing:Raumhäufigkeit
+Bugfix:Zieldrehung
+
+2.117
+Bugfix:Tinte
+Versionsanzeige
+
+2.116
+Blitz gebufft (Speed*Abstand/(MaxAbstand*2))
+Blitz nicht auf Leichen
+Explosion gebufft (4 Räume)
+Spawnradius erhöht (3 Räume)
+
+2.115
+Tintenraum (Oben)
+Tintenraum (Oben und Unten)
+Bugfix:YSNP
+
+2.114
+Absprunggeschwindigkeit: 0,6*Speed
+Abstand Auge - Höchster Kopfpunkt = 0,3
+Tintenraum (Unten)
+
+2.113
+Entfernung: "P" statt "D"
+Schriftgrößen skalieren mit Fenstergröße
+
+2.112 
+Sprung wird im Menü fortgesetzt
+kein Megasprung am Pusher mehr möglich
+
+2.111
+Bugfix:Mausklick im Menü löst nur noch über Schrift aus
+
+2.110
+Absprunggeschwindigkeit: 0,55*Speed
+Bugfix:Regenbögen
+
+2.109
+Bugfix:Menü
+Startspeed flexibel (Menü und Ini)
+
+2.108
+Bugfix:Regenbögen
+Bugfix-Versuch:Graue Sicht
+
+2.107
+Ini: Mehr Möglichkeiten
+
+2.106
+von Wänden abprallen beim Springen
+
+2.105
+Codeästhetik:Umgestaltung der Speed-Veränderung
+
+2.104
+Neuer Raum: Pusher an der Decke
+
+2.103
+Bugfix:Pfeilrichtung,Pusherrichtung
+Codeästhetik
+
+2.102
+Sprunggeschwindigkeit: 2xSpeed
+Gravitation:9,81m/sqr(s)
+kein Richtungändern im Sprung
+schräg gehen: nicht mehr schneller als geradeaus
+
+2.101
+Random Speed von Kontamination
+Kontamination unwahrscheinlicher
+
+2.100
+Bugfix: Gewinnen beim join
+Bugfix: Position senden
+
+2.99
+Kontamination funktioniert weitestgehend
+
+2.98
+Kontamination eingebaut (funktioniert noch nicht)
+Mapgröße auf 500 gesenkt (1001x1001 Räume)
+Boden auf -2m Höhe, Decke auf 4m
+
+
+2.97
+Mehr Tod senden
+UIni
+Ebenen verallgemeinert
+
+2.96
+Hinweis beim Mapladen entfernt
+Tod senden
+nicht bei Toten explodieren
+
+2.95
+Boom nur 1,5 sec
+Mauerbugs behoben
+keine dreifach halben Mauern
+
+2.94
+respawn mit R statt L
+Hinweisfelder halten Spiel nicht an
+
+2.93
+immer min 1 Weg zum Ziel
+
+2.92
+Ganze Mauern seltener (0.35)
+Bugfix: Regenbögen  verschwinden
+Leichenerkennung teilweise eingebaut
+Bugfix: Pfeile in falsche Richtung
+
+2.91
+Bugfix:Regenbögen an der Decke verschwinden
+
+2.90
+Sprung senden verbessert
+Bugfix: Warping Walls
+
+2.89
+Pfeil am Spawnpunkt
+
+2.88
+Explosionen geschwächt auf Radius 2
+Raumwahrscheinlichkeiten aus ini datei
+Raumwahrscheinlichkeiten geändert
+
+2.87
+neue Farben
+bessere Labyrinthgesaltung
+
+2.86
+Bugfix:Andere Spieler sehen
+
+2.85
+Sichtweite erhöht
+Nur Spieler in (Raum-)Sichtweite sichtbar
+
+2.84
+Multiplayer Host und Join Verbesserung
+Bugfix: Springen: Endlosschleife
+
+2.83
+Blitz nur noch auf Gegner
+Dateiinformationen hinzugefügt
+
+2.82
+Bessere Anzeige der distanz
+kein respawn nach spielende
+Bugfix: Siedg senden
+Explodieren leert den raum nicht
+
+2.81
+Bugfix: BOOM senden
+Bugfix: Speed "changed" nur noch anzeigen, wenn tatsächlich verändert
+Blitz: "decreased" statt "changed"
+Blitz: Schriftfarbe gelb
+
+2.80
+Bugfix: Redspeed verschwindet jetzt beim betreten
+
+
+2.79
+Blitz-Felder
+
+2.78
+Bugfix: BOOM-Ewig
+
+2.77
+FPS-Anzeige verbessert
+Permajump-Verhinderung-verbessert
+Pusher schieben in den nächsten Raum
+
+2.76
+Schwarze BOOM Räume
+
+2.75
+BugFix:Pusherrichtung wählen
+BugFix:Pusherrichtung senden
+
+
+2.74
+Pusher
+Objekte umsortiert
+
+2.73
+GoalProtectionRadius flexibel
+Bugfix: Restart required
+
+2.72
+Randomaze 2: Versionsnummer wegen MP erhöht
+
+
+
+
+
+
+1.71
+Bugfix: Gewinnen senden
+Bugfix: kein 3. Spieler erscheint
+Restart unabhängig von Programmname
+
+1.70
+Respawn nach Verlieren möglich
+
+1.69
+Bugfix:BOOM senden
+
+1.68
+Am Rand der Map an den anderen Rand porten
+
+1.67
+Kein Geschwindigkeitsverlust am Spawnpunkt
+Zieldistanz erhöht
+
+1.66
+Keine Seltenen Sachen am Spawnpunkt
+
+1.65
+Respawn-Funktion
+
+1.64
+kein springen nach verlieren
+
+1.63
+Bugfix: Explodieren senden
+Bugfix: Warping Walls im Multiplayer senden
+Beim Joinen: Am
+Boden laufen
+
+1.62
+Startgeschwindigkeit
+Bugfix: Speed=0
+MP-Joinen: Speed:=15
+BOOM und Warping Walls im Multiplayer senden
+
+1.61
+Menü über Tastatur bedienen
+
+1.60
+Bugfix:Startgeschwindigkeit
+Bugfix:Raumübertragung
+
+1.59
+Keine Regenbogendrehung mehr
+Bugfix:Regenbogensichtbarkeit
+Zielposition senden
+
+1.58
+BugFix:Multiplayer
+
+1.57
+Bugfix:Gemeinsamer MP-Sieg
+
+1.56
+Netzwerk-Performance
+BugFix:Pfeildrehung
+Gemeinsamer MP-Sieg (noch fehlerhaft)
+
+1.55
+kein permajump
+
+1.54
+nur Sprungstart senden
+Bugfix:Position senden
+
+1.53
+Beim MP-Joinen Startposition einnehmen
+
+1.52
+Bugfix:Position initialisieren
+
+1.51
+mehr als 2 Spieler möglich
+verschiedene Spielerfarben (halbzufällig)
+
+1.50
+Balancing:
+Überwandsprung: Speed -1
+Anfangsspeed: 15
+
+Blick senkrecht nach unten möglich
+keine Unendlich-Geschwindigkeit am Ziel
+
+1.49
+TInhalt.Sorte:Integer;
+kleiner Raumsortenverteilungs-Bugfix
+Code-Optimierung:Raumsortenverteilung
+
+
+1.48
+MP-Spielerbewegung sanfter
+
+1.47 
+Netzwerk-Performance
+
+1.46
+Andere Spieler sichtbar (aber immer im selben Raum)
+
+1.45
+Raumübertragung beim wandern des Clients
+
+1.44
+Mapübertragung beim joinen
+
+1.43
+Testnachricht sendbar
+
+1.42
+erste Netzwerk-Verbindung herstellbar
+
+1.41
+Multiplayer-Menü erweitert
+
+1.40
+Multiplayer-Menü erweitert
+
+1.39
+Raumtypen in ini (unfinished)
+weniger halbe Wände (noch 20%)
+
+1.38
+springen über Wände kostet mehr Speed
+
+1.37
+GoalDist Variabel
+
+1.36
+INI-Speichern
+
+1.35
+Videoeinstellungen
+
+1.34:
+Bugfix: Menü
+
+1.33
+Bugfix: Sprung
+Bugfix: Rand der Map
+
+1.32
+Icon ausgelagert
+
+1.31
+Texturen ausgelagert
+
+1.30
+Bugfix: Rand der Map
+
+1.29
+Bugfix:Sieg
+
+1.28
+Bugfix:Warping Walls
+Bugfix:Grüne Mauern
+kein Rollen während im Menü
+Neustarten ins Menü
+
+1.27
+Regenbögen drehen nicht mehr
+Materialien und Shader ausgelagert in andere Unit
+Bugfix:Walltrap
+Restart schneller
+
+1.26
+Bugfix:Sprung
+Bugfix:Körperhöhe
+
+1.25
+Sprunghöhe reduziert
+Spielergröße eingeführt:2m, Kopfhöhe 1,5m
+
+1.24
+Halbe Mauern blocken
+Performance-Verbesserungen
+Kameradrehung im Pause-Menü
+
+1.23
+Halbe Mauern eingebaut
+
+1.22
+gegen Decke springen möglich
+Sprunghöhe proportional zu Speed
+
+1.21
+sichtbare Regenbögen drehen nicht mehr
+einseitige Regenbögen eingebaut
+
+1.20
+Hauptmenü verbessert
+Pause := Menü
+Regenbogenfalle dreht nicht mehr
+Ziel zwischen 17 und 19 Räumen vom Spawn entfernt (vorher 16 -18)
+
+1.19
+Hauptmenü
+Speedanzeige nur noch Schrift
+
+1.18
+Sichtbare Regenbogenfelder drehen nicht mehr nach Gewinnen
+
+1.17
+Regenbogenfalle
+Balancing
+
+1.16
+Regenbogen seltener und einmalig
+
+1.15
+Vollbild-Fehler behoben
+Debug-Verbesserungen
+Fenstergröße veränderbar (Mausklick-ziehen)
+
+1.14
+kein Rotes Speed um Ziel/Spawn herum
+Wände von Decke bis Boden
+Regenbogenfelder
+Vollbild eingebaut ('m'), aber noch fehlerhaft
+
+1.13
+Rote Speedfelder: Speed -5
+Mapgrenze bei +-1000
+beenden auch während Sprung möglich
+
+1.12
+Über Wände springen bei Sieg
+
+1.11
+Blaue Speedfelder:Speed +1.5
+BOOM-Felder: Radius 3
+keine Mauern um Ziel (3 Felder) und Start(2 Felder)

+ 21 - 0
Randomaze/HowToPlay.txt

@@ -0,0 +1,21 @@
+WASD: move
+Spacebar: Jump
+B: end game
+N: restart game
+P: pause game
+M: fullscreen on/off
+-: Settings
+R: Respawn
+U/J or grag thrustbar: Increase/Decrease Speed
+
+drag window border (non fullscreen): resize game
+
+Change Settings: ingame-menu or ini-file
+Respawn: Mainmenu
+
+
+Goal: Find the Goal!
+
+
+Multiplayer:
+1 player hosts, others join (LAN, Hamachi, Tunngle and Hotseat at one PC tested and working, Evolve and normal internet not tested)

+ 1 - 0
Randomaze/NetworkLog.txt

@@ -0,0 +1 @@
+Position;3;269,299040794373;8,34971618652344;11,08;RaumSorte;14;0;0;CreateRaum;10;-8;CreateRaum;11;-8;CreateRaum;12;-8;CreateRaum;13;-8;CreateRaum;14;-8;CreateRaum;15;-8;CreateRaum;16;-8;CreateRaum;17;-8;CreateRaum;18;-8;CreateRaum;19;-8;CreateRaum;20;-8;CreateRaum;21;-8;CreateRaum;22;-8;CreateRaum;22;-7;CreateRaum;22;-6;CreateRaum;22;-5;CreateRaum;22;-4;CreateRaum;22;-3;CreateRaum;22;-2;CreateRaum;22;-1;CreateRaum;22;0;CreateRaum;22;1;CreateRaum;22;2;CreateRaum;22;3;CreateRaum;22;4;CreateRaum;22;5;CreateRaum;22;6;CreateRaum;22;7;

+ 52 - 0
Randomaze/PanelConfigs.ini

@@ -0,0 +1,52 @@
+[PC_GreenTrap]
+ID=5
+Text=hihihihihihihihihihihi
+FontColor=1346280
+BackGroundColor=464650
+LeftDivW=0,123445825932504
+TopDivH=0,365079365079365
+DontShowIfWon=1
+[PC_WallTrap]
+ID=6
+Text=Warping Walls!
+FontColor=14365748
+DontShowIfWon=1
+[PC_Speed]
+ID=7
+Text=Speed increased to
+FontColor=16754688
+SpeedAtEnd=1
+[PC_RedSpeed]
+ID=8
+Text=Speed decreased to
+FontColor=1644950
+DontShowIfWon=1
+SpeedAtEnd=1
+[PC_GreenSpeed]
+ID=9
+Text=Speed increased to
+FontColor=3005309
+SpeedAtEnd=1
+[PC_Explosion]
+ID=14
+Text=BOOM
+FontColor=15430935
+BackGroundColor=1346280
+LeftDivW=0,05
+WidthDivW=0,9
+TopDivH=0,1
+HeightDivH=0,8
+Seconds=1,5
+FontSizeDivH=0,432900432900433
+DontShowIfWon=1
+[PC_RandomSpeed]
+ID=27
+Text=Speed changed randomly to
+FontColor=0
+BackGroundColor=16777215
+DontShowIfWon=1
+[PC_Bonbon]
+ID=31
+Text=Trapped!
+FontColor=5289727
+DontShowIfWon=1

+ 254 - 0
Randomaze/Roomtypes.ini

@@ -0,0 +1,254 @@
+[empty]
+ID=0
+Roomfrequenzy=0
+NotAtSpawn=0
+[Arrow]
+MaterialNameDown=Grass
+MaterialNameUp=Arrow
+ID=1
+Roomfrequenzy=0,02
+TurnToGoalUp=1
+NotAtSpawn=0
+NotNextToSelf=1
+[Goal]
+MaterialNameUp=Goal
+ID=2
+Roomfrequenzy=0
+WinAtArrival=1
+TurnRandomUp=1
+NotAtSpawn=0
+NotNextToSelf=1
+[YSNP]
+MaterialNameDown=YSNP
+MaterialNameUp=Ceiling
+ID=3
+Roomfrequenzy=0,02
+YSNPUp=1
+YSNPDown=1
+TurnPlayer=0
+PortPlayerToCenter=0
+Passierbar=0
+TurnRandomDown=1
+NotNextToSelf=1
+[Green]
+MaterialNameDown=Grass
+MaterialNameUp=Ceiling
+ID=4
+Roomfrequenzy=0,042
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=1
+ChangeWallsAtArrival=0
+TurnPlayer=0
+PortPlayerToCenter=0
+[GreenTrap]
+MaterialNameDown=Grass
+MaterialNameUp=Ceiling
+ID=5
+Roomfrequenzy=0,042
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeAtArrivalToUp=4
+ChangeAtArrivalToDown=4
+ChangeWallsAtArrival=0
+TurnPlayer=1
+PortPlayerToCenter=1
+[WallTrap]
+ID=6
+Roomfrequenzy=0,035
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+ChangeWallsAtArrival=1
+TurnPlayer=0
+PortPlayerToCenter=0
+Passierbar=0
+[Speed]
+MaterialNameDown=BlueSpeed
+ID=7
+Roomfrequenzy=0,07
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=2
+TurnPlayer=0
+PortPlayerToCenter=0
+TurnRandomDown=1
+[RedSpeed]
+MaterialNameDown=RedSpeed
+ID=8
+Roomfrequenzy=0,015
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+ChangeSpeedAtArrival=-10
+TurnRandomDown=1
+[GreenSpeed]
+MaterialNameDown=GreenSpeed
+ID=9
+Roomfrequenzy=0,008
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=10
+TurnPlayer=0
+PortPlayerToCenter=0
+TurnRandomDown=1
+NotNextToSelf=1
+[Turner]
+MaterialNameUp=Turner
+ID=10
+Roomfrequenzy=0,1
+ExplodeDown=0
+ExplodeUp=0
+PortToUp=0
+PortToDown=0
+TurnToGoalUp=0
+TurnToGoalDown=0
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=0
+TurnPlayer=1
+PortPlayerToCenter=1
+[UpDownPorter]
+MaterialNameDown=PortDownUp
+MaterialNameUp=PortUpDown
+ID=11
+Roomfrequenzy=0,015
+ExplodeDown=0
+ExplodeUp=0
+PortToUp=1
+PortToDown=1
+TurnToGoalUp=0
+TurnToGoalDown=0
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=0
+TurnPlayer=0
+PortPlayerToCenter=0
+NotNextToSelf=1
+[UpPorter]
+MaterialNameDown=PortDownUp
+ID=12
+Roomfrequenzy=0,03
+ExplodeDown=0
+ExplodeUp=0
+PortToUp=1
+PortToDown=0
+TurnToGoalUp=0
+TurnToGoalDown=0
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=0
+TurnPlayer=0
+PortPlayerToCenter=0
+NotNextToSelf=1
+[DownPorter]
+MaterialNameUp=PortUpDown
+ID=13
+Roomfrequenzy=0,03
+ExplodeDown=0
+ExplodeUp=0
+PortToUp=0
+PortToDown=1
+TurnToGoalUp=0
+TurnToGoalDown=0
+YSNPUp=0
+YSNPDown=0
+GreenWallsAround=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=0
+TurnPlayer=0
+PortPlayerToCenter=0
+NotNextToSelf=1
+[Explosion]
+MaterialNameDown=Explosion
+ID=14
+Roomfrequenzy=0,005
+ExplodeDown=1
+ExplodeUp=1
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+ChangeWallsAtArrival=0
+ChangeSpeedAtArrival=0
+TurnRandomDown=1
+[RainbowTrap]
+ID=15
+Roomfrequenzy=0,05
+PortToUp=1
+PortToDown=1
+ChangeAtArrivalToUp=0
+ChangeAtArrivalToDown=0
+[PusherDown]
+MaterialNameDown=PusherDown
+ID=16
+Roomfrequenzy=0,04
+PushPlayerDown=1
+TurnRandomDown=1
+[Contamination]
+MaterialNameDown=ContaminationDown
+MaterialNameUp=ContaminationUp
+ID=19
+Roomfrequenzy=0,005
+Contaminate=1
+Passierbar=0
+TurnRandomUp=1
+TurnRandomDown=1
+[PusherUp]
+MaterialNameUp=PusherUp
+ID=20
+Roomfrequenzy=0,04
+PushPlayerUp=1
+TurnRandomUp=1
+[PusherUpDown]
+MaterialNameDown=PusherDown
+MaterialNameUp=PusherUp
+ID=21
+Roomfrequenzy=0,01
+PushPlayerUp=1
+PushPlayerDown=1
+TurnRandomUp=1
+TurnRandomDown=1
+Passierbar=0
+[OPTanzGegnerraum]
+ID=25
+Roomfrequenzy=0,005
+OPTanzGegner=1
+Passierbar=0
+NotNextToSelf=1
+[OpenDown]
+MaterialNameDown=Open
+ID=28
+Roomfrequenzy=0,01
+[OpenUp]
+MaterialNameUp=Open
+ID=29
+Roomfrequenzy=0,01
+[OpenUpDown]
+MaterialNameDown=Open
+MaterialNameUp=Open
+ID=30
+Roomfrequenzy=0,005
+Passierbar=0
+[Bonbon]
+MaterialNameDown=Bonbon
+ID=31
+Roomfrequenzy=0,005
+WallCageTrap=1
+Passierbar=0
+TurnRandomDown=1
+NotNextToSelf=1

+ 101 - 0
Randomaze/Settings.ini

@@ -0,0 +1,101 @@
+[Difficulty]
+Minimum Goal Distance=22
+Maximum Goal Distance=26
+GoalProtectionRadius=2
+WallProb=0,31
+UPWallProb=0,11
+DownWallProb=0,11
+StartSpeed=15
+[Multiplayer]
+MPServerAddress=Localhost
+MPPort=10808
+[Roomtypelist]
+RT_0=empty
+RT_1=Arrow
+RT_2=Goal
+RT_3=YSNP
+RT_4=Green
+RT_5=GreenTrap
+RT_6=WallTrap
+RT_7=Speed
+RT_8=RedSpeed
+RT_9=GreenSpeed
+RT_10=Turner
+RT_11=UpDownPorter
+RT_12=UpPorter
+RT_13=DownPorter
+RT_14=Explosion
+RT_15=RainbowTrap
+RT_16=PusherDown
+RT_17=BlackExplosion
+RT_18=Lightning
+RT_19=Contamination
+RT_20=PusherUp
+RT_21=PusherUpDown
+RT_22=InkDown
+RT_23=InkUp
+RT_24=InkUpDown
+RT_25=OPTanzGegnerraum
+RT_26=ArrowSpawner
+RT_27=RandomSpeed
+RT_28=OpenUp
+RT_29=OpenDown
+RT_30=OpenUpDown
+RT_31=Bonbon
+[Proportions]
+OS_0=78
+OS_1=78
+OS_2=1126
+OS_3=693
+OS_4=2
+OS_5=0,120781527531083
+OS_6=0,505328596802842
+OS_7=0,0230880230880231
+OS_8=0,0707070707070707
+OS_9=0,120781527531083
+OS_10=0,505328596802842
+OS_11=0,0923520923520924
+OS_12=0,0707070707070707
+OS_13=0,0375180375180375
+OS_14=0,0173160173160173
+OS_15=0,266429840142096
+OS_16=0,331890331890332
+OS_17=0
+OS_18=0
+OS_19=0
+OS_20=0
+OS_21=0,630550621669627
+OS_22=0,0432900432900433
+OS_23=0,044404973357016
+OS_24=0,865800865800866
+OS_25=0,0497335701598579
+OS_26=0,899644760213144
+OS_27=0,0995670995670996
+OS_28=0,799422799422799
+OS_29=0,0213143872113677
+OS_30=0,0213143872113677
+OS_31=0
+OS_32=0,0213143872113677
+OS_33=0,0230905861456483
+OS_34=0,266429840142096
+OS_35=0,120781527531083
+OS_36=0,420071047957371
+OS_37=0,0923520923520924
+OS_38=0,135642135642136
+OS_39=0,0346320346320346
+OS_40=0,266429840142096
+OS_41=0,331890331890332
+OS_42=0,266429840142096
+OS_43=0,331890331890332
+OS_44=0
+OS_45=0
+OS_46=0,266429840142096
+OS_47=0,331890331890332
+OS_48=0,266429840142096
+OS_49=0,331890331890332
+OS_50=0,266429840142096
+OS_51=0,331890331890332
+OS_52=0,0346320346320346
+OS_53=0,952042628774423
+OS_54=0,89033189033189
+OS_55=0,0266429840142096

+ 18 - 0
Randomaze/Special Thanks.txt

@@ -0,0 +1,18 @@
+Special thanks go to:
+
+Rif, Phoenix, NovaNox, Esramon, Fejien, Svet, Timo, Sylvia
+for testing Randomaze during development.
+
+Rif, Phoenix, NovaNox, Esramon, Svet, Fejien
+for helping me design Randomaze by giving ideas for roomtypes.
+
+Rif, Phoenix, Svet, NovaNox
+for helping me design Randomaze by giving ideas for other features.
+
+
+
+If You want to be deleted or renamed feel free to contact me.
+If You helped me but I do not list You, You may also contact me.
+
+Made by EBY aka Eror
+

+ 3 - 0
Randomaze/SystemRequirements.txt

@@ -0,0 +1,3 @@
+RAM: 300MB
+CPU: not tested (1.995GHz i7 works fine)
+GPU: not tested (nvidia geforce GT 540M works (50fps))

BIN
Randomaze/Texturen/Arrow.jpg


BIN
Randomaze/Texturen/ArrowSpawner.jpg


BIN
Randomaze/Texturen/Background.jpg


BIN
Randomaze/Texturen/BlackExplosion.jpg


BIN
Randomaze/Texturen/BlueSpeed.jpg


BIN
Randomaze/Texturen/Bonbon.jpg


BIN
Randomaze/Texturen/Ceiling.jpg


BIN
Randomaze/Texturen/CeilingLowRes.jpg


BIN
Randomaze/Texturen/ContaminationDown.jpg


BIN
Randomaze/Texturen/ContaminationUp.jpg


BIN
Randomaze/Texturen/Explosion.jpg


BIN
Randomaze/Texturen/Goal.jpg


BIN
Randomaze/Texturen/Grass.jpg


BIN
Randomaze/Texturen/GreenSpeed.jpg


BIN
Randomaze/Texturen/GreenWall.jpg


BIN
Randomaze/Texturen/HalfWall.jpg


BIN
Randomaze/Texturen/InkDown.jpg


BIN
Randomaze/Texturen/InkUp.jpg


BIN
Randomaze/Texturen/Lightning.jpg


BIN
Randomaze/Texturen/Muh.jpg


BIN
Randomaze/Texturen/PortDownUp.jpg


BIN
Randomaze/Texturen/PortUpDown.jpg


BIN
Randomaze/Texturen/PusherDown.jpg


BIN
Randomaze/Texturen/PusherUp.jpg


BIN
Randomaze/Texturen/RandomSpeed.jpg


BIN
Randomaze/Texturen/RedSpeed.jpg


BIN
Randomaze/Texturen/Turner.jpg


BIN
Randomaze/Texturen/Wall.jpg


BIN
Randomaze/Texturen/YSNP.jpg


BIN
Randomaze/Texturen/grey.jpg


BIN
Randomaze/Wall.ico


+ 4 - 0
Randomaze/reini.bat

@@ -0,0 +1,4 @@
+del "Roomtypes.ini"
+del "Settings.ini"
+del "PanelConfigs.ini"
+Randomaze

+ 2 - 0
Randomaze/restart.bat

@@ -0,0 +1,2 @@
+cd "%~dp0"
+start %1

BIN
Randomaze_Icon.ico


BIN
Randomaze_Icon1.ico


BIN
Randomaze_Icon2.ico


BIN
Randomaze_Icon3.ico


+ 616 - 0
Spielprofile.xml

@@ -0,0 +1,616 @@
+<?xml version="1.0" encoding="utf-8"?>
+<profiles xmlns="http://www.logitech.com/Cassandra/2010.7/Profile">
+  <profile guid="{09D92D75-3C8C-4723-B06C-4090BCB899C0}" lock="0" gpasupported="0" lastplayeddate="2015-05-30T13:07:20" gkeysdk="0" name="Standardprofil" launchable="1">
+    <description></description>
+    <signature executable="" key="" value="" name=""/>
+    <macros>
+      <macro guid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}" hidden="false" name="1" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="1"/>
+        </keystroke>
+      </macro>
+      <macro guid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}" hidden="false" name="A" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="A"/>
+        </keystroke>
+      </macro>
+      <macro guid="{719E14B7-92C8-4231-AD72-C30450EBFC10}" hidden="false" name="S" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="S"/>
+        </keystroke>
+      </macro>
+      <macro guid="{438FEFE1-A4AC-40C2-9247-B31379391066}" hidden="false" name="D" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="D"/>
+        </keystroke>
+      </macro>
+      <macro guid="{053C4FB8-E85A-4993-9C29-6E504C75DB2F}" hidden="false" name="F" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F"/>
+        </keystroke>
+      </macro>
+      <macro guid="{C76A7B08-F7A1-4CB1-A05B-F376B76FEB3C}" hidden="false" name="G" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="G"/>
+        </keystroke>
+      </macro>
+      <macro guid="{B6A5C255-A379-498D-AAD9-290F1EB43B98}" hidden="false" name="LSHIFT" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="LSHIFT"/>
+        </keystroke>
+      </macro>
+      <macro guid="{474C3E34-3395-4059-93C8-3D4076673135}" hidden="false" name="Z" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="Z"/>
+        </keystroke>
+      </macro>
+      <macro guid="{AEB183E0-9019-4392-896B-4DAC8330FA67}" hidden="false" name="X" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="X"/>
+        </keystroke>
+      </macro>
+      <macro guid="{0BD1FF8D-B460-46A4-9866-EAFB2ECF3617}" hidden="false" name="C" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="C"/>
+        </keystroke>
+      </macro>
+      <macro guid="{33F8DE88-FEAC-42ED-BA8A-3C4755FA6D67}" hidden="false" name="V" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="V"/>
+        </keystroke>
+      </macro>
+      <macro guid="{244636E5-5C47-4982-8A76-E216A920F49F}" hidden="false" name="2" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="2"/>
+        </keystroke>
+      </macro>
+      <macro guid="{6631B94C-725B-4541-B7FD-E0FEDA3156F3}" hidden="false" name="LCTRL" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="LCTRL"/>
+        </keystroke>
+      </macro>
+      <macro guid="{93ECFD56-95ED-4B57-A385-8CF72DB5F6B6}" hidden="false" name="LALT" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="LALT"/>
+        </keystroke>
+      </macro>
+      <macro guid="{012C64E4-210B-4199-97BC-F051CE3488E6}" hidden="false" name="SPACEBAR" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="SPACEBAR"/>
+        </keystroke>
+      </macro>
+      <macro guid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}" hidden="false" name="6" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="6"/>
+        </keystroke>
+      </macro>
+      <macro guid="{D0AE6D96-FA68-44C3-9962-F25237E48823}" hidden="false" name="7" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="7"/>
+        </keystroke>
+      </macro>
+      <macro guid="{6FDA729B-2DD1-4505-9693-A8D2CC88A956}" hidden="false" name="8" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="8"/>
+        </keystroke>
+      </macro>
+      <macro guid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}" hidden="false" name="W" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="W"/>
+        </keystroke>
+      </macro>
+      <macro guid="{088F6952-C5AF-4CD9-8596-C1744B12501F}" hidden="false" name="Q" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="Q"/>
+        </keystroke>
+      </macro>
+      <macro guid="{35060C60-D9F5-4F61-B7F0-351005026E00}" hidden="false" name="E" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="E"/>
+        </keystroke>
+      </macro>
+      <macro guid="{CEBC90AE-8677-4F05-BA4F-A8436AC9EAB6}" hidden="false" name="R" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="R"/>
+        </keystroke>
+      </macro>
+      <macro guid="{569B3CF7-7D76-4E72-94A3-D8B6DA43C6A2}" hidden="false" name="T" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="T"/>
+        </keystroke>
+      </macro>
+      <macro guid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}" hidden="false" name="3" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="3"/>
+        </keystroke>
+      </macro>
+      <macro guid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}" hidden="false" name="4" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="4"/>
+        </keystroke>
+      </macro>
+      <macro guid="{FF54FEB5-843F-465A-B8BA-9CAA2C4B70B9}" hidden="false" name="F1" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F1"/>
+        </keystroke>
+      </macro>
+      <macro guid="{1ED530F3-5A13-4EB1-800C-DF0D6873ED88}" hidden="false" name="F2" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F2"/>
+        </keystroke>
+      </macro>
+      <macro guid="{B06BEC6C-12A7-4F2A-AC97-BBF7B7EDF353}" hidden="false" name="F3" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F3"/>
+        </keystroke>
+      </macro>
+      <macro guid="{33BDD50A-3E5C-4EE3-A440-91C2A94230CB}" hidden="false" name="F4" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F4"/>
+        </keystroke>
+      </macro>
+      <macro guid="{FA55D2A3-9611-4B9A-8705-17C74B82FB64}" hidden="false" name="F5" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F5"/>
+        </keystroke>
+      </macro>
+      <macro guid="{035A0274-52FD-4530-A7B9-EB66B6BEB647}" hidden="false" name="F6" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F6"/>
+        </keystroke>
+      </macro>
+      <macro guid="{002D4039-63A2-4FFB-B9A6-4F2337042B54}" hidden="false" name="F10" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F10"/>
+        </keystroke>
+      </macro>
+      <macro guid="{E432B456-E65C-4009-9115-FFF884011BEF}" hidden="false" name="F11" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F11"/>
+        </keystroke>
+      </macro>
+      <macro guid="{A36371DC-A978-440E-85B5-336C2AFCA14F}" hidden="false" name="F12" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F12"/>
+        </keystroke>
+      </macro>
+      <macro guid="{793AC04D-F6DB-4E47-8D93-068B95FD54E3}" hidden="false" name="5" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="5"/>
+        </keystroke>
+      </macro>
+      <macro guid="{2FDFE890-93C0-4BDB-851B-03D0E06337C1}" hidden="false" name="F7" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F7"/>
+        </keystroke>
+      </macro>
+      <macro guid="{23A95548-5C2F-423A-A76C-0A341F636BF5}" hidden="false" name="F8" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F8"/>
+        </keystroke>
+      </macro>
+      <macro guid="{A83EA296-1C6B-4523-996A-69D7830524CD}" hidden="false" name="F9" color="4278215935">
+        <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
+          <key value="F9"/>
+        </keystroke>
+      </macro>
+      <macro guid="{5DAFA657-7E0B-4D37-9F7A-FA252ED551E6}" hidden="false" name="Linksklick" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="leftclick"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{9D0F4485-F6CE-49AF-B3FB-328DBF996F1E}" hidden="false" name="Rechtsklick" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="rightclick"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{8B615B23-6FDC-4430-9E57-E5CCBCAC4575}" hidden="false" name="Mittelklick" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="middleclick"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{A0D817F6-1D5D-483B-ADD0-2634CD93D42A}" hidden="false" name="Zurück" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="back"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{8B13562D-60F2-460F-9588-8C84168C81BC}" hidden="false" name="Vor" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="forward"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{68A1C0B2-2996-4992-9CC5-3285AC8E9740}" devicecategory="Logitech.Gaming.Mouse" hidden="false" name="Auflösung erhöhen" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="dpiup"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{12C9716B-4D7A-4F6F-AF20-A0369219119A}" devicecategory="Logitech.Gaming.Mouse" hidden="false" name="Auflösung verringern" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="dpidown"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{89F0C712-9AF7-4099-9C53-1868BF5B9A4E}" devicecategory="Logitech.Gaming.Mouse" hidden="false" name="Standardauflösung" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="defaultdpi"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{53E81537-5916-4AB3-B052-ABF88B5DD218}" devicecategory="Logitech.Gaming.Mouse.G300" hidden="false" name="Moduswechsel (G300/s)" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="modeswitch"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{A1FEC5BC-9A8A-49C5-B085-0E2EDCEF1F55}" devicecategory="Logitech.Gaming.Mouse" hidden="false" name="Auflösung wechseln" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="dpishift"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{28F1F32A-678A-4CD8-A0F4-41283A737EFC}" devicecategory="Logitech.Gaming.Mouse" hidden="false" name="Auflösungsumschaltung" color="4278215935">
+        <mousefunction xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MouseFunction">
+          <do task="dpicycling"/>
+        </mousefunction>
+      </macro>
+      <macro guid="{F7899D9E-8B25-45CB-B4BC-AAF99E4C87D4}" hidden="false" name="Kopieren" color="4278215935">
+        <hotkeys xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Hotkeys">
+          <do task="copy"/>
+        </hotkeys>
+      </macro>
+      <macro guid="{5638A489-F156-4122-A7DB-E0F880FACC0E}" hidden="false" name="Einfügen" color="4278215935">
+        <hotkeys xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Hotkeys">
+          <do task="paste"/>
+        </hotkeys>
+      </macro>
+      <macro guid="{2F5C8F56-C184-4143-8852-2EB924626DCC}" hidden="false" name="Ausschneiden" color="4278215935">
+        <hotkeys xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Hotkeys">
+          <do task="cut"/>
+        </hotkeys>
+      </macro>
+      <macro guid="{2C3503AC-9914-473E-9F29-8CE0D844D924}" hidden="false" name="QuickMacro" color="4278215935">
+        <multikey xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/MultiKey">
+          <key direction="down" value="LGUI"/>
+          <key direction="down" value="R"/>
+          <key direction="up" value="R"/>
+          <key direction="up" value="LGUI"/>
+          <key direction="down" value="F"/>
+          <key direction="up" value="F"/>
+          <key direction="down" value="I"/>
+          <key direction="down" value="R"/>
+          <key direction="up" value="I"/>
+          <key direction="down" value="E"/>
+          <key direction="up" value="R"/>
+          <key direction="down" value="F"/>
+          <key direction="up" value="E"/>
+          <key direction="up" value="F"/>
+          <key direction="down" value="ENTER"/>
+          <key direction="up" value="ENTER"/>
+        </multikey>
+      </macro>
+      <macro guid="{760A6A16-00C0-46AB-AEC6-563221AEF395}" hidden="false" name="Ó" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">Ó</text>
+        </textblock>
+      </macro>
+      <macro guid="{A3B99BE9-9449-40BA-836E-187790487528}" hidden="false" name="ê" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ê</text>
+        </textblock>
+      </macro>
+      <macro guid="{4B522E13-577C-41C8-9246-1AF8F9E4B050}" hidden="false" name="ë" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ë</text>
+        </textblock>
+      </macro>
+      <macro guid="{F955462C-4A7F-4E5E-9476-C475369CF2BC}" hidden="false" name="è" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">è</text>
+        </textblock>
+      </macro>
+      <macro guid="{450A4DB1-121D-49D4-BC5F-5A660E3F5010}" hidden="false" name="ï" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ï</text>
+        </textblock>
+      </macro>
+      <macro guid="{BCBE72FF-688C-483A-99BD-B50415FE48BF}" hidden="false" name="î" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">î</text>
+        </textblock>
+      </macro>
+      <macro guid="{87231FC8-37A7-47DD-96A2-11EC7735DD29}" hidden="false" name="ì" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ì</text>
+        </textblock>
+      </macro>
+      <macro guid="{CB9E4444-A164-4A71-BD1B-90D0337D5051}" hidden="false" name="Ä" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">Ä</text>
+        </textblock>
+      </macro>
+      <macro guid="{912E5F3B-CF0C-4B0B-84FA-47D21D3F4590}" hidden="false" name="Å" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">Å</text>
+        </textblock>
+      </macro>
+      <macro guid="{398ECC88-D926-4855-95DA-AE12E2717D01}" hidden="false" name="É" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">É</text>
+        </textblock>
+      </macro>
+      <macro guid="{967B164E-2A41-40FC-9DF4-E4A71DCA47D4}" hidden="false" name="æ" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">æ</text>
+        </textblock>
+      </macro>
+      <macro guid="{FF54FD3C-A329-423D-B066-90353342B029}" hidden="false" name="ô" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ô</text>
+        </textblock>
+      </macro>
+      <macro guid="{A686B704-9103-4E1D-B35E-1690186D348C}" hidden="false" name="ö" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ö</text>
+        </textblock>
+      </macro>
+      <macro guid="{F9338E9B-8A53-4E5C-BA3D-C6E1533D76BF}" hidden="false" name="ò" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ò</text>
+        </textblock>
+      </macro>
+      <macro guid="{AE0FA47F-A5E6-433A-BB12-8CB9233317D5}" hidden="false" name="û" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">û</text>
+        </textblock>
+      </macro>
+      <macro guid="{B4732647-3AFF-4C66-B31D-789F220A413B}" hidden="false" name="ù" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ù</text>
+        </textblock>
+      </macro>
+      <macro guid="{B9420538-EF54-4E0F-9808-5F1ED4D90EFB}" hidden="false" name="ÿ" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ÿ</text>
+        </textblock>
+      </macro>
+      <macro guid="{AEBBF991-4764-44B2-80B2-8EDEFC2A19A1}" hidden="false" name="ç" color="4278215935">
+        <textblock xmlns="http://www.logitech.com/Cassandra/2010.2/Macros/TextBlock">
+          <text playback="normal" delay="0" hasdelay="false">ç</text>
+        </textblock>
+      </macro>
+    </macros>
+    <assignments devicecategory="Logitech.Gaming.Keyboard">
+      <assignment backup="false" original="false" shiftstate="2" contextid="G1" macroguid="{FF54FEB5-843F-465A-B8BA-9CAA2C4B70B9}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G1" macroguid="{FF54FEB5-843F-465A-B8BA-9CAA2C4B70B9}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G10" macroguid="{002D4039-63A2-4FFB-B9A6-4F2337042B54}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G10" macroguid="{002D4039-63A2-4FFB-B9A6-4F2337042B54}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G11" macroguid="{E432B456-E65C-4009-9115-FFF884011BEF}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G11" macroguid="{E432B456-E65C-4009-9115-FFF884011BEF}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G12" macroguid="{A36371DC-A978-440E-85B5-336C2AFCA14F}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G12" macroguid="{A36371DC-A978-440E-85B5-336C2AFCA14F}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G13" macroguid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G13" macroguid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G14" macroguid="{244636E5-5C47-4982-8A76-E216A920F49F}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G14" macroguid="{244636E5-5C47-4982-8A76-E216A920F49F}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G15" macroguid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G15" macroguid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G16" macroguid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G16" macroguid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G17" macroguid="{793AC04D-F6DB-4E47-8D93-068B95FD54E3}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G17" macroguid="{793AC04D-F6DB-4E47-8D93-068B95FD54E3}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G18" macroguid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G18" macroguid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G2" macroguid="{1ED530F3-5A13-4EB1-800C-DF0D6873ED88}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G2" macroguid="{1ED530F3-5A13-4EB1-800C-DF0D6873ED88}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G3" macroguid="{B06BEC6C-12A7-4F2A-AC97-BBF7B7EDF353}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G3" macroguid="{B06BEC6C-12A7-4F2A-AC97-BBF7B7EDF353}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G4" macroguid="{33BDD50A-3E5C-4EE3-A440-91C2A94230CB}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G4" macroguid="{33BDD50A-3E5C-4EE3-A440-91C2A94230CB}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G5" macroguid="{FA55D2A3-9611-4B9A-8705-17C74B82FB64}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G5" macroguid="{FA55D2A3-9611-4B9A-8705-17C74B82FB64}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G6" macroguid="{035A0274-52FD-4530-A7B9-EB66B6BEB647}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G6" macroguid="{035A0274-52FD-4530-A7B9-EB66B6BEB647}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G7" macroguid="{2FDFE890-93C0-4BDB-851B-03D0E06337C1}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G7" macroguid="{2FDFE890-93C0-4BDB-851B-03D0E06337C1}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G8" macroguid="{23A95548-5C2F-423A-A76C-0A341F636BF5}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G8" macroguid="{23A95548-5C2F-423A-A76C-0A341F636BF5}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G9" macroguid="{A83EA296-1C6B-4523-996A-69D7830524CD}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G9" macroguid="{A83EA296-1C6B-4523-996A-69D7830524CD}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G18" macroguid="{B9420538-EF54-4E0F-9808-5F1ED4D90EFB}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G17" macroguid="{B4732647-3AFF-4C66-B31D-789F220A413B}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G16" macroguid="{AE0FA47F-A5E6-433A-BB12-8CB9233317D5}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G15" macroguid="{F9338E9B-8A53-4E5C-BA3D-C6E1533D76BF}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G14" macroguid="{A686B704-9103-4E1D-B35E-1690186D348C}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G13" macroguid="{FF54FD3C-A329-423D-B066-90353342B029}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G12" macroguid="{967B164E-2A41-40FC-9DF4-E4A71DCA47D4}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G11" macroguid="{398ECC88-D926-4855-95DA-AE12E2717D01}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G10" macroguid="{912E5F3B-CF0C-4B0B-84FA-47D21D3F4590}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G9" macroguid="{CB9E4444-A164-4A71-BD1B-90D0337D5051}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G8" macroguid="{87231FC8-37A7-47DD-96A2-11EC7735DD29}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G7" macroguid="{87231FC8-37A7-47DD-96A2-11EC7735DD29}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G6" macroguid="{BCBE72FF-688C-483A-99BD-B50415FE48BF}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G5" macroguid="{450A4DB1-121D-49D4-BC5F-5A660E3F5010}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G4" macroguid="{F955462C-4A7F-4E5E-9476-C475369CF2BC}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G3" macroguid="{4B522E13-577C-41C8-9246-1AF8F9E4B050}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G2" macroguid="{A3B99BE9-9449-40BA-836E-187790487528}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G1" macroguid="{AEBBF991-4764-44B2-80B2-8EDEFC2A19A1}"/>
+    </assignments>
+    <assignments devicecategory="Logitech.Gaming.LeftHandedController">
+      <assignment backup="false" original="false" shiftstate="1" contextid="G1" macroguid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G1" macroguid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G1" macroguid="{0E5FBC48-AEF2-4D47-AB9A-52FF8DE7A581}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G10" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G10" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G10" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G11" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G11" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G11" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G12" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G12" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G12" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G13" macroguid="{053C4FB8-E85A-4993-9C29-6E504C75DB2F}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G13" macroguid="{053C4FB8-E85A-4993-9C29-6E504C75DB2F}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G13" macroguid="{053C4FB8-E85A-4993-9C29-6E504C75DB2F}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G14" macroguid="{C76A7B08-F7A1-4CB1-A05B-F376B76FEB3C}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G14" macroguid="{C76A7B08-F7A1-4CB1-A05B-F376B76FEB3C}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G14" macroguid="{C76A7B08-F7A1-4CB1-A05B-F376B76FEB3C}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G15" macroguid="{B6A5C255-A379-498D-AAD9-290F1EB43B98}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G15" macroguid="{B6A5C255-A379-498D-AAD9-290F1EB43B98}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G15" macroguid="{B6A5C255-A379-498D-AAD9-290F1EB43B98}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G16" macroguid="{474C3E34-3395-4059-93C8-3D4076673135}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G16" macroguid="{474C3E34-3395-4059-93C8-3D4076673135}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G16" macroguid="{474C3E34-3395-4059-93C8-3D4076673135}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G17" macroguid="{AEB183E0-9019-4392-896B-4DAC8330FA67}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G17" macroguid="{AEB183E0-9019-4392-896B-4DAC8330FA67}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G17" macroguid="{AEB183E0-9019-4392-896B-4DAC8330FA67}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G18" macroguid="{0BD1FF8D-B460-46A4-9866-EAFB2ECF3617}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G18" macroguid="{0BD1FF8D-B460-46A4-9866-EAFB2ECF3617}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G18" macroguid="{0BD1FF8D-B460-46A4-9866-EAFB2ECF3617}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G19" macroguid="{33F8DE88-FEAC-42ED-BA8A-3C4755FA6D67}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G19" macroguid="{33F8DE88-FEAC-42ED-BA8A-3C4755FA6D67}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G19" macroguid="{33F8DE88-FEAC-42ED-BA8A-3C4755FA6D67}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G2" macroguid="{244636E5-5C47-4982-8A76-E216A920F49F}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G2" macroguid="{244636E5-5C47-4982-8A76-E216A920F49F}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G2" macroguid="{244636E5-5C47-4982-8A76-E216A920F49F}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G20" macroguid="{6631B94C-725B-4541-B7FD-E0FEDA3156F3}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G20" macroguid="{6631B94C-725B-4541-B7FD-E0FEDA3156F3}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G20" macroguid="{6631B94C-725B-4541-B7FD-E0FEDA3156F3}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G21" macroguid="{93ECFD56-95ED-4B57-A385-8CF72DB5F6B6}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G21" macroguid="{93ECFD56-95ED-4B57-A385-8CF72DB5F6B6}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G21" macroguid="{93ECFD56-95ED-4B57-A385-8CF72DB5F6B6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G22" macroguid="{012C64E4-210B-4199-97BC-F051CE3488E6}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G22" macroguid="{012C64E4-210B-4199-97BC-F051CE3488E6}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G22" macroguid="{012C64E4-210B-4199-97BC-F051CE3488E6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G23" macroguid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G23" macroguid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G23" macroguid="{CB9CC75B-A8ED-444E-8EDB-B28802D714CF}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G24" macroguid="{D0AE6D96-FA68-44C3-9962-F25237E48823}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G24" macroguid="{D0AE6D96-FA68-44C3-9962-F25237E48823}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G24" macroguid="{D0AE6D96-FA68-44C3-9962-F25237E48823}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G25" macroguid="{6FDA729B-2DD1-4505-9693-A8D2CC88A956}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G25" macroguid="{6FDA729B-2DD1-4505-9693-A8D2CC88A956}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G25" macroguid="{6FDA729B-2DD1-4505-9693-A8D2CC88A956}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G26" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G26" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G26" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G27" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G27" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G27" macroguid="{438FEFE1-A4AC-40C2-9247-B31379391066}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G28" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G28" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G28" macroguid="{719E14B7-92C8-4231-AD72-C30450EBFC10}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G29" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G29" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G29" macroguid="{63BE7C7A-4937-4CC4-89A1-EA58900D686A}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G3" macroguid="{088F6952-C5AF-4CD9-8596-C1744B12501F}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G3" macroguid="{088F6952-C5AF-4CD9-8596-C1744B12501F}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G3" macroguid="{088F6952-C5AF-4CD9-8596-C1744B12501F}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G4" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G4" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G4" macroguid="{D9ED5310-3F5A-42C8-803C-32CF24C0A3CE}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G5" macroguid="{35060C60-D9F5-4F61-B7F0-351005026E00}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G5" macroguid="{35060C60-D9F5-4F61-B7F0-351005026E00}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G5" macroguid="{35060C60-D9F5-4F61-B7F0-351005026E00}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G6" macroguid="{CEBC90AE-8677-4F05-BA4F-A8436AC9EAB6}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G6" macroguid="{CEBC90AE-8677-4F05-BA4F-A8436AC9EAB6}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G6" macroguid="{CEBC90AE-8677-4F05-BA4F-A8436AC9EAB6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G7" macroguid="{569B3CF7-7D76-4E72-94A3-D8B6DA43C6A2}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G7" macroguid="{569B3CF7-7D76-4E72-94A3-D8B6DA43C6A2}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G7" macroguid="{569B3CF7-7D76-4E72-94A3-D8B6DA43C6A2}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G8" macroguid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G8" macroguid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G8" macroguid="{7C5CEB62-4CC5-425F-A442-8ADB5C713D73}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="G9" macroguid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="G9" macroguid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="G9" macroguid="{585D6928-6DA4-4865-A4CD-6E6A40687F75}"/>
+    </assignments>
+    <assignments devicecategory="Logitech.Gaming.Mouse">
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button1" macroguid="{5DAFA657-7E0B-4D37-9F7A-FA252ED551E6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button2" macroguid="{9D0F4485-F6CE-49AF-B3FB-328DBF996F1E}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button3" macroguid="{8B615B23-6FDC-4430-9E57-E5CCBCAC4575}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button4" macroguid="{A0D817F6-1D5D-483B-ADD0-2634CD93D42A}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button5" macroguid="{8B13562D-60F2-460F-9588-8C84168C81BC}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button6" macroguid="{89F0C712-9AF7-4099-9C53-1868BF5B9A4E}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button7" macroguid="{68A1C0B2-2996-4992-9CC5-3285AC8E9740}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button8" macroguid="{12C9716B-4D7A-4F6F-AF20-A0369219119A}"/>
+    </assignments>
+    <assignments devicecategory="Logitech.Gaming.Mouse.G300">
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button1" macroguid="{5DAFA657-7E0B-4D37-9F7A-FA252ED551E6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button2" macroguid="{9D0F4485-F6CE-49AF-B3FB-328DBF996F1E}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button3" macroguid="{8B615B23-6FDC-4430-9E57-E5CCBCAC4575}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button4" macroguid="{A0D817F6-1D5D-483B-ADD0-2634CD93D42A}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button5" macroguid="{8B13562D-60F2-460F-9588-8C84168C81BC}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button6" macroguid="{6631B94C-725B-4541-B7FD-E0FEDA3156F3}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button7" macroguid="{93ECFD56-95ED-4B57-A385-8CF72DB5F6B6}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button8" macroguid="{53E81537-5916-4AB3-B052-ABF88B5DD218}"/>
+      <assignment backup="false" original="false" shiftstate="1" contextid="Button9" macroguid="{28F1F32A-678A-4CD8-A0F4-41283A737EFC}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button1" macroguid="{5DAFA657-7E0B-4D37-9F7A-FA252ED551E6}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button2" macroguid="{9D0F4485-F6CE-49AF-B3FB-328DBF996F1E}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button3" macroguid="{8B615B23-6FDC-4430-9E57-E5CCBCAC4575}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button4" macroguid="{A0D817F6-1D5D-483B-ADD0-2634CD93D42A}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button5" macroguid="{8B13562D-60F2-460F-9588-8C84168C81BC}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button6" macroguid="{12C9716B-4D7A-4F6F-AF20-A0369219119A}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button7" macroguid="{68A1C0B2-2996-4992-9CC5-3285AC8E9740}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button8" macroguid="{53E81537-5916-4AB3-B052-ABF88B5DD218}"/>
+      <assignment backup="false" original="false" shiftstate="2" contextid="Button9" macroguid="{A1FEC5BC-9A8A-49C5-B085-0E2EDCEF1F55}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button1" macroguid="{5DAFA657-7E0B-4D37-9F7A-FA252ED551E6}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button2" macroguid="{9D0F4485-F6CE-49AF-B3FB-328DBF996F1E}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button3" macroguid="{8B615B23-6FDC-4430-9E57-E5CCBCAC4575}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button4" macroguid="{A0D817F6-1D5D-483B-ADD0-2634CD93D42A}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button5" macroguid="{8B13562D-60F2-460F-9588-8C84168C81BC}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button6" macroguid="{F7899D9E-8B25-45CB-B4BC-AAF99E4C87D4}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button7" macroguid="{5638A489-F156-4122-A7DB-E0F880FACC0E}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button8" macroguid="{53E81537-5916-4AB3-B052-ABF88B5DD218}"/>
+      <assignment backup="false" original="false" shiftstate="3" contextid="Button9" macroguid="{2F5C8F56-C184-4143-8852-2EB924626DCC}"/>
+    </assignments>
+    <pointers>
+      <pointer devicemodel="Logitech.Gaming.Mouse.G600">
+        <mode shiftstate="1">
+          <reportrate rate="500"/>
+          <powermode value="2"/>
+          <dpitable shiftindex="0" syncxy="1" defaultindex="0">
+            <dpi enabled="1" x="1200" y="1200"/>
+            <dpi enabled="0" x="2000" y="2000"/>
+            <dpi enabled="0" x="3200" y="3200"/>
+            <dpi enabled="0" x="5000" y="5000"/>
+            <dpi enabled="0" x="8200" y="8200"/>
+          </dpitable>
+          <movement speed="-1" acceleration="1"/>
+        </mode>
+        <mode shiftstate="2">
+          <reportrate rate="500"/>
+          <powermode value="2"/>
+          <dpitable shiftindex="0" syncxy="1" defaultindex="0">
+            <dpi enabled="1" x="1200" y="1200"/>
+            <dpi enabled="0" x="2000" y="2000"/>
+            <dpi enabled="0" x="3200" y="3200"/>
+            <dpi enabled="0" x="5000" y="5000"/>
+            <dpi enabled="0" x="8200" y="8200"/>
+          </dpitable>
+          <movement speed="-1" acceleration="1"/>
+        </mode>
+        <mode shiftstate="3">
+          <reportrate rate="500"/>
+          <powermode value="2"/>
+          <dpitable shiftindex="0" syncxy="1" defaultindex="1">
+            <dpi enabled="1" x="400" y="400"/>
+            <dpi enabled="1" x="1200" y="1200"/>
+            <dpi enabled="1" x="2000" y="2000"/>
+            <dpi enabled="1" x="3200" y="3200"/>
+            <dpi enabled="0" x="8200" y="8200"/>
+          </dpitable>
+          <movement speed="-1" acceleration="1"/>
+        </mode>
+      </pointer>
+    </pointers>
+    <backlight devicemodel="Logitech.Gaming.Mouse.G300">
+      <mode shiftstate="1" color="#ff0000"/>
+      <mode shiftstate="2" color="#00ff00"/>
+      <mode shiftstate="3" color="#0000ff"/>
+    </backlight>
+    <backlight devicemodel="Logitech.Gaming.Keyboard.G11">
+      <mode shiftstate="1" color="#000000"/>
+      <mode shiftstate="2" color="#000000"/>
+      <mode shiftstate="3" color="#000000"/>
+    </backlight>
+    <script>function OnEvent(event, arg)
+	--OutputLogMessage("event = %s, arg = %s\n", event, arg);
+end</script>
+  </profile>
+</profiles>

+ 25 - 0
UCadencer.dfm

@@ -0,0 +1,25 @@
+object Form4: TForm4
+  Left = 260
+  Top = 55
+  Width = 928
+  Height = 480
+  Caption = 'Form4'
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnDestroy = FormDestroy
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLCadencer1: TGLCadencer
+    Scene = Form1.Scene1
+    TimeMultiplier = 0.500000000000000000
+    MinDeltaTime = 0.010000000000000000
+    OnProgress = GLCadencer1Progress
+    Left = 160
+    Top = 120
+  end
+end

+ 536 - 0
UCadencer.pas

@@ -0,0 +1,536 @@
+unit UCadencer;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs,Unit1,GLKeyboard, GLScene, GLCadencer;
+
+type
+  TForm4 = class(TForm)
+    GLCadencer1: TGLCadencer;
+    procedure FormDestroy(Sender: TObject);    
+    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
+      newTime: Double);
+    function Jumpheight(ID:Integer):Real;
+    function Jumpstrength(Speed:Real):Real;
+    procedure ShowPlayers(const deltatime:double);
+    procedure ShowNPC(const deltatime:double);
+    procedure MovePlayer(const deltatime:double);
+    procedure ModifyThrust(const deltatime:double);  
+    procedure UpdateSpeed;
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+  end;
+
+var
+  Form4: TForm4;
+  maxJumpHeight:Real;   //4-PlayerHeight[false]
+
+  MoveDirX,MoveDirZ:Real;
+
+  Lastjumptime:Real=0;
+
+  LastPos:Integer;
+
+  CameraDirection:Integer;
+
+implementation
+
+uses UColorByID,Math,UMoveToRoom,GLHUDObjects,UMYUtils;
+
+{$R *.dfm}
+
+procedure TForm4.GLCadencer1Progress(Sender: TObject; const deltaTime,
+  newTime: Double);
+begin
+  ModifyThrust(deltaTime); //0 ms
+
+  if (not IsKeyDown(32))
+  and (not Players[MyID].jumping) then
+  jumppressed:=false;
+
+  if inMenu or Lost then begin
+    Camera.Turn(20*deltatime);
+  end;
+  MovePlayer(deltaTime); //0,0668ms    
+
+
+                               
+
+  
+  Camera.Position.Y:=Jumpheight(MyID);  //0,0003ms
+  if players[MyId].CeilWalk then
+  Camera.Position.Y:=-Camera.Position.Y+2;
+
+  Players[MyID].X:=Camera.Position.X+PosX*20;
+  Players[MyID].Z:=Camera.Position.Z+PosZ*20;
+
+  ShowPlayers(deltaTime); //0,0025ms
+  
+//  if FrameCount>3 then
+//  SW.ResetTimer;
+//  for C1:=1 to 1000000 do begin
+                       
+  ShowNPC(deltaTime); //0,0024ms  
+
+//  if FrameCount<=3 then Break;
+//  end;
+//  if FrameCount>3 then
+//  showmessage(inttostr(SW.TimeElapsedmilliSecs));
+
+  Inc(FrameCount);
+end;
+
+procedure TForm4.ShowNPC(const deltatime:double); 
+var C1,C2:Integer;
+begin
+  for C1:=-RaumRange to RaumRange do
+  for C2:=-RaumRange to RaumRange do
+  if MuhNPCArr[C1,C2].Body.Visible then begin
+    MuhNPCArr[C1,C2].Body.Position.X:=
+    MuhNPCArr[C1,C2].Body.Position.X+
+    MuhNPCArr[C1,C2].MoveX;                             
+    if MuhNPCArr[C1,C2].Body.Position.X>8.5+20*C1 then begin
+      MuhNPCArr[C1,C2].Body.Position.X:=8.5+20*C1
+      -(MuhNPCArr[C1,C2].Body.Position.X-(8.5+20*C1));
+      MuhNPCArr[C1,C2].MoveX:=-MuhNPCArr[C1,C2].MoveX;
+    end;
+    if MuhNPCArr[C1,C2].Body.Position.X<-8.5+20*C1 then begin
+      MuhNPCArr[C1,C2].Body.Position.X:=-8.5+20*C1
+      +((-8.5+20*C1)-MuhNPCArr[C1,C2].Body.Position.X);
+      MuhNPCArr[C1,C2].MoveX:=-MuhNPCArr[C1,C2].MoveX;
+    end;                
+
+    MuhNPCArr[C1,C2].Body.Position.Y:=
+    MuhNPCArr[C1,C2].Body.Position.Y+
+    MuhNPCArr[C1,C2].MoveY;    
+
+    if MuhNPCArr[C1,C2].Body.Position.Y>3 then begin
+      MuhNPCArr[C1,C2].Body.Position.Y:=3
+      -(MuhNPCArr[C1,C2].Body.Position.Y-3);
+      MuhNPCArr[C1,C2].MoveY:=-MuhNPCArr[C1,C2].MoveY;
+    end;
+    if MuhNPCArr[C1,C2].Body.Position.Y<-1 then begin
+      MuhNPCArr[C1,C2].Body.Position.Y:=-1
+      +(-1-MuhNPCArr[C1,C2].Body.Position.Y);
+      MuhNPCArr[C1,C2].MoveY:=-MuhNPCArr[C1,C2].MoveY;
+    end;
+
+    MuhNPCArr[C1,C2].Body.Position.Z:=
+    MuhNPCArr[C1,C2].Body.Position.Z+
+    MuhNPCArr[C1,C2].MoveZ;
+
+    if MuhNPCArr[C1,C2].Body.Position.Z>8.5+20*C2 then begin
+      MuhNPCArr[C1,C2].Body.Position.Z:=8.5+20*C2
+      -(MuhNPCArr[C1,C2].Body.Position.Z-(8.5+20*C2));
+      MuhNPCArr[C1,C2].MoveZ:=-MuhNPCArr[C1,C2].MoveZ;
+    end;
+    if MuhNPCArr[C1,C2].Body.Position.Z<-8.5+20*C2 then begin
+      MuhNPCArr[C1,C2].Body.Position.Z:=-8.5+20*C2
+      +((-8.5+20*C2)-MuhNPCArr[C1,C2].Body.Position.Z);
+      MuhNPCArr[C1,C2].MoveZ:=-MuhNPCArr[C1,C2].MoveZ;
+    end;
+  end;
+end;
+         
+
+function TForm4.Jumpstrength(Speed:Real):Real;
+begin
+  if Speed<=15 then
+  Result:=-7/180*sqr(Players[MyID].Speed)+Players[MyID].Speed*1.15
+  else Result:=Speed*0.6;
+end;
+
+function TForm4.Jumpheight(ID:Integer):Real;
+var JumpStrenghtByID:Real; RT:PRoomtype;
+begin
+  JumpStrenghtByID:=Jumpstrength(Players[ID].Speed);
+  if (Players[ID].Speed<=0)
+  or (Players[ID].jumptime<-0.00001) then begin
+    Players[ID].jumping:=false;
+    Result:=-2+PlayerDepth[false];
+    Exit;
+  end;
+
+  Result:=      
+  -4.905*sqr(Players[ID].jumptime)
+  +JumpStrenghtByID*Players[ID].jumptime
+  -2+PlayerDepth[false];
+
+  RT:=GetRT(Round(Players[ID].X/20),Round(Players[ID].Z/20));
+  if (Result>maxJumpHeight) and not Won then begin
+    if                    
+    ((RT.MaterialName[Up]='Open') and not Players[ID].Ceilwalk)
+    or
+    ((RT.MaterialName[Down]='Open') and Players[ID].Ceilwalk) then
+    Players[ID].OutOfMaze:=true;
+    
+    if not Players[ID].OutOfMaze then begin
+      Players[ID].jumptime:=Players[ID].jumptime+
+      (200*sqrt(
+      sqr(JumpStrenghtByID)+(981*(-2+PlayerDepth[false]))
+      /50-(981*maxJumpHeight)/50))
+      /981;
+
+      Result:=
+      -4.905*sqr(Players[ID].jumptime)
+      +JumpStrenghtByID*Players[ID].jumptime
+      -2+PlayerDepth[false];
+    end;
+  end;
+
+
+  if not Players[ID].OutOfMaze and (Result<-2+PlayerDepth[false]) then begin
+    if
+    ((RT.MaterialName[Down]='Open') and not Players[ID].Ceilwalk)
+    or
+    ((RT.MaterialName[Up]='Open') and Players[ID].Ceilwalk) then begin
+      Players[ID].OutOfMaze:=true;
+    end else begin
+      Players[ID].jumping:=false;
+      Result:=-2+PlayerDepth[false];
+    end;
+  end;
+
+  
+  Players[ID].OutOfMaze:=
+  (Result<-2.001+PlayerDepth[false])
+  or (Result>4.001-PlayerHeight[false]);
+
+  if Result>200 then Result:=200;
+  if Result<-200 then Result:=200;
+end;
+
+procedure TForm4.FormDestroy(Sender: TObject);
+begin
+  GLCadencer1.Enabled:=false;
+end;
+
+procedure TForm4.MovePlayer(const deltatime:double);
+var R1:Real; MinY,MaxY:Real;
+begin
+  if not Lost then begin
+    Form1.GLUserInterface1.MouseUpdate;
+    Form1.GLUserInterface1.MouseLook;
+
+    if Ceil(Camera.Direction.X)+2*Ceil(Camera.Direction.Z)
+
+    <>CameraDirection then
+    Form1.Reload;
+  end;
+  if not Players[MyID].jumping then begin
+    MoveDirX:=Camera.Position.X;
+    MoveDirZ:=Camera.Position.Z;
+
+    if isKeyDown('w') then begin
+      if not (isKeyDown('d'))
+      and not (isKeyDown('a'))
+      then R1:=Players[MyID].Speed else R1:=Players[MyID].Speed/sqrt(2);
+    end else
+    if isKeyDown('a') then begin
+      if not (isKeyDown('w'))
+      and not (isKeyDown('s'))
+      then R1:=Players[MyID].Speed else R1:=Players[MyID].Speed/sqrt(2);
+    end else
+    if isKeyDown('s') then begin
+      if not (isKeyDown('d'))
+      and not (isKeyDown('a'))
+      then R1:=Players[MyID].Speed else R1:=Players[MyID].Speed/sqrt(2);
+    end else
+    if isKeyDown('d') then begin
+      if not (isKeyDown('w'))
+      and not (isKeyDown('s'))
+      then R1:=Players[MyID].Speed else R1:=Players[MyID].Speed/sqrt(2);
+    end else R1:=0;
+
+    if not inMenu and not Lost and
+    not GetRT(PosX,PosZ).PushPlayer[THeight(Players[MyID].Ceilwalk)] then begin
+      if isKeyDown('w') then Camera.Move(R1*deltatime);
+      if isKeyDown('s') then Camera.Move(-R1*deltatime);
+      if isKeyDown('d') then Camera.Slide(R1*deltatime);
+      if isKeyDown('a') then Camera.Slide(-R1*deltatime);
+    end;
+
+    if GetRT(PosX,PosZ).PushPlayer[THeight(Players[MyID].Ceilwalk)] and
+    assigned(Map[PosX,PosZ].Inhalt.Daten) then begin
+      case TRichtung(Map[PosX,PosZ].Inhalt.Daten^) of
+        px:Camera.Position.X:=Camera.Position.X+deltaTime*30;
+        nx:Camera.Position.X:=Camera.Position.X-deltatime*30;
+        pz:Camera.Position.Z:=Camera.Position.Z+deltatime*30;
+        nz:Camera.Position.Z:=Camera.Position.Z-deltatime*30;
+      end;
+
+      if not
+      (isKeyDown('w')        
+      or isKeyDown('s')
+      or isKeyDown('d')
+      or isKeyDown('a')) then
+      if (
+        ((TRichtung(Map[PosX,PosZ].Inhalt.Daten^)=px)
+      and GetRT(PosX+1,PosZ).PushPlayer[THeight(Players[MyID].Ceilwalk)]
+      and (TRichtung(Map[PosX+1,PosZ].Inhalt.Daten^)=nx))
+      or ((TRichtung(Map[PosX,PosZ].Inhalt.Daten^)=nx)
+      and GetRT(PosX-1,PosZ).PushPlayer[THeight(Players[MyID].Ceilwalk)]
+      and (TRichtung(Map[PosX-1,PosZ].Inhalt.Daten^)=px))
+      or ((TRichtung(Map[PosX,PosZ].Inhalt.Daten^)=nz)
+      and GetRT(PosX,PosZ-1).PushPlayer[THeight(Players[MyID].Ceilwalk)]
+      and (TRichtung(Map[PosX,PosZ-1].Inhalt.Daten^)=pz))
+      or ((TRichtung(Map[PosX,PosZ].Inhalt.Daten^)=pz)
+      and GetRT(PosX,PosZ+1).PushPlayer[THeight(Players[MyID].Ceilwalk)]
+      and (TRichtung(Map[PosX,PosZ+1].Inhalt.Daten^)=nz))
+      ) then
+      case TRichtung(Map[PosX,PosZ].Inhalt.Daten^) of
+        px:Camera.Position.X:=Min(Camera.Position.X+deltaTime,9.99);
+        nx:Camera.Position.X:=Max(Camera.Position.X-deltatime,-9.99);
+        pz:Camera.Position.Z:=Min(Camera.Position.Z+deltatime,9.99);
+        nz:Camera.Position.Z:=Max(Camera.Position.Z-deltatime,-9.99);
+      end;
+    end;
+  end else begin
+    Camera.Position.X:=Camera.Position.X+2*MoveDirX*deltatime;
+    Camera.Position.Z:=Camera.Position.Z+2*MoveDirZ*deltatime;
+  end;
+
+  MinY:=Camera.Position.Y-PlayerDepth[players[MyId].CeilWalk];
+  MaxY:=Camera.Position.Y+PlayerHeight[players[MyId].CeilWalk];
+  if ((MaxY<4) and (MaxY>-2))
+  or ((MinY<4) and (MinY>-2)) then begin
+    if (Camera.Position.X>8.5)
+    and (px in Map[posX,PosZ].Walls) then begin
+      Camera.Position.X:=8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.Z>8.5)
+    and (pz in Map[posX,PosZ].Walls) then begin
+      Camera.Position.Z:=8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+    if (Camera.Position.X<-8.5)
+    and (nx in Map[posX,PosZ].Walls) then begin
+      Camera.Position.X:=-8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.Z<-8.5)
+    and (nz in Map[posX,PosZ].Walls) then begin
+      Camera.Position.Z:=-8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+  end;
+
+  if ((MaxY<1) and (MaxY>-2))
+  or ((MinY<1) and (MinY>-2)) then begin
+    if (Camera.Position.X>8.5)
+    and (px in Map[posX,PosZ].DownWalls) then begin
+      Camera.Position.X:=8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.X<-8.5)
+    and (nx in Map[posX,PosZ].DownWalls) then begin
+      Camera.Position.X:=-8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.Z>8.5)
+    and (pz in Map[posX,PosZ].DownWalls) then begin
+      Camera.Position.Z:=8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+    if (Camera.Position.Z<-8.5)
+    and (nz in Map[posX,PosZ].DownWalls) then begin
+      Camera.Position.Z:=-8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+  end;
+
+  if ((MaxY<4) and (MaxY>1))
+  or ((MinY<4) and (MinY>1)) then begin
+    if (Camera.Position.X>8.5)
+    and (px in Map[posX,PosZ].UpWalls) then begin
+      Camera.Position.X:=8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.X<-8.5)
+    and (nx in Map[posX,PosZ].UpWalls) then begin
+      Camera.Position.X:=-8.5;
+      if Players[Myid].jumping then MoveDirX:=-MoveDirX;
+    end;
+    if (Camera.Position.Z>8.5)
+    and (pz in Map[posX,PosZ].UpWalls) then begin
+      Camera.Position.Z:=8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+    if (Camera.Position.Z<-8.5)
+    and (nz in Map[posX,PosZ].UpWalls) then begin
+      Camera.Position.Z:=-8.5;
+      if Players[Myid].jumping then MoveDirZ:=-MoveDirZ;
+    end;
+  end;
+      
+
+  if not Players[Myid].jumping then begin
+    MoveDirX:=(Camera.Position.X-MoveDirX)/deltatime;
+    MoveDirZ:=(Camera.Position.Z-MoveDirZ)/deltatime;  
+  end;
+
+  repeat
+    if Camera.Position.X>10 then begin
+      Camera.Position.X:=Camera.Position.X-20;
+      Inc(PosX);
+      MoveToRoom(PosX-1,PosZ);
+    end;
+    if Camera.Position.Z>10 then begin
+      Camera.Position.Z:=Camera.Position.Z-20;
+      Inc(Posz);
+      MoveToRoom(PosX,PosZ-1);
+    end;
+    if Camera.Position.X<-10 then begin
+      Camera.Position.X:=Camera.Position.X+20;
+      Dec(PosX);
+      MoveToRoom(PosX+1,PosZ);
+    end;
+    if Camera.Position.Z<-10 then begin
+      Camera.Position.Z:=Camera.Position.Z+20;
+      Dec(Posz);
+      MoveToRoom(PosX,PosZ+1);
+    end;
+  until (Camera.Position.X<=10)
+  and (Camera.Position.Z<=10)
+  and (Camera.Position.X>=-10)
+  and (Camera.Position.Z>=-10);
+end;
+
+
+procedure TForm4.ShowPlayers(const deltatime:double);
+var C2:Integer;  R,G,B:Real;
+begin
+  for C2:=0 to High(playerarr) do begin   
+    Players[C2].jumptime:=Players[C2].jumptime+deltatime;
+
+    if Cardinal(C2)<>MyID then begin
+      if Players[C2].LastTimeEnd-Players[C2].LastTimeStart<>0 then
+      playerarr[C2].Position.X:=Players[C2].LastX
+      +(GetTickCount-Players[C2].LastTimeStart)
+      /(Players[C2].LastTimeEnd-Players[C2].LastTimeStart)
+      *(Players[C2].X-Players[C2].LastX);
+      if Gettickcount>Players[C2].LastTimeEnd then
+      playerarr[C2].Position.X:=Players[C2].X;
+      playerarr[C2].Position.X:=playerarr[C2].Position.X-PosX*20;
+
+
+      if players[C2].jumping then Players[C2].Y:=Jumpheight(C2)
+      else Players[C2].Y:=-2+PlayerDepth[false];
+      if players[C2].CeilWalk then
+      Players[C2].Y:=-Players[C2].Y+2;
+      Players[C2].Y:=Players[C2].Y
+      -PlayerDepth[Players[C2].CeilWalk]
+      +(PlayerDepth[Players[C2].CeilWalk]
+      +PlayerHeight[Players[C2].CeilWalk])/2;
+      playerarr[C2].Position.Y:=Players[C2].Y;
+
+      
+            
+      if Players[C2].LastTimeEnd-Players[C2].LastTimeStart<>0 then
+      playerarr[C2].Position.Z:=Players[C2].LastZ
+      +(GetTickCount-Players[C2].LastTimeStart)
+      /(Players[C2].LastTimeEnd-Players[C2].LastTimeStart)
+      *(Players[C2].Z-Players[C2].LastZ);
+      if Gettickcount>Players[C2].LastTimeEnd then
+      playerarr[C2].Position.Z:=Players[C2].Z;
+      playerarr[C2].Position.Z:=playerarr[C2].Position.Z-PosZ*20;
+
+      if C2>High(PlayerGoalDistPanels) then
+      Setlength(PlayerGoalDistPanels,C2+1);
+      if not assigned(PlayerGoalDistPanels[C2]) then begin
+        PlayerGoalDistPanels[C2]:=
+        TGLHUDText(Form1.PlayerGoalDists.AddNewChild(TGLHUDText));
+        PlayerGoalDistPanels[C2].BitmapFont:=Form1.PlayerGoalDistFont;
+        RedbyID(C2,R);
+        GreenbyID(C2,G);
+        BluebyID(C2,B);
+        PlayerGoalDistPanels[C2].ModulateColor.SetColor(R,G,B); 
+        PlayerGoalDistPanels[C2].Position.SetPoint
+        (0.01*self.Width,Form1.PlayerGoalDistFont.Font.Size*(C2+0.5),0);
+      end;
+      PlayerGoalDistPanels[C2].Text:=
+      'P'+IntToStr(C2)+': '
+      +FloatToStr(Round(10*sqrt
+      (sqr(GoalPos.X*20-(playerarr[C2].Position.X+PosX*20))
+      +sqr(GoalPos.Y*20-(playerarr[C2].Position.Z+PosZ*20))))/10);
+
+         
+
+      Playerarr[C2].Visible:=
+      ((RaumRange+1)*20>Playerarr[C2].Position.X)
+      and ((RaumRange+1)*20>Playerarr[C2].Position.Z)
+      and ((-RaumRange-1)*20<Playerarr[C2].Position.X)
+      and ((-RaumRange-1)*20<Playerarr[C2].Position.Z);
+    end else begin    //mit C2=MYID durchführen
+      if not Lost then
+      Players[MyID].Dead:=false;
+      playerarr[C2].Position.SetPoint(Camera.Position.DirectVector);
+
+      if C2>High(PlayerGoalDistPanels) then
+      Setlength(PlayerGoalDistPanels,C2+1);
+      if not assigned(PlayerGoalDistPanels[C2]) then begin
+        PlayerGoalDistPanels[C2]:=
+        TGLHUDText(Form1.PlayerGoalDists.AddNewChild(TGLHUDText));
+        PlayerGoalDistPanels[C2].BitmapFont:=Form1.PlayerGoalDistFont;
+        RedbyID(C2,R);
+        GreenbyID(C2,G);
+        BluebyID(C2,B);
+        PlayerGoalDistPanels[C2].ModulateColor.SetColor(R,G,B);   
+        PlayerGoalDistPanels[C2].Position.SetPoint
+        (0.01*self.Width,Form1.PlayerGoalDistFont.Font.Size*(C2+0.5),0);
+      end;
+      PlayerGoalDistPanels[C2].Text:=
+      'Your ID: '+IntToStr(C2);
+
+      Playerarr[C2].Visible:=false;
+
+      Players[MyID].Y:=Camera.Position.Y
+      -PlayerDepth[Players[MyID].CeilWalk]
+      +(PlayerDepth[Players[MyID].CeilWalk]
+      +PlayerHeight[Players[MyID].CeilWalk])/2;
+    end;
+
+    if Playerarr[C2].Position.X>(mapsize+10)*20 then
+    Playerarr[C2].Position.X:=0;
+    if Playerarr[C2].Position.Z>(mapsize+10)*20 then
+    Playerarr[C2].Position.Z:=0;
+    if Playerarr[C2].Position.X<-(mapsize+10)*20 then
+    Playerarr[C2].Position.X:=0;
+    if Playerarr[C2].Position.Z<-(mapsize+10)*20 then
+    Playerarr[C2].Position.Z:=0;
+  end;
+end;
+
+
+procedure TForm4.ModifyThrust(const deltatime:double);
+begin
+  if Lost or inMenu then Exit;
+  if IsKeyDown('u') then Form1.ThrustBar.Position:=
+  Form1.ThrustBar.Position+Round(deltatime*250) else
+  if IsKeyDown('j') then Form1.ThrustBar.Position:=
+  Form1.ThrustBar.Position-Round(deltatime*250) else
+  Exit;
+  if Form1.ThrustBar.Position<5 then Form1.ThrustBar.Position:=5;  
+  UpdateSpeed;
+end;
+
+procedure TForm4.UpdateSpeed;
+begin
+  Players[MyID].Speed:=Players[MyID].Speed*Form1.ThrustBar.Position/LastPos;
+  Form1.GLHUDText1.Text:='Speed: '
+  +Floattostr(Round(100*Players[MyID].Speed)/100)+' m/s';
+  if Players[MyID].Speed<0.0001 then
+  Form1.GLHUDText1.Text:='Speed: 0 m/s'; 
+  LastPos:=Form1.ThrustBar.Position;
+end;
+
+
+end.
+
+
+

+ 125 - 0
UCheckmaze.pas

@@ -0,0 +1,125 @@
+unit UCheckmaze;
+
+interface
+
+uses Unit1;
+               
+procedure InitValidate;
+procedure Validate(X,Z:Integer; Height:THeight);
+ 
+var valid:array [-mapsize..mapsize,-mapsize..mapsize,THeight] of Boolean;
+var validated:array [-mapsize..mapsize,-mapsize..mapsize,THeight] of Boolean;
+var validating:array [-mapsize..mapsize,-mapsize..mapsize,THeight] of Boolean;
+
+implementation
+uses UCreateRaum;
+
+procedure InitValidate;
+var C1,C2:Integer;
+  C3: THeight;
+begin
+  for C1:=-mapsize to mapsize do
+  for C2:=-mapsize to mapsize do
+  for C3:=Down to Up do begin
+    valid[C1,C2,C3]:=false;
+    validated[C1,C2,C3]:=false;
+    validating[C1,C2,C3]:=false;
+  end;
+end;
+
+function Walkable(FromX,FromZ:Integer; Dir:TRichtung; Height:THeight):Boolean;
+begin
+  Result:=not (
+  (Dir in Map[FromX,FromZ].Walls)
+  or ((Dir in Map[FromX,FromZ].UpWalls) and (Height=Up))
+  or ((Dir in Map[FromX,FromZ].DownWalls) and (Height=Down)));
+end;
+
+procedure Validate(X,Z:Integer; Height:THeight);
+begin
+  if not Map[X,Z].created then
+  CreateRaum(X,Z);
+
+  if GetRT(X,Z).PortTo[Up] and (Height=Down) then begin
+    Height:=Up;
+  end;
+
+  if GetRT(X,Z).PortTo[Up] and (Height=Down) then begin
+    Height:=Down;
+  end;
+
+  if validating[X,Z,Height] then Exit;
+  if validated[X,Z,Height] then Exit;
+  
+  if GetRT(X,Z).WinAtArrival
+  then begin
+    valid[X,Z,Height]:=true;
+    validated[X,Z,Height]:=true;
+    Exit;
+  end;
+
+  if not GetRT(X,Z).Passierbar then begin
+    valid[X,Z,Height]:=false;
+    validated[X,Z,Height]:=true;
+    Exit;
+  end;
+
+
+  validating[X,Z,Height]:=true;
+
+
+
+  if (X<>mapsize)
+  and Walkable(X,Z,px,Height) then begin
+    Validate(X+1,Z,Height);
+    if valid[X+1,Z,Height] then begin
+      valid[X,Z,Height]:=true;
+//      validated[X,Z,Height]:=true;
+//      validating[X,Z,Height]:=false;
+//      Exit;
+    end;
+  end;
+
+  if (X<>-mapsize)
+  and Walkable(X,Z,nx,Height) then begin
+    Validate(X-1,Z,Height);
+    if valid[X-1,Z,Height] then begin
+      valid[X,Z,Height]:=true;
+//      validated[X,Z,Height]:=true;
+//      validating[X,Z,Height]:=false;
+//      Exit;
+    end;
+  end;
+
+  if (Z<>mapsize)
+  and Walkable(X,Z,pz,Height) then begin
+    Validate(X,Z+1,Height);
+    if valid[X,Z+1,Height] then begin
+      valid[X,Z,Height]:=true;
+//      validated[X,Z,Height]:=true;
+//      validating[X,Z,Height]:=false;
+//      Exit;
+    end;
+  end;
+
+  if (Z<>-mapsize)
+  and Walkable(X,Z,nz,Height) then begin
+    Validate(X,Z-1,Height);
+    if valid[X,Z-1,Height] then begin
+      valid[X,Z,Height]:=true;
+//      validated[X,Z,Height]:=true;
+//      validating[X,Z,Height]:=false;
+//      Exit;
+    end;
+  end;
+
+  validated[X,Z,Height]:=true;
+  validating[X,Z,Height]:=false;
+  Exit;
+end;
+
+
+
+
+
+end.

+ 46 - 0
UColorByID.pas

@@ -0,0 +1,46 @@
+unit UColorByID;
+
+interface
+
+procedure RedbyID(const ID:Cardinal; Out Red:Byte); overload;
+procedure RedbyID(const ID:Cardinal; Out Red:Real); overload;
+procedure GreenbyID(const ID:Cardinal; Out Red:Byte); overload;
+procedure GreenbyID(const ID:Cardinal; Out Red:Real); overload;
+procedure BluebyID(const ID:Cardinal; Out Red:Byte); overload;
+procedure BluebyID(const ID:Cardinal; Out Red:Real); overload;
+
+implementation
+
+uses Math;            
+    
+procedure RedbyID(const ID:Cardinal; Out Red:Byte); overload;
+begin
+  Red:=Round(power((ID+1)*123,3)+(ID+1)*1234567) mod 255;
+end;
+
+procedure RedbyID(const ID:Cardinal; Out Red:Real); overload;
+begin
+  Red:=(Round(power((ID+1)*123,3)+(ID+1)*1234567) mod 255)/255;
+end;
+
+procedure GreenbyID(const ID:Cardinal; Out Red:Byte); overload;
+begin
+  Red:=Round(power((ID+1)*1234,3)+(ID+1)*123456) mod 255;
+end;
+
+procedure GreenbyID(const ID:Cardinal; Out Red:Real); overload;
+begin
+  Red:=(Round(power((ID+1)*1234,3)+(ID+1)*123456) mod 255)/255;
+end;
+
+procedure BluebyID(const ID:Cardinal; Out Red:Byte); overload;
+begin
+  Red:=Round(power((ID+1)*12356,3)+(ID+1)*12345) mod 255;
+end;
+
+procedure BluebyID(const ID:Cardinal; Out Red:Real); overload;
+begin
+  Red:=(Round(power((ID+1)*12356,3)+(ID+1)*12345) mod 255)/255;
+end;
+
+end.

+ 182 - 0
UCreateRaum.pas

@@ -0,0 +1,182 @@
+unit UCreateRaum;
+
+interface
+
+procedure CreateRaum(x, z: Integer);
+                               
+var
+  WallProb:Real=0.31;
+  UPWallProb:Real=0.11;
+  DownWallProb:Real=0.11;
+  
+implementation
+
+uses Unit1,UNetwork,SysUtils;
+
+const emptyMap=false;
+     
+
+procedure CreateRaum(x,z:Integer);
+var C2,C3:Real; C4:TRichtung; C1,C5:Integer;  found:Boolean;
+begin
+
+  repeat
+    Map[x,z].Walls:=[];
+    Map[x,z].UpWalls:=[];
+    Map[x,z].DownWalls:=[];
+    for C4:=Low(TRichtung) to High(TRichtung) do begin  
+      C2:=Random;
+      C3:=0;
+      C3:=C3+WallProb; 
+      if C2<C3 then begin
+        Map[x,z].Walls:=
+        Map[x,z].Walls+[C4];
+        Continue;
+      end;
+      C3:=C3+UPWallProb;
+      if C2<C3 then begin
+        Map[x,z].UpWalls:=
+        Map[x,z].UpWalls+[C4];
+        Continue;
+      end;
+      C3:=C3+DownWallProb;
+      if C2<C3 then begin
+        Map[x,z].DownWalls:=
+        Map[x,z].DownWalls+[C4]; 
+        Continue;
+      end;
+    end;
+
+
+
+    if Map[x+1,z].created then begin
+      if nx in Map[x+1,z].Walls
+      then Map[x,z].Walls:=Map[x,z].Walls+[px]
+      else Map[x,z].Walls:=Map[x,z].Walls-[px];
+      if nx in Map[x+1,z].UpWalls
+      then Map[x,z].UpWalls:=Map[x,z].UpWalls+[px]
+      else Map[x,z].UpWalls:=Map[x,z].UpWalls-[px];
+      if nx in Map[x+1,z].DownWalls
+      then Map[x,z].DownWalls:=Map[x,z].DownWalls+[px]
+      else Map[x,z].DownWalls:=Map[x,z].DownWalls-[px];
+    end;
+    if Map[x-1,z].created then begin
+      if px in Map[x-1,z].Walls
+      then Map[x,z].Walls:=Map[x,z].Walls+[nx]
+      else Map[x,z].Walls:=Map[x,z].Walls-[nx];
+      if px in Map[x-1,z].UpWalls
+      then Map[x,z].UpWalls:=Map[x,z].UpWalls+[nx]
+      else Map[x,z].UpWalls:=Map[x,z].UpWalls-[nx];
+      if px in Map[x-1,z].DownWalls
+      then Map[x,z].DownWalls:=Map[x,z].DownWalls+[nx]
+      else Map[x,z].DownWalls:=Map[x,z].DownWalls-[nx];
+    end;
+    if Map[x,z+1].created then begin
+      if nz in Map[x,z+1].Walls
+      then Map[x,z].Walls:=Map[x,z].Walls+[pz]
+      else Map[x,z].Walls:=Map[x,z].Walls-[pz];
+      if nz in Map[x,z+1].UpWalls
+      then Map[x,z].UpWalls:=Map[x,z].UpWalls+[pz]
+      else Map[x,z].UpWalls:=Map[x,z].UpWalls-[pz];
+      if nz in Map[x,z+1].DownWalls
+      then Map[x,z].DownWalls:=Map[x,z].DownWalls+[pz]
+      else Map[x,z].DownWalls:=Map[x,z].DownWalls-[pz];
+    end;
+    if Map[x,z-1].created then begin
+      if pz in Map[x,z-1].Walls
+      then Map[x,z].Walls:=Map[x,z].Walls+[nz]
+      else Map[x,z].Walls:=Map[x,z].Walls-[nz];
+      if pz in Map[x,z-1].UpWalls
+      then Map[x,z].UpWalls:=Map[x,z].UpWalls+[nz]
+      else Map[x,z].UpWalls:=Map[x,z].UpWalls-[nz];
+      if pz in Map[x,z-1].DownWalls
+      then Map[x,z].DownWalls:=Map[x,z].DownWalls+[nz]
+      else Map[x,z].DownWalls:=Map[x,z].DownWalls-[nz];
+    end;  
+    if Map[x,z-1].created
+    and Map[x,z+1].created
+    and Map[x+1,z].created
+    and Map[x-1,z].created then Break;
+    if  Map[x,z+1].created
+    and Map[x+1,z].created
+    and Map[x-1,z].created then Break;
+    if Map[x,z-1].created
+    and Map[x+1,z].created
+    and Map[x-1,z].created then Break;
+    if Map[x,z-1].created
+    and Map[x,z+1].created
+    and Map[x-1,z].created then Break;
+    if Map[x,z-1].created
+    and Map[x,z+1].created
+    and Map[x+1,z].created then Break;
+  until ((Map[x,z].Walls<>[]) or (Random>0.75))
+  and ((Map[x,z].Walls<>[px,nx,nz,pz]) or (Random>0.9))
+  and ((Map[x,z].UpWalls<>[px,nx,nz])
+  and (Map[x,z].UpWalls<>[px,nx,pz])
+  and (Map[x,z].UpWalls<>[px,nz,pz])
+  and (Map[x,z].UpWalls<>[nx,nz,pz])
+  or (Random>0.25))
+  and ((Map[x,z].DownWalls<>[px,nx,nz])
+  and (Map[x,z].DownWalls<>[px,nx,pz])
+  and (Map[x,z].DownWalls<>[px,nz,pz])
+  and (Map[x,z].DownWalls<>[nx,nz,pz])
+  or (Random>0.25))
+  and ((Map[x,z].Walls<>[px,nx,nz])
+  and (Map[x,z].Walls<>[px,nx,pz])
+  and (Map[x,z].Walls<>[px,nz,pz])
+  and (Map[x,z].Walls<>[nx,nz,pz])
+  or (Random>0.2));
+
+
+
+
+  if not emptyMap then begin
+    Map[x,z].Inhalt.Daten:=nil;
+    if (x=0) and (z=0) then 
+    Map[x,z].Inhalt.Sorte:=1
+    else begin
+
+      repeat
+        C2:=Random;
+        C3:=0;
+        Map[x,z].Inhalt.Sorte:=0;
+        for C1:=1 to High(Roomtypes) do begin
+          C3:=C3+Roomtypes[C1].Roomfrequenzy;
+          if C3>C2 then begin
+            Map[x,z].Inhalt.Sorte:=C1;
+            Break;
+          end;
+        end;
+        if C3<C2 then Map[x,z].Inhalt.Sorte:=0;
+        
+        found:=false;
+        if GetRT(x,z).NotNextToSelf then
+        for C1:=X-2 to X+2 do
+        for C5:=Z-2 to Z+2 do
+        if Map[C1,C5].created then 
+        if (Map[x,z].Inhalt.Sorte=Map[C1,C5].Inhalt.Sorte)
+        and ((x<>C1) or (z<>C5)) then begin
+          found:=true;
+          Break;
+        end;
+      until not found or (Map[x,z].Inhalt.Sorte=0);
+
+      if GetRT(x,z).TurnRandom[Up]
+      or GetRT(x,z).TurnRandom[Down] then
+      Map[x,z].Inhalt.Daten:=@Richtungen[
+      TRichtung(Random(Integer(High(TRichtung))+1))];
+    end;
+  end;
+
+
+
+  if Form3.ClientSocket.Active then begin
+    Form3.ClientSocket.Socket.SendText(AnsiString(
+    'CreateRaum;'
+    +IntToStr(x)+';'
+    +IntToStr(z)+';'));
+  end else Map[x,z].created:=true;
+end;
+
+end.
+

+ 736 - 0
UIni.pas

@@ -0,0 +1,736 @@
+unit UIni;
+
+interface
+                            
+uses IniFiles,UMyUtils;
+
+procedure ReadDifficulty;
+procedure RewriteDifficulty;
+procedure ReadRoomtypes;
+procedure RewriteRoomtypes;
+procedure RewriteOrigSizes; 
+procedure ReadOrigSizes;
+procedure ReadMPSet;
+procedure RewriteMPSet;
+procedure ReadPanelConfigs;
+procedure RewritePanelConfigs;
+
+var
+  ini:TMyIni;
+  ROOMini:TMyIni;
+  PanelIni:TMyIni;
+
+  OrigSizes:array[0..55] of Real;
+  //Form1.Left,Form1.Top,Form1.Width,Form1.Height,Form1.BorderStyle,    0..4
+  //Round(Panel8.Left/Form1.Width),Round(Panel8.Width/Form1.Width),     5..6
+  //Round(Panel8.Top/Form1.Height),Round(Panel8.Height/Form1.Height),   7..8
+  //Round(Panel9.Left/Form1.Width),Round(Panel9.Width/Form1.Width),     9..10
+  //Round(Panel9.Top/Form1.Height),Round(Panel9.Height/Form1.Height),   11..12
+  //MenuFont.Font.Size/Form1.Height,                                    13..13
+  //PlayerGoalDistFont.Font.Size/Form1.Height                           14..14
+  //MainMenu.Position.X/Form1.Width,                                    15..15
+  //MainMenu.Position.Y/Form1.Height,                                   16..16
+  //0,0,0,0,                                                            17..20
+  //GLHUDText1.Position.X/Form1.Width,GLHUDText1.Position.Y/Form1.Height,21..22
+  //GLHUDText2.Position.X/Form1.Width,GLHUDText2.Position.Y/Form1.Height,23..24
+  //Round(Panel13.Left/Form1.Width),Round(Panel13.Width/Form1.Width),   25..26
+  //Round(Panel13.Top/Form1.Height),Round(Panel13.Height/Form1.Height), 27..28
+  //Round(Panel8.Font.Size/Form1.Width),                                29..29
+  //Round(Panel9.Font.Size/Form1.Width),0,                              30..31
+  //Round(Panel11.Font.Size/Form1.Width),MenuFont.Font.Size/Form1.Width,32..33
+  //Round(Panel13.Font.Size/Form1.Width)                                34..34
+  //RichEdit1.Left/Form1.Width,RichEdit1.Width/Form1.Width,             35..36
+  //RichEdit1.Top/Form1.Height,RichEdit1.Height/Form1.Height            37..38
+  //Richedit1.Font.Size/Form1.Height,                                   39..39
+  //SettingsMenu.Position.X/Form1.Width,                                40..40
+  //SettingsMenu.Position.Y/Form1.Height                                41..41
+  //VideoMenu.Position.X/Form1.Width,                                   42..42
+  //VideoMenu.Position.Y/Form1.Height                                   43..43
+  //0,0                                                                 44..45
+  //MPMenu.Position.X/Form1.Width,                                      46..46
+  //MPMenu.Position.Y/Form1.Height,                                     47..47
+  //MPHostMenu.Position.X/Form1.Width,                                  48..48
+  //MPHostMenu.Position.Y/Form1.Height,                                 49..49
+  //MPJoinMenu.Position.X/Form1.Width,                                  50..50
+  //MPJoinMenu.Position.Y/Form1.Height,                                 51..51
+  //ThrustBar.Top/Form1.Height,ThrustBar.Left/Form1.Width,              52..53
+  //ThrustBar.Height/Form1.Height,ThrustBar.Width/Form1.Width,          54..55
+implementation
+
+uses Unit1,SysUtils,TypInfo,Forms,UNetwork,UCreateRaum,Windows;
+
+
+procedure ReadRoomtypes;
+var C1:Integer; S1,S2:string; C2:THeight;
+begin
+  C1:=0;
+  repeat
+    S2:='RT_'+IntToStr(C1);       
+    ROOMini.SectionDefault:=ini.ReadString('Roomtypelist',S2,'');
+    S1:=ini.ReadString('Roomtypelist',S2,'');
+    if S1='' then Break;
+    SetLength(Roomtypes,C1+1);
+    Roomtypes[C1].ID:=C1;
+    ROOMini.Read('Roomfrequenzy',
+    Roomtypes[C1].Roomfrequenzy);
+    ROOMini.Read('GreenWallsAround',
+    Roomtypes[C1].GreenWallsAround);
+    ROOMini.Read('ChangeWallsAtArrival',
+    Roomtypes[C1].ChangeWallsAtArrival);
+    ROOMini.Read('ChangeSpeedAtArrival',
+    Roomtypes[C1].ChangeSpeedAtArrival);
+    ROOMini.Read('TurnPlayer',
+    Roomtypes[C1].TurnPlayer);
+    ROOMini.Read('PortPlayerToCenter',
+    Roomtypes[C1].PortPlayerToCenter);
+    ROOMini.Read('ChangeOtherPlayerSpeed',
+    Roomtypes[C1].ChangeOtherPlayerSpeed);
+    ROOMini.Read('Contaminate',
+    Roomtypes[C1].Contaminate);
+    ROOMini.Read('OPTanzGegner',
+    Roomtypes[C1].OPTanzGegner);
+    ROOMini.Read('Passierbar',true,
+    Roomtypes[C1].Passierbar);
+    ROOMini.Read('NotAtSpawn',true,
+    Roomtypes[C1].NotAtSpawn);
+    ROOMini.Read('MaterialNameUp','Ceiling',
+    Roomtypes[C1].MaterialName[Up]);
+    ROOMini.Read('MaterialNameDown','Grass',
+    Roomtypes[C1].MaterialName[Down]);
+    ROOMini.Read('WinAtArrival',
+    Roomtypes[C1].WinAtArrival);
+    ROOMini.Read('WallCageTrap',
+    Roomtypes[C1].WallCageTrap);
+    ROOMini.Read('NotNextToSelf',
+    Roomtypes[C1].NotNextToSelf);
+    ROOMini.Read('SPInvisible',
+    Roomtypes[C1].SPInvisible);
+
+
+
+    for C2:=Low(THeight) to High(THeight) do begin
+      ROOMini.Read(
+      'ChangeAtArrivalTo'+GetEnumName(TypeInfo(THeight), Integer(C2)),-1,
+      Roomtypes[C1].ChangeAtArrivalTo[C2]);
+      ROOMini.Read(
+      'Explode'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].Explode[C2]);
+      ROOMini.Read(
+      'ExplodeOtherPlayer'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].ExplodeOtherPlayer[C2]);
+      ROOMini.Read(
+      'PortTo'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].PortTo[C2]);
+      ROOMini.Read(
+      'TurnToGoal'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].TurnToGoal[C2]);
+      ROOMini.Read(
+      'YSNP'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].YSNP[C2]);
+      ROOMini.Read(
+      'TurnRandom'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].TurnRandom[C2]);
+      ROOMini.Read(
+      'PushPlayer'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].PushPlayer[C2]);
+      ROOMini.Read(
+      'InkOthers'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].InkOthers[C2]);
+      ROOMini.Read(
+      'ChangeSpeedRandom'+GetEnumName(TypeInfo(THeight), Integer(C2)),
+      Roomtypes[C1].ChangeSpeedRandom[C2]);
+    end;
+    inc(C1);
+  until false;
+end;
+
+
+procedure RewriteRoomtypes;
+begin
+  ini.SectionDefault:='Roomtypelist';
+  ini.Write('RT_0','empty');
+  ini.Write('RT_1','Arrow');
+  ini.Write('RT_2','Goal');
+  ini.Write('RT_3','YSNP');
+  ini.Write('RT_4','Green');
+  ini.Write('RT_5','GreenTrap');
+  ini.Write('RT_6','WallTrap');
+  ini.Write('RT_7','Speed');
+  ini.Write('RT_8','RedSpeed');
+  ini.Write('RT_9','GreenSpeed');
+  ini.Write('RT_10','Turner');
+  ini.Write('RT_11','UpDownPorter');
+  ini.Write('RT_12','UpPorter');
+  ini.Write('RT_13','DownPorter');
+  ini.Write('RT_14','Explosion');
+  ini.Write('RT_15','RainbowTrap');
+  ini.Write('RT_16','PusherDown');
+  ini.Write('RT_17','BlackExplosion');
+  ini.Write('RT_18','Lightning');
+  ini.Write('RT_19','Contamination');
+  ini.Write('RT_20','PusherUp');
+  ini.Write('RT_21','PusherUpDown');
+  ini.Write('RT_22','InkDown');
+  ini.Write('RT_23','InkUp');
+  ini.Write('RT_24','InkUpDown');
+  ini.Write('RT_25','OPTanzGegnerraum');
+  ini.Write('RT_26','ArrowSpawner');
+  ini.Write('RT_27','RandomSpeed');
+  ini.Write('RT_28','OpenUp');
+  ini.Write('RT_29','OpenDown');
+  ini.Write('RT_30','OpenUpDown');
+  ini.Write('RT_31','Bonbon');
+
+
+  ROOMini.WriteInteger('empty','ID',0);
+  ROOMini.WriteFloat('empty','Roomfrequenzy',0);
+  ROOMini.WriteBool('empty','NotAtSpawn',false);
+
+  ROOMini.WriteString('Arrow','MaterialNameDown','Grass');
+  ROOMini.WriteString('Arrow','MaterialNameUp','Arrow');
+  ROOMini.WriteInteger('Arrow','ID',1);
+  ROOMini.WriteFloat('Arrow','Roomfrequenzy',0.02);
+  ROOMini.WriteBool('Arrow','TurnToGoalUp',true);
+  ROOMini.WriteBool('Arrow','NotAtSpawn',false);
+  ROOMini.WriteBool('Arrow','NotNextToSelf',true);
+
+
+  ROOMini.WriteString('Goal','MaterialNameUp','Goal');
+  ROOMini.WriteInteger('Goal','ID',2);
+  ROOMini.WriteFloat('Goal','Roomfrequenzy',0);
+  ROOMini.WriteBool('Goal','WinAtArrival',true);
+  ROOMini.WriteBool('Goal','TurnRandomUp',true);
+  ROOMini.WriteBool('Goal','NotAtSpawn',false);
+  ROOMini.WriteBool('Goal','NotNextToSelf',true);
+
+  ROOMini.WriteString('YSNP','MaterialNameDown','YSNP');
+  ROOMini.WriteString('YSNP','MaterialNameUp','Ceiling');
+  ROOMini.WriteInteger('YSNP','ID',3);
+  ROOMini.WriteFloat('YSNP','Roomfrequenzy',0.02);
+  ROOMini.WriteBool('YSNP','YSNPUp',true);
+  ROOMini.WriteBool('YSNP','YSNPDown',true);
+  ROOMini.WriteBool('YSNP','TurnPlayer',false);
+  ROOMini.WriteBool('YSNP','PortPlayerToCenter',false);
+  ROOMini.WriteBool('YSNP','Passierbar',false);
+  ROOMini.WriteBool('YSNP','TurnRandomDown',true);
+  ROOMini.WriteBool('YSNP','NotNextToSelf',true);
+
+  ROOMini.WriteString('Green','MaterialNameDown','Grass');
+  ROOMini.WriteString('Green','MaterialNameUp','Ceiling');
+  ROOMini.WriteInteger('Green','ID',4);
+  ROOMini.WriteFloat('Green','Roomfrequenzy',0.042);
+  ROOMini.WriteBool('Green','YSNPUp',false);
+  ROOMini.WriteBool('Green','YSNPDown',false);
+  ROOMini.WriteBool('Green','GreenWallsAround',true);
+  ROOMini.WriteBool('Green','ChangeWallsAtArrival',false);
+  ROOMini.WriteBool('Green','TurnPlayer',false);
+  ROOMini.WriteBool('Green','PortPlayerToCenter',false);
+
+  ROOMini.WriteString('GreenTrap','MaterialNameDown','Grass');
+  ROOMini.WriteString('GreenTrap','MaterialNameUp','Ceiling');
+  ROOMini.WriteInteger('GreenTrap','ID',5);
+  ROOMini.WriteFloat('GreenTrap','Roomfrequenzy',0.042);
+  ROOMini.WriteBool('GreenTrap','YSNPUp',false);
+  ROOMini.WriteBool('GreenTrap','YSNPDown',false);
+  ROOMini.WriteBool('GreenTrap','GreenWallsAround',false);
+  ROOMini.WriteInteger('GreenTrap','ChangeAtArrivalToUp',4);
+  ROOMini.WriteInteger('GreenTrap','ChangeAtArrivalToDown',4);
+  ROOMini.WriteBool('GreenTrap','ChangeWallsAtArrival',false);
+  ROOMini.WriteBool('GreenTrap','TurnPlayer',true);
+  ROOMini.WriteBool('GreenTrap','PortPlayerToCenter',true);
+
+  ROOMini.WriteInteger('WallTrap','ID',6);
+  ROOMini.WriteFloat('WallTrap','Roomfrequenzy',0.035);
+  ROOMini.WriteBool('WallTrap','YSNPUp',false);
+  ROOMini.WriteBool('WallTrap','YSNPDown',false);
+  ROOMini.WriteBool('WallTrap','GreenWallsAround',false);
+  ROOMini.WriteInteger('WallTrap','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('WallTrap','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('WallTrap','ChangeWallsAtArrival',true);
+  ROOMini.WriteBool('WallTrap','TurnPlayer',false);
+  ROOMini.WriteBool('WallTrap','PortPlayerToCenter',false);
+  ROOMini.WriteBool('WallTrap','Passierbar',false);
+
+  ROOMini.WriteString('Speed','MaterialNameDown','BlueSpeed');
+  ROOMini.WriteInteger('Speed','ID',7);
+  ROOMini.WriteFloat('Speed','Roomfrequenzy',0.07);
+  ROOMini.WriteBool('Speed','YSNPUp',false);
+  ROOMini.WriteBool('Speed','YSNPDown',false);
+  ROOMini.WriteBool('Speed','GreenWallsAround',false);
+  ROOMini.WriteInteger('Speed','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('Speed','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('Speed','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('Speed','ChangeSpeedAtArrival',2);
+  ROOMini.WriteBool('Speed','TurnPlayer',false);
+  ROOMini.WriteBool('Speed','PortPlayerToCenter',false);
+  ROOMini.WriteBool('Speed','TurnRandomDown',true);
+
+  ROOMini.WriteString('RedSpeed','MaterialNameDown','RedSpeed');
+  ROOMini.WriteInteger('RedSpeed','ID',8);
+  ROOMini.WriteFloat('RedSpeed','Roomfrequenzy',0.015);
+  ROOMini.WriteInteger('RedSpeed','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('RedSpeed','ChangeAtArrivalToDown',0);
+  ROOMini.WriteFloat('RedSpeed','ChangeSpeedAtArrival',-10);
+  ROOMini.WriteBool('RedSpeed','TurnRandomDown',true);
+
+  ROOMini.WriteString('GreenSpeed','MaterialNameDown','GreenSpeed');
+  ROOMini.WriteInteger('GreenSpeed','ID',9);
+  ROOMini.WriteFloat('GreenSpeed','Roomfrequenzy',0.008);
+  ROOMini.WriteBool('GreenSpeed','YSNPUp',false);
+  ROOMini.WriteBool('GreenSpeed','YSNPDown',false);
+  ROOMini.WriteBool('GreenSpeed','GreenWallsAround',false);
+  ROOMini.WriteInteger('GreenSpeed','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('GreenSpeed','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('GreenSpeed','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('GreenSpeed','ChangeSpeedAtArrival',10);
+  ROOMini.WriteBool('GreenSpeed','TurnPlayer',false);
+  ROOMini.WriteBool('GreenSpeed','PortPlayerToCenter',false);
+  ROOMini.WriteBool('GreenSpeed','TurnRandomDown',true);
+  ROOMini.WriteBool('GreenSpeed','NotNextToSelf',true);
+
+  ROOMini.WriteString('Turner','MaterialNameUp','Turner');
+  ROOMini.WriteInteger('Turner','ID',10);
+  ROOMini.WriteFloat('Turner','Roomfrequenzy',0.1);
+  ROOMini.WriteBool('Turner','ExplodeDown',false);
+  ROOMini.WriteBool('Turner','ExplodeUp',false);
+  ROOMini.WriteBool('Turner','PortToUp',false);
+  ROOMini.WriteBool('Turner','PortToDown',false);
+  ROOMini.WriteBool('Turner','TurnToGoalUp',false);
+  ROOMini.WriteBool('Turner','TurnToGoalDown',false);
+  ROOMini.WriteBool('Turner','YSNPUp',false);
+  ROOMini.WriteBool('Turner','YSNPDown',false);
+  ROOMini.WriteBool('Turner','GreenWallsAround',false);
+  ROOMini.WriteBool('Turner','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('Turner','ChangeSpeedAtArrival',0);
+  ROOMini.WriteBool('Turner','TurnPlayer',true);
+  ROOMini.WriteBool('Turner','PortPlayerToCenter',true);
+
+  ROOMini.WriteString('UpDownPorter','MaterialNameDown','PortDownUp');
+  ROOMini.WriteString('UpDownPorter','MaterialNameUp','PortUpDown');
+  ROOMini.WriteInteger('UpDownPorter','ID',11);
+  ROOMini.WriteFloat('UpDownPorter','Roomfrequenzy',0.015);
+  ROOMini.WriteBool('UpDownPorter','ExplodeDown',false);
+  ROOMini.WriteBool('UpDownPorter','ExplodeUp',false);
+  ROOMini.WriteBool('UpDownPorter','PortToUp',true);
+  ROOMini.WriteBool('UpDownPorter','PortToDown',true);
+  ROOMini.WriteBool('UpDownPorter','TurnToGoalUp',false);
+  ROOMini.WriteBool('UpDownPorter','TurnToGoalDown',false);
+  ROOMini.WriteBool('UpDownPorter','YSNPUp',false);
+  ROOMini.WriteBool('UpDownPorter','YSNPDown',false);
+  ROOMini.WriteBool('UpDownPorter','GreenWallsAround',false);
+//  ROOMini.WriteInteger('UpDownPorter','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteInteger('UpDownPorter','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('UpDownPorter','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('UpDownPorter','ChangeSpeedAtArrival',0);
+  ROOMini.WriteBool('UpDownPorter','TurnPlayer',false);
+  ROOMini.WriteBool('UpDownPorter','PortPlayerToCenter',false);
+  ROOMini.WriteBool('UpDownPorter','NotNextToSelf',true);
+
+  ROOMini.WriteString('UpPorter','MaterialNameDown','PortDownUp');
+  ROOMini.WriteInteger('UpPorter','ID',12);
+  ROOMini.WriteFloat('UpPorter','Roomfrequenzy',0.03);
+  ROOMini.WriteBool('UpPorter','ExplodeDown',false);
+  ROOMini.WriteBool('UpPorter','ExplodeUp',false);
+  ROOMini.WriteBool('UpPorter','PortToUp',true);
+  ROOMini.WriteBool('UpPorter','PortToDown',false);
+  ROOMini.WriteBool('UpPorter','TurnToGoalUp',false);
+  ROOMini.WriteBool('UpPorter','TurnToGoalDown',false);
+  ROOMini.WriteBool('UpPorter','YSNPUp',false);
+  ROOMini.WriteBool('UpPorter','YSNPDown',false);
+  ROOMini.WriteBool('UpPorter','GreenWallsAround',false);
+//  ROOMini.WriteInteger('UpPorter','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('UpPorter','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('UpPorter','ChangeSpeedAtArrival',0);
+  ROOMini.WriteBool('UpPorter','TurnPlayer',false);
+  ROOMini.WriteBool('UpPorter','PortPlayerToCenter',false);
+  ROOMini.WriteBool('UpPorter','NotNextToSelf',true);
+
+  ROOMini.WriteString('DownPorter','MaterialNameUp','PortUpDown');
+  ROOMini.WriteInteger('DownPorter','ID',13);
+  ROOMini.WriteFloat('DownPorter','Roomfrequenzy',0.03);
+  ROOMini.WriteBool('DownPorter','ExplodeDown',false);
+  ROOMini.WriteBool('DownPorter','ExplodeUp',false);
+  ROOMini.WriteBool('DownPorter','PortToUp',false);
+  ROOMini.WriteBool('DownPorter','PortToDown',true);
+  ROOMini.WriteBool('DownPorter','TurnToGoalUp',false);
+  ROOMini.WriteBool('DownPorter','TurnToGoalDown',false);
+  ROOMini.WriteBool('DownPorter','YSNPUp',false);
+  ROOMini.WriteBool('DownPorter','YSNPDown',false);
+  ROOMini.WriteBool('DownPorter','GreenWallsAround',false);
+//  ROOMini.WriteInteger('DownPorter','ChangeAtArrivalToUp',0);
+  ROOMini.WriteBool('DownPorter','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('DownPorter','ChangeSpeedAtArrival',0);
+  ROOMini.WriteBool('DownPorter','TurnPlayer',false);
+  ROOMini.WriteBool('DownPorter','PortPlayerToCenter',false);
+  ROOMini.WriteBool('DownPorter','NotNextToSelf',true);
+
+  ROOMini.WriteString('Explosion','MaterialNameDown','Explosion');
+  ROOMini.WriteInteger('Explosion','ID',14);
+  ROOMini.WriteFloat('Explosion','Roomfrequenzy',0.005);
+  ROOMini.WriteBool('Explosion','ExplodeDown',true);       
+  ROOMini.WriteBool('Explosion','ExplodeUp',true);
+  ROOMini.WriteInteger('Explosion','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('Explosion','ChangeAtArrivalToDown',0);
+  ROOMini.WriteBool('Explosion','ChangeWallsAtArrival',false);
+  ROOMini.WriteFloat('Explosion','ChangeSpeedAtArrival',0);
+  ROOMini.WriteBool('Explosion','TurnRandomDown',true);
+
+  ROOMini.WriteInteger('RainbowTrap','ID',15);
+  ROOMini.WriteFloat('RainbowTrap','Roomfrequenzy',0.05);
+  ROOMini.WriteBool('RainbowTrap','PortToUp',true);
+  ROOMini.WriteBool('RainbowTrap','PortToDown',true);
+  ROOMini.WriteInteger('RainbowTrap','ChangeAtArrivalToUp',0);
+  ROOMini.WriteInteger('RainbowTrap','ChangeAtArrivalToDown',0);
+
+  ROOMini.WriteString('PusherDown','MaterialNameDown','PusherDown');
+  ROOMini.WriteInteger('PusherDown','ID',16);
+  ROOMini.WriteFloat('PusherDown','Roomfrequenzy',0.04);
+  ROOMini.WriteBool('PusherDown','PushPlayerDown',true);
+  ROOMini.WriteBool('PusherDown','TurnRandomDown',true);
+
+//  ROOMini.WriteString('BlackExplosion','MaterialNameDown','BlackExplosion');
+//  ROOMini.WriteInteger('BlackExplosion','ID',17);
+//  ROOMini.WriteFloat('BlackExplosion','Roomfrequenzy',0.01);
+//  ROOMini.WriteBool('BlackExplosion','ExplodeOtherPlayerUp',true);
+//  ROOMini.WriteBool('BlackExplosion','ExplodeOtherPlayerDown',true);
+//  ROOMini.WriteInteger('BlackExplosion','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteInteger('BlackExplosion','ChangeAtArrivalToDown',0);
+//  ROOMini.WriteBool('BlackExplosion','TurnRandomDown',true);
+//  ROOMini.WriteBool('BlackExplosion','NotNextToSelf',true);
+//  ROOMini.WriteBool('BlackExplosion','SPInvisible',true);
+
+//  ROOMini.WriteString('Lightning','MaterialNameUp','Lightning');
+//  ROOMini.WriteInteger('Lightning','ID',18);
+//  ROOMini.WriteFloat('Lightning','Roomfrequenzy',0.025);
+//  ROOMini.WriteInteger('Lightning','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteInteger('Lightning','ChangeAtArrivalToDown',0);
+//  ROOMini.WriteBool('Lightning','ChangeOtherPlayerSpeed',true);
+//  ROOMini.WriteBool('Lightning','TurnRandomUp',true);
+//  ROOMini.WriteBool('Lightning','NotNextToSelf',true);
+//  ROOMini.WriteBool('Lightning','SPInvisible',true);
+
+  ROOMini.WriteString('Contamination','MaterialNameDown','ContaminationDown');
+  ROOMini.WriteString('Contamination','MaterialNameUp','ContaminationUp');
+  ROOMini.WriteInteger('Contamination','ID',19);
+  ROOMini.WriteFloat('Contamination','Roomfrequenzy',0.005);
+  ROOMini.WriteBool('Contamination','Contaminate',true);
+  ROOMini.WriteBool('Contamination','Passierbar',false);
+  ROOMini.WriteBool('Contamination','TurnRandomUp',true);
+  ROOMini.WriteBool('Contamination','TurnRandomDown',true);
+
+  
+
+  ROOMini.WriteString('PusherUp','MaterialNameUp','PusherUp');
+  ROOMini.WriteInteger('PusherUp','ID',20);
+  ROOMini.WriteFloat('PusherUp','Roomfrequenzy',0.04);
+  ROOMini.WriteBool('PusherUp','PushPlayerUp',true);
+  ROOMini.WriteBool('PusherUp','TurnRandomUp',true);
+
+  ROOMini.WriteString('PusherUpDown','MaterialNameDown','PusherDown');
+  ROOMini.WriteString('PusherUpDown','MaterialNameUp','PusherUp');
+  ROOMini.WriteInteger('PusherUpDown','ID',21);
+  ROOMini.WriteFloat('PusherUpDown','Roomfrequenzy',0.01);
+  ROOMini.WriteBool('PusherUpDown','PushPlayerUp',true);
+  ROOMini.WriteBool('PusherUpDown','PushPlayerDown',true);
+  ROOMini.WriteBool('PusherUpDown','TurnRandomUp',true);
+  ROOMini.WriteBool('PusherUpDown','TurnRandomDown',true);
+  ROOMini.WriteBool('PusherUpDown','Passierbar',false);
+
+//  ROOMini.WriteString('InkDown','MaterialNameDown','InkDown');
+//  ROOMini.WriteInteger('InkDown','ID',22);
+//  ROOMini.WriteFloat('InkDown','Roomfrequenzy',0.006);
+//  ROOMini.WriteBool('InkDown','TurnRandomDown',true);
+//  ROOMini.WriteBool('InkDown','InkOthersDown',true);
+//  ROOMini.WriteInteger('InkDown','ChangeAtArrivalToDown',0);
+//  ROOMini.WriteBool('InkDown','NotNextToSelf',true);
+//  ROOMini.WriteBool('InkDown','SPInvisible',true);
+//
+//  ROOMini.WriteString('InkUp','MaterialNameUp','InkUp');
+//  ROOMini.WriteInteger('InkUp','ID',23);
+//  ROOMini.WriteFloat('InkUp','Roomfrequenzy',0.006);
+//  ROOMini.WriteBool('InkUp','TurnRandomUp',true);
+//  ROOMini.WriteBool('InkUp','InkOthersUp',true);
+//  ROOMini.WriteInteger('InkUp','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteBool('InkDown','NotNextToSelf',true);
+//  ROOMini.WriteBool('InkDown','SPInvisible',true);
+//
+//  ROOMini.WriteString('InkUpDown','MaterialNameDown','InkDown');
+//  ROOMini.WriteString('InkUpDown','MaterialNameUp','InkUp');
+//  ROOMini.WriteInteger('InkUpDown','ID',24);
+//  ROOMini.WriteFloat('InkUpDown','Roomfrequenzy',0.002);
+//  ROOMini.WriteBool('InkUpDown','TurnRandomDown',true);
+//  ROOMini.WriteBool('InkUpDown','TurnRandomUp',true);
+//  ROOMini.WriteBool('InkUpDown','InkOthersDown',true);
+//  ROOMini.WriteBool('InkUpDown','InkOthersUp',true);
+//  ROOMini.WriteInteger('InkUpDown','ChangeAtArrivalToDown',0);
+//  ROOMini.WriteInteger('InkUpDown','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteBool('InkUpDown','NotNextToSelf',true);
+//  ROOMini.WriteBool('InkUpDown','SPInvisible',true);
+
+  ROOMini.WriteInteger('OPTanzGegnerraum','ID',25);
+  ROOMini.WriteFloat('OPTanzGegnerraum','Roomfrequenzy',0.005);
+  ROOMini.WriteBool('OPTanzGegnerraum','OPTanzGegner',true);
+  ROOMini.WriteBool('OPTanzGegnerraum','Passierbar',false);
+  ROOMini.WriteBool('OPTanzGegnerraum','NotNextToSelf',true);
+
+//  ROOMini.WriteInteger('ArrowSpawner','ID',26);
+//  ROOMini.WriteFloat('ArrowSpawner','Roomfrequenzy',0.005);
+//  ROOMini.WriteString('ArrowSpawner','MaterialNameUp','ArrowSpawner');
+//  ROOMini.WriteBool('ArrowSpawner','TurnRandomUp',true);
+//  ROOMini.WriteInteger('ArrowSpawner','ChangeAtArrivalToDown',1);
+//  ROOMini.WriteInteger('ArrowSpawner','ChangeAtArrivalToUp',1);
+//  ROOMini.WriteBool('ArrowSpawner','NotNextToSelf',true);
+
+//  ROOMini.WriteString('RandomSpeed','MaterialNameDown','RandomSpeed');
+//  ROOMini.WriteInteger('RandomSpeed','ID',27);
+//  ROOMini.WriteFloat('RandomSpeed','Roomfrequenzy',0.007);
+//  ROOMini.WriteInteger('RandomSpeed','ChangeAtArrivalToUp',0);
+//  ROOMini.WriteInteger('RandomSpeed','ChangeAtArrivalToDown',0);
+//  ROOMini.WriteBool('RandomSpeed','ChangeSpeedRandomUp',true);
+//  ROOMini.WriteBool('RandomSpeed','ChangeSpeedRandomDown',true);
+//  ROOMini.WriteBool('RandomSpeed','TurnRandomDown',true);
+//  ROOMini.WriteFloat('RandomSpeed','ChangeSpeedAtArrival',20);
+//  ROOMini.WriteBool('RandomSpeed','NotNextToSelf',true);
+
+
+  ROOMini.WriteString('OpenDown','MaterialNameDown','Open');
+  ROOMini.WriteInteger('OpenDown','ID',28);
+  ROOMini.WriteFloat('OpenDown','Roomfrequenzy',0.01);
+
+  ROOMini.WriteString('OpenUp','MaterialNameUp','Open');
+  ROOMini.WriteInteger('OpenUp','ID',29);
+  ROOMini.WriteFloat('OpenUp','Roomfrequenzy',0.01);
+                                                         
+  ROOMini.WriteString('OpenUpDown','MaterialNameDown','Open');
+  ROOMini.WriteString('OpenUpDown','MaterialNameUp','Open');
+  ROOMini.WriteInteger('OpenUpDown','ID',30);
+  ROOMini.WriteFloat('OpenUpDown','Roomfrequenzy',0.005);
+  ROOMini.WriteBool('OpenUpDown','Passierbar',false);
+                                                         
+  ROOMini.WriteString('Bonbon','MaterialNameDown','Bonbon');
+  ROOMini.WriteInteger('Bonbon','ID',31);
+  ROOMini.WriteFloat('Bonbon','Roomfrequenzy',0.005);
+  ROOMini.WriteBool('Bonbon','WallCageTrap',true);
+  ROOMini.WriteBool('Bonbon','Passierbar',false);
+  ROOMini.WriteBool('Bonbon','TurnRandomDown',true);
+  ROOMini.WriteBool('Bonbon','NotNextToSelf',true);
+end;
+
+
+procedure ReadPanelConfigs;
+var C1:Integer; S2:string;
+begin
+  C1:=0;
+  repeat
+    S2:='RT_'+IntToStr(C1);
+    PanelIni.SectionDefault:='PC_'+ini.ReadString('Roomtypelist',S2,'');
+    if PanelIni.SectionDefault='PC_' then Break;
+    SetLength(PanelConfigs,C1+1);
+    PanelConfigs[C1].ID:=C1;
+    PanelIni.Read('TopDivH',64/Form1.Height,PanelConfigs[C1].TopDivH);
+    PanelIni.Read('LeftDivW',136/Form1.Width,PanelConfigs[C1].LeftDivW);
+    PanelIni.Read('WidthDivW',849/Form1.Width,PanelConfigs[C1].WidthDivW);
+    PanelIni.Read('HeightDivH',49/Form1.Height,PanelConfigs[C1].HeightDivH);
+    PanelIni.Read('Text',PanelConfigs[C1].Text);
+    PanelIni.Read('FontColor',
+    RGB(255,255,255),Integer(PanelConfigs[C1].FontColor));
+    PanelIni.Read('BackGroundColor',
+    RGB(38,38,38),Integer(PanelConfigs[C1].BackGroundColor));
+    PanelIni.Read('FontSizeDivH',24/Form1.Height,PanelConfigs[C1].FontSizeDivH);
+    PanelIni.Read('Seconds',3,PanelConfigs[C1].Seconds);
+    PanelIni.Read('DontShowIfWon',PanelConfigs[C1].DontShowIfWon);
+    PanelIni.Read('SpeedAtEnd',PanelConfigs[C1].SpeedAtEnd);
+    inc(C1);
+  until false;
+end;
+
+
+procedure RewritePanelConfigs;
+begin
+  PanelIni.SectionDefault:='PC_GreenTrap';
+  PanelIni.Write('ID',5);
+  PanelIni.Write('Text','hihihihihihihihihihihi');
+  PanelIni.Write('FontColor',RGB(232,138,20));
+  PanelIni.Write('BackGroundColor',RGB(10,23,7));
+  PanelIni.Write('LeftDivW',139/Form1.Width);
+  PanelIni.Write('TopDivH',253/Form1.Height);
+  PanelIni.Write('DontShowIfWon',true);
+
+  PanelIni.SectionDefault:='PC_WallTrap';
+  PanelIni.Write('ID',6);
+  PanelIni.Write('Text','Warping Walls!');
+  PanelIni.Write('FontColor',RGB(52,52,219));
+  PanelIni.Write('DontShowIfWon',true); 
+
+  PanelIni.SectionDefault:='PC_Speed';
+  PanelIni.Write('ID',7);
+  PanelIni.Write('Text','Speed increased to');
+  PanelIni.Write('FontColor',RGB(0,168,255));
+  PanelIni.Write('SpeedAtEnd',true);
+
+  PanelIni.SectionDefault:='PC_RedSpeed';
+  PanelIni.Write('ID',8);
+  PanelIni.Write('Text','Speed decreased to');
+  PanelIni.Write('FontColor',RGB(150,25,25));   
+  PanelIni.Write('DontShowIfWon',true);
+  PanelIni.Write('SpeedAtEnd',true);  
+
+  PanelIni.SectionDefault:='PC_GreenSpeed';
+  PanelIni.Write('ID',9);
+  PanelIni.Write('Text','Speed increased to');
+  PanelIni.Write('FontColor',RGB(125,219,45));
+  PanelIni.Write('SpeedAtEnd',true);
+
+  PanelIni.SectionDefault:='PC_Explosion';
+  PanelIni.Write('ID',14);
+  PanelIni.Write('Text','BOOM');
+  PanelIni.Write('FontColor',RGB(23,117,235));
+  PanelIni.Write('BackGroundColor',RGB(232,138,20));
+  PanelIni.Write('LeftDivW',0.05);
+  PanelIni.Write('WidthDivW',0.9);
+  PanelIni.Write('TopDivH',0.1);
+  PanelIni.Write('HeightDivH',0.8);
+  PanelIni.Write('Seconds',1.5);
+  PanelIni.Write('FontSizeDivH',300/Form1.Height);
+  PanelIni.Write('DontShowIfWon',true);  
+
+  PanelIni.SectionDefault:='PC_RandomSpeed';
+  PanelIni.Write('ID',27);
+  PanelIni.Write('Text','Speed changed randomly to');
+  PanelIni.Write('FontColor',RGB(0,0,0));
+  PanelIni.Write('BackGroundColor',RGB(255,255,255));
+  PanelIni.Write('DontShowIfWon',true);
+                  
+  PanelIni.SectionDefault:='PC_Bonbon';
+  PanelIni.Write('ID',31);
+  PanelIni.Write('Text','Trapped!');
+  PanelIni.Write('FontColor',RGB(255,182,80));
+  PanelIni.Write('DontShowIfWon',true);
+end;
+
+procedure RewriteOrigSizes;
+var C1:Integer;
+begin
+  OrigSizes[0]:=Form1.Left;
+  OrigSizes[1]:=Form1.Top;
+  OrigSizes[2]:=Form1.Width;
+  OrigSizes[3]:=Form1.Height;
+  OrigSizes[4]:=Integer(Form1.BorderStyle);
+  OrigSizes[5]:=Form1.Panel8.Left/Form1.Width;
+  OrigSizes[6]:=Form1.Panel8.Width/Form1.Width;
+  OrigSizes[7]:=Form1.Panel8.Top/Form1.Height;
+  OrigSizes[8]:=Form1.Panel8.Height/Form1.Height;
+  OrigSizes[9]:=Form1.Panel9.Left/Form1.Width;
+  OrigSizes[10]:=Form1.Panel9.Width/Form1.Width;
+  OrigSizes[11]:=Form1.Panel9.Top/Form1.Height;
+  OrigSizes[12]:=Form1.Panel9.Height/Form1.Height;
+  OrigSizes[13]:=Form1.MenuFont.Font.Size/Form1.Height;
+  OrigSizes[14]:=Form1.PlayerGoalDistFont.Font.Size/Form1.Height;
+  OrigSizes[15]:=Form1.MainMenu.Position.X/Form1.Width;
+  OrigSizes[16]:=Form1.MainMenu.Position.Y/Form1.Height;
+  OrigSizes[17]:=0;
+  OrigSizes[18]:=0;
+  OrigSizes[19]:=0;
+  OrigSizes[20]:=0;
+
+  OrigSizes[21]:=Form1.GLHUDText1.Position.X/Form1.Width;
+  OrigSizes[22]:=Form1.GLHUDText1.Position.Y/Form1.Height;
+  OrigSizes[23]:=Form1.GLHUDText2.Position.X/Form1.Width;
+  OrigSizes[24]:=Form1.GLHUDText2.Position.Y/Form1.Height;
+
+  OrigSizes[25]:=Form1.Panel13.Left/Form1.Width;
+  OrigSizes[26]:=Form1.Panel13.Width/Form1.Width;
+  OrigSizes[27]:=Form1.Panel13.Top/Form1.Height;
+  OrigSizes[28]:=Form1.Panel13.Height/Form1.Height;
+  OrigSizes[29]:=Form1.Panel8.Font.Size/Form1.Width;
+  OrigSizes[30]:=Form1.Panel9.Font.Size/Form1.Width;
+  OrigSizes[32]:=Form1.Panel11.Font.Size/Form1.Width;
+  OrigSizes[33]:=Form1.MenuFont.Font.Size/Form1.Width;
+  OrigSizes[34]:=Form1.Panel13.Font.Size/Form1.Width;
+  OrigSizes[35]:=Form1.RichEdit1.Left/Form1.Width;
+  OrigSizes[36]:=Form1.RichEdit1.Width/Form1.Width;
+  OrigSizes[37]:=Form1.RichEdit1.Top/Form1.Height;
+  OrigSizes[38]:=Form1.RichEdit1.Height/Form1.Height;
+  OrigSizes[39]:=Form1.Richedit1.Font.Size/Form1.Height;
+
+  OrigSizes[40]:=Form1.SettingsMenu.Position.X/Form1.Width;
+  OrigSizes[41]:=Form1.SettingsMenu.Position.Y/Form1.Height;
+  OrigSizes[42]:=Form1.VideoMenu.Position.X/Form1.Width;
+  OrigSizes[43]:=Form1.VideoMenu.Position.Y/Form1.Height;
+  OrigSizes[44]:=0;
+  OrigSizes[45]:=0;
+  OrigSizes[46]:=Form1.MPMenu.Position.X/Form1.Width;
+  OrigSizes[47]:=Form1.MPMenu.Position.Y/Form1.Height;
+  OrigSizes[48]:=Form1.MPHostMenu.Position.X/Form1.Width;
+  OrigSizes[49]:=Form1.MPHostMenu.Position.Y/Form1.Height;
+  OrigSizes[50]:=Form1.MPJoinMenu.Position.X/Form1.Width;
+  OrigSizes[51]:=Form1.MPJoinMenu.Position.Y/Form1.Height;
+  OrigSizes[52]:=Form1.ThrustBar.Top/Form1.Height;
+  OrigSizes[53]:=Form1.ThrustBar.Left/Form1.Width;
+  OrigSizes[54]:=Form1.ThrustBar.Height/Form1.Height;
+  OrigSizes[55]:=Form1.ThrustBar.Width/Form1.Width;
+    
+  for C1:=Low(OrigSizes) to High(OrigSizes) do
+  ini.WriteFloat('Proportions','OS_'+IntToStr(C1),OrigSizes[C1]);
+end;
+
+procedure ReadDifficulty;
+begin
+  MinGoalDist:=
+  ini.ReadInteger('Difficulty','Minimum Goal Distance',MinGoalDist);
+  MaxGoalDist:=
+  ini.ReadInteger('Difficulty','Maximum Goal Distance',MaxGoalDist);
+  GoalProtectionRadius:=
+  ini.ReadInteger('Difficulty','GoalProtectionRadius',3);
+  WallProb:=
+  ini.ReadFloat('Difficulty','WallProb',WallProb);
+  UPWallProb:=
+  ini.ReadFloat('Difficulty','UPWallProb',UPWallProb);
+  DownWallProb:=
+  ini.ReadFloat('Difficulty','DownWallProb',0.11);
+  StartSpeed:=
+  ini.ReadFloat('Difficulty','StartSpeed',15);
+end;
+
+procedure RewriteDifficulty;
+begin
+  ini.WriteInteger('Difficulty','Minimum Goal Distance',MinGoalDist);
+  ini.WriteInteger('Difficulty','Maximum Goal Distance',MaxGoalDist);
+  ini.WriteInteger('Difficulty','GoalProtectionRadius',GoalProtectionRadius);
+  ini.WriteFloat('Difficulty','WallProb',WallProb);
+  ini.WriteFloat('Difficulty','UPWallProb',UPWallProb);
+  ini.WriteFloat('Difficulty','DownWallProb',DownWallProb);
+  ini.WriteFloat('Difficulty','StartSpeed',StartSpeed);
+end;
+
+procedure ReadOrigSizes;
+var C1:Integer;
+begin
+  for C1:=Low(OrigSizes) to High(OrigSizes) do
+  OrigSizes[C1]:=ini.ReadFloat('Proportions','OS_'+IntToStr(C1),1);
+
+  Form1.BorderStyle:=TFormBorderStyle(Round(OrigSizes[4]));
+  Form1.SetBounds(
+  Round(OrigSizes[0]),
+  Round(OrigSizes[1]),
+  Round(OrigSizes[2]),
+  Round(OrigSizes[3]));
+  Form1.RearrangePanels;
+end;
+    
+
+procedure ReadMPSet;
+begin
+  MPServerAddress:=
+  ini.ReadString('Multiplayer','MPServerAddress','Localhost');
+  MPPort:=
+  ini.ReadInteger('Multiplayer','MPPort',10808);
+end; 
+
+procedure RewriteMPSet;
+begin
+  ini.WriteString('Multiplayer','MPServerAddress',MPServerAddress);
+  ini.WriteInteger('Multiplayer','MPPort',MPPort);
+end;
+
+end.

+ 215 - 0
UMainMenu.pas

@@ -0,0 +1,215 @@
+unit UMainMenu;
+
+interface     
+
+uses Controls,Classes,GLGameMenu;
+
+procedure MouseDownMenu(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
+function PosInMenu(X,Y:Integer; Menu:TGLGameMenu):Boolean;
+procedure SwitchToMenu(Menu:TGLGameMenu);  
+procedure MenuSelect2(Menu:TGLGameMenu; X,Y:Integer);
+
+implementation
+
+uses Unit1,SysUtils,Dialogs,UNetwork,UIni,UMessageThread,Forms,UMyUtils;    
+
+procedure MenuSelect2(Menu:TGLGameMenu; X,Y:Integer);
+begin
+  Y:=Y+26;
+  if (X >= Menu.BoxLeft)  and (Y >= Menu.MenuTop) and
+     (X <= Menu.BoxRight) and (Y <= Menu.BoxBottom) then
+  begin
+    Menu.Selected := (Y - Menu.MenuTop)
+    div (Menu.Font.CharHeight + Menu.Spacing);
+  end;
+end;
+       
+procedure SwitchToMenu(Menu:TGLGameMenu);
+var C1:Integer;
+begin
+  for C1:=0 to Form1.Menu.Count-1 do
+  Form1.Menu.Children[C1].Visible:=false;
+
+  if not Assigned(Menu) then ShowMessage('error 27: menu not assigned')
+  else 
+  Menu.Visible:=true;
+end;
+                                
+function PosInMenu(X,Y:Integer; Menu:TGLGameMenu):Boolean;
+begin    
+  Y:=Y+26;
+  Result:=(X>=Menu.BoxLeft)
+  and (Y>=Menu.MenuTop)
+  and (X<=Menu.BoxRight)
+  and (Y<=Menu.BoxBottom)
+end;
+
+
+procedure MouseDownMenu(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+var C1:Integer; C2:Char;
+begin
+  if (Button<>TMouseButton(0))
+  and (Button<>TMouseButton(3)) then Exit;
+
+  
+  if Form1.MainMenu.Visible
+  and (PosInMenu(X,Y,Form1.MainMenu)
+  or (Button=TMouseButton(3))) then begin
+    if Form1.MainMenu.Selected=0 then begin
+      C2:='p';
+      Form1.FormKeyPress(Sender,C2);
+    end;
+    if Form1.MainMenu.Selected=1 then begin
+      C2:='n';
+      Form1.FormKeyPress(Sender,C2);
+    end;
+    if Form1.MainMenu.Selected=2 then begin
+      SwitchToMenu(Form1.SettingsMenu);
+    end;
+    if Form1.MainMenu.Selected=3 then begin
+      SwitchToMenu(Form1.MPMenu);
+    end;
+    if Form1.MainMenu.Selected=4 then begin
+      C2:='r';
+      Form1.FormKeyPress(Sender,C2);
+    end;
+    if Form1.MainMenu.Selected=5 then begin
+      C2:='b';
+      Form1.FormKeyPress(Sender,C2);
+    end;
+    Exit;
+  end;
+
+
+  if Form1.MPMenu.Visible
+  and (PosInMenu(X,Y,Form1.MPMenu)
+  or (Button=TMouseButton(3))) then begin
+    if Form1.MPMenu.Selected=0 then
+    SwitchToMenu(Form1.MPHostMenu);
+    if Form1.MPMenu.Selected=1 then
+    SwitchToMenu(Form1.MPJoinMenu);  
+    if Form1.MPMenu.Selected=2 then
+    SwitchToMenu(Form1.MainMenu);
+    Exit;
+  end;
+
+
+  if Form1.MPHostMenu.Visible
+  and (PosInMenu(X,Y,Form1.MPHostMenu)
+  or (Button=TMouseButton(3))) then begin
+    if Form1.MPHostMenu.Selected=0 then begin
+      MyInputBox(
+      'Multiplayer-Port',
+      'Port (1024-49151):',
+      IntToStr(MPPort),
+      1025,
+      49150,
+      MPPort);
+      Form3.ClientSocket.Port:=MPPort;
+      Form3.ServerSocket.Port:=MPPort;
+    end;
+    if Form1.MPHostMenu.Selected=1 then begin
+      if Form3.ServerSocket.Active then
+      MessageOut('Server is already open!','Invalid Command')
+      else begin
+        if Form3.ClientSocket.Active then begin
+          if (MessageDlg('Client socket will be closed. Continue?', mtWarning,
+          [mbYes, mbNo], 0) = mrYes) then begin
+            Form3.ClientSocket.Close;
+            Form3.ServerSocket.Open;
+          end;
+        end else Form3.ServerSocket.Open;
+        MessageOut('Server is open to join!','Server open');
+      end;
+    end;
+    if Form1.MPHostMenu.Selected=2 then
+    SwitchToMenu(Form1.MPMenu);
+    Exit;
+  end;
+
+
+  if Form1.MPJoinMenu.Visible
+  and (PosInMenu(X,Y,Form1.MPJoinMenu)
+  or (Button=TMouseButton(3))) then begin
+    if Form1.MPJoinMenu.Selected=0 then begin
+      MyInputBox(
+      'Server-IP',
+      'Servername/IP-Adress:',
+      MPServerAddress,
+      '',
+      MPServerAddress);
+      ini.WriteString('Multiplayer','MPServerAddress',MPServerAddress);
+      Form3.ClientSocket.Host:=MPServerAddress;
+    end;
+    if Form1.MPJoinMenu.Selected=1 then begin
+      MyInputBox(
+      'Multiplayer-Port',
+      'Port (1024-49151):',
+      IntToStr(MPPort),
+      1025,
+      49150,
+      MPPort);
+      Form3.ClientSocket.Port:=MPPort;
+      Form3.ServerSocket.Port:=MPPort;
+    end;
+    if Form1.MPJoinMenu.Selected=2 then begin
+      if Form3.ClientSocket.Active then
+      MessageOut('You are already connected to a game!','Invalid Command')
+      else begin
+        if Form3.ServerSocket.Active then begin
+          if (MessageDlg('Server socket will be closed. Continue?', mtWarning,
+          [mbYes, mbNo], 0) = mrYes) then begin
+            Form3.ServerSocket.Close;
+            Form3.ClientSocket.Open;
+          end;
+        end else Form3.ClientSocket.Open;
+      end;
+    end;
+    if Form1.MPJoinMenu.Selected=3 then
+    SwitchToMenu(Form1.MPMenu);
+    Exit;
+  end;
+
+
+  if Form1.SettingsMenu.Visible
+  and (PosInMenu(X,Y,Form1.SettingsMenu)
+  or (Button=TMouseButton(3))) then begin
+//    if Form1.SettingsMenu.Selected=0 then
+//    SwitchToMenu(Form1.DiffMenu);
+    if Form1.SettingsMenu.Selected=0 then
+    SwitchToMenu(Form1.VideoMenu);
+    if Form1.SettingsMenu.Selected=1 then
+    SwitchToMenu(Form1.MainMenu);
+    Exit;
+  end;
+
+  if Form1.VideoMenu.Visible
+  and (PosInMenu(X,Y,Form1.VideoMenu)
+  or (Button=TMouseButton(3))) then begin
+    if Form1.VideoMenu.Selected=0 then begin
+      C2:='m';
+      Form1.FormKeyPress(Sender,C2);
+    end;
+    if Form1.VideoMenu.Selected=1 then begin
+      MessageOut('Resize yourself by dragging the window`s borders.',
+      'You lazy ass!');
+    end;
+    if Form1.VideoMenu.Selected=2 then begin
+      MyInputBox(
+      'Shading Distance',
+      'Distance:',
+      IntToStr(ShaderWidth),
+      0,
+      RaumRange,
+      ShaderWidth);
+      Form1.ReloadWallShaders;
+    end;
+    if Form1.VideoMenu.Selected=3 then
+    SwitchToMenu(Form1.SettingsMenu);
+    Exit;
+  end;
+end;
+
+end.

+ 37 - 0
UMaterials.dfm

@@ -0,0 +1,37 @@
+object Form2: TForm2
+  Left = 287
+  Top = 170
+  Caption = 'Form2'
+  ClientHeight = 441
+  ClientWidth = 912
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLMaterialLibrary1: TGLMaterialLibrary
+    Materials = <
+      item
+        Name = 'LibMaterial'
+        Tag = 0
+      end>
+    TexturePaths = 'Texturen'
+    Left = 224
+    Top = 264
+  end
+  object ObjectShader: TGLSLDiffuseSpecularShader
+    LightPower = 0.500000000000000000
+    Left = 64
+    Top = 336
+  end
+  object PlaneShader: TGLSLDiffuseSpecularShader
+    Enabled = False
+    LightPower = 0.500000000000000000
+    Left = 88
+    Top = 280
+  end
+end

+ 141 - 0
UMaterials.pas

@@ -0,0 +1,141 @@
+unit UMaterials;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, GLCrossPlatform, {BaseClasses,} GLMaterial, GLCustomShader,
+  GLSLShader, GLSLDiffuseSpecularShader,GLTexture, GLScene, GLBaseClasses;
+
+type
+  TForm2 = class(TForm)
+    GLMaterialLibrary1: TGLMaterialLibrary;
+    ObjectShader: TGLSLDiffuseSpecularShader;
+    PlaneShader: TGLSLDiffuseSpecularShader;
+    procedure loadTextures;
+  private        
+    procedure loadTexture(TexName,FileName:string;Shader:TGLShader);overload;
+    procedure loadTexture(TexName,FileName:string;Shader:TGLShader;
+    ScaleFactor:Real);overload;
+  public
+  end;
+
+var
+  Form2:TForm2;
+  
+implementation
+
+{$R *.dfm}
+
+uses UMyUtils;
+
+
+procedure TForm2.loadTexture(TexName,FileName:string;Shader:TGLShader);
+begin
+  if not FileExists('Texturen\'+FileName+'.jpg') then Exit;
+  GLMaterialLibrary1.AddTextureMaterial(TexName,'Texturen\'+FileName+'.jpg');
+  if Shader<>nil then
+  GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+  1].Shader:=Shader;
+  GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+  1].Material.Texture.TextureMode:=tmDecal;
+end;
+
+procedure TForm2.loadTexture(TexName,FileName:string;Shader:TGLShader;
+  ScaleFactor:Real);
+var BM1,BM2:TBitmap;
+begin                           
+  if not FileExists('Texturen\'+FileName+'.jpg') then Exit;
+  BM1:=JPGtoBMP('Texturen\'+FileName+'.jpg');
+  BM2:=TBitmap.Create;
+  BM2.Width:=Round(BM1.Width*ScaleFactor);
+  BM2.Height:=Round(BM1.Height*ScaleFactor);
+  BM2.Canvas.StretchDraw(Rect(0,0,BM2.Width,BM2.Height),BM1);
+  GLMaterialLibrary1.AddTextureMaterial(TexName,BM2);
+  if Shader<>nil then
+  GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+  1].Shader:=Shader;
+  GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+  1].Material.Texture.TextureMode:=tmDecal;
+end;
+
+procedure TForm2.loadTextures;
+begin
+  try
+    loadTexture('GreenSpeed','GreenSpeed',PlaneShader);
+    loadTexture('RedSpeed','RedSpeed',PlaneShader);
+    loadTexture('BlueSpeed','BlueSpeed',PlaneShader);
+    loadTexture('Explosion','Explosion',PlaneShader);
+    loadTexture('PortDownUp','PortDownUp',PlaneShader);
+    loadTexture('PortUpDown','PortUpDown',PlaneShader);
+    loadTexture('Turner','Turner',PlaneShader);
+    loadTexture('Goal','Goal',PlaneShader);
+    loadTexture('PusherUp','PusherUp',PlaneShader);
+    loadTexture('PusherDown','PusherDown',PlaneShader);
+    loadTexture('grey','grey',nil);
+    loadTexture('Muh','Muh',ObjectShader);
+    loadTexture('RandomSpeed','RandomSpeed',PlaneShader);
+    loadTexture('ArrowSpawner','ArrowSpawner',PlaneShader);
+    loadTexture('BlackExplosion','BlackExplosion',PlaneShader);
+    loadTexture('Lightning','Lightning',PlaneShader);
+    loadTexture('ContaminationDown','ContaminationDown',PlaneShader);
+    loadTexture('ContaminationUp','ContaminationUp',PlaneShader);
+    loadTexture('InkDown','InkDown',PlaneShader);
+    loadTexture('InkUp','InkUp',PlaneShader);
+    loadTexture('Bonbon','Bonbon',PlaneShader);
+    loadTexture('Open','Background',PlaneShader);
+
+    loadTexture('HalfWall','HalfWall',ObjectShader);
+    loadTexture('HalfWallLowRes','HalfWall',ObjectShader,0.5);
+    loadTexture('HalfWallVeryLowRes','HalfWall',ObjectShader,0.25);
+    loadTexture('Wall','Wall',ObjectShader);
+    loadTexture('WallLowRes','Wall',ObjectShader,0.5);
+    loadTexture('WallVeryLowRes','Wall',ObjectShader,0.25);
+
+    loadTexture('Arrow','Arrow',PlaneShader);       
+    loadTexture('CeilingVeryLowRes','Ceiling',PlaneShader,0.1);
+    loadTexture('CeilingLowRes','Ceiling',PlaneShader,0.5);
+    loadTexture('Ceiling','Ceiling',PlaneShader);
+
+    loadTexture('GrassVeryLowRes','Grass',PlaneShader,0.1);
+    loadTexture('GrassLowRes','Grass',PlaneShader,0.5);
+    loadTexture('Grass','Grass',PlaneShader);
+
+    loadTexture('GreenWall','GreenWall',nil);
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.X:=4;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Y:=2;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Z:=4;
+
+    loadTexture('HalfGreenWall','GreenWall',nil);
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.X:=4;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Y:=1;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Z:=4;
+
+    loadTexture('HalfWallFar','HalfWall',nil,0.25);
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.X:=4;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Y:=1;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Z:=4;
+    loadTexture('YSNP','YSNP',PlaneShader);
+    
+    loadTexture('WallFar','Wall',nil,0.25);
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.X:=4;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Y:=2;
+    GLMaterialLibrary1.Materials[GLMaterialLibrary1.Materials.Count-
+    1].TextureScale.Z:=4;
+  except Application.Terminate;
+  end;
+end;
+
+
+end.

+ 65 - 0
UMessageThread.pas

@@ -0,0 +1,65 @@
+unit UMessageThread;
+
+interface
+
+uses
+  Classes,Dialogs,SysUtils,Windows;
+
+procedure MessageOut(ParMessageString,ParMessageCaption:String);
+
+type
+  TMessageThread = class(TThread)    
+  constructor Create(CreateSuspended:Boolean;
+  ParMessageString,ParMessageCaption:String);
+  private
+    { Private declarations }
+  protected
+    procedure Execute; override;
+  public
+    MessageString:String;
+    MessageCaption:String;
+  end;
+
+
+const MaxMessageCount=5;
+var MessageCount:Cardinal=0;
+
+implementation
+
+uses Unit1,ShellApi;
+
+constructor TMessageThread.Create(CreateSuspended:Boolean;
+  ParMessageString,ParMessageCaption:String);
+begin
+  inherited Create(CreateSuspended);
+
+  MessageString:=ParMessageString;
+  MessageCaption:=ParMessageCaption;
+end;
+
+
+
+procedure TMessageThread.Execute;
+begin
+  try
+    Inc(MessageCount);
+    if MessageCount<=MaxMessageCount then 
+    MessageBox(0, PChar(MessageString),
+    PChar(MessageCaption), MB_ICONINFORMATION or MB_OK);
+    Dec(MessageCount);
+  except
+    on e: exception do begin
+      showmessage(e.Message);
+    end;
+  end;
+end;
+
+procedure MessageOut(ParMessageString,ParMessageCaption:String);
+var MessageThread:TMessageThread;
+begin
+  MessageThread:=
+  TMessageThread.Create(true,ParMessageString,ParMessageCaption);
+  MessageThread.Resume;
+end;
+
+end.

+ 442 - 0
UMoveToRoom.pas

@@ -0,0 +1,442 @@
+unit UMoveToRoom;
+
+interface
+
+procedure MoveToRoom(LastX,LastZ:Integer); 
+procedure ChangePlayerSpeed(LastX,LastZ:Integer);
+procedure WarpWalls(LastX,LastZ:Integer);
+
+implementation
+
+uses Unit1,UNetwork,SysUtils,Types,Windows,Math,UCadencer;
+
+
+procedure WarpWalls(LastX,LastZ:Integer);
+var Pos:TPoint;
+begin
+  if LastX<>PosX-1 then begin
+    if nx in Map[PosX,PosZ].Walls
+    then begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls-[nx];
+      Map[PosX-1,PosZ].Walls:=Map[PosX-1,PosZ].Walls-[px];
+    end else if nx in Map[PosX,PosZ].UpWalls
+    then begin
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls-[nx];
+      Map[PosX-1,PosZ].UpWalls:=Map[PosX-1,PosZ].UpWalls-[px];
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls+[nx];
+      Map[PosX-1,PosZ].DownWalls:=Map[PosX-1,PosZ].DownWalls+[px];
+    end else if nx in Map[PosX,PosZ].DownWalls
+    then begin
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls-[nx];
+      Map[PosX-1,PosZ].DownWalls:=Map[PosX-1,PosZ].DownWalls-[px];
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls+[nx];
+      Map[PosX-1,PosZ].UpWalls:=Map[PosX-1,PosZ].UpWalls+[px];
+    end else begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls+[nx];
+      Map[PosX-1,PosZ].Walls:=Map[PosX-1,PosZ].Walls+[px];
+    end;
+  end;
+  if LastX<>PosX+1 then begin
+    if px in Map[PosX,PosZ].Walls
+    then begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls-[px];
+      Map[PosX+1,PosZ].Walls:=Map[PosX+1,PosZ].Walls-[nx];
+    end else if px in Map[PosX,PosZ].UpWalls
+    then begin
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls-[px];
+      Map[PosX+1,PosZ].UpWalls:=Map[PosX+1,PosZ].UpWalls-[nx];
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls+[px];
+      Map[PosX+1,PosZ].DownWalls:=Map[PosX+1,PosZ].DownWalls+[nx];
+    end else if px in Map[PosX,PosZ].DownWalls
+    then begin
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls-[px];
+      Map[PosX+1,PosZ].DownWalls:=Map[PosX+1,PosZ].DownWalls-[nx];
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls+[px];
+      Map[PosX+1,PosZ].UpWalls:=Map[PosX+1,PosZ].UpWalls+[nx];
+    end else begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls+[px];
+      Map[PosX+1,PosZ].Walls:=Map[PosX+1,PosZ].Walls+[nx];
+    end;
+  end;
+  if LastZ<>PosZ-1 then begin
+    if nz in Map[PosX,PosZ].Walls
+    then begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls-[nz];
+      Map[PosX,PosZ-1].Walls:=Map[PosX,PosZ-1].Walls-[pz];
+    end else if nz in Map[PosX,PosZ].UpWalls
+    then begin
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls-[nz];
+      Map[PosX,PosZ-1].UpWalls:=Map[PosX,PosZ-1].UpWalls-[pz];
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls+[nz];
+      Map[PosX,PosZ-1].DownWalls:=Map[PosX,PosZ-1].DownWalls+[pz];
+    end else if nz in Map[PosX,PosZ].DownWalls
+    then begin
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls-[nz];
+      Map[PosX,PosZ-1].DownWalls:=Map[PosX,PosZ-1].DownWalls-[pz];
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls+[nz];
+      Map[PosX,PosZ-1].UpWalls:=Map[PosX,PosZ-1].UpWalls+[pz];
+    end else begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls+[nz];
+      Map[PosX,PosZ-1].Walls:=Map[PosX,PosZ-1].Walls+[pz];
+    end;
+  end;
+  if LastZ<>PosZ+1 then begin
+    if pz in Map[PosX,PosZ].Walls
+    then begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls-[pz];
+      Map[PosX,PosZ+1].Walls:=Map[PosX,PosZ+1].Walls-[nz];
+    end else if pz in Map[PosX,PosZ].UpWalls
+    then begin
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls-[pz];
+      Map[PosX,PosZ+1].UpWalls:=Map[PosX,PosZ-1].UpWalls-[nz];
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls+[pz];
+      Map[PosX,PosZ+1].DownWalls:=Map[PosX,PosZ+1].DownWalls+[nz];
+    end else if pz in Map[PosX,PosZ].DownWalls
+    then begin
+      Map[PosX,PosZ].DownWalls:=Map[PosX,PosZ].DownWalls-[pz];
+      Map[PosX,PosZ+1].DownWalls:=Map[PosX,PosZ+1].DownWalls-[nz];
+      Map[PosX,PosZ].UpWalls:=Map[PosX,PosZ].UpWalls+[pz];
+      Map[PosX,PosZ+1].UpWalls:=Map[PosX,PosZ+1].UpWalls+[nz];
+    end else begin
+      Map[PosX,PosZ].Walls:=Map[PosX,PosZ].Walls+[pz];
+      Map[PosX,PosZ+1].Walls:=Map[PosX,PosZ+1].Walls+[nz];
+    end;
+  end;
+  Pos.X:=PosX;
+  Pos.Y:=PosZ;
+  Form3.SendRaum(Pos);
+    
+  Pos.X:=PosX+1;
+  Form3.SendRaum(Pos);
+  Pos.X:=PosX-1;
+  Form3.SendRaum(Pos);
+              
+  Pos.X:=PosX;
+  Pos.Y:=PosZ+1;
+  Form3.SendRaum(Pos);
+  Pos.Y:=PosZ-1;
+  Form3.SendRaum(Pos);
+end;
+
+
+procedure NormalSpeedLoss(LastX,LastZ:Integer);
+begin
+  if not Won then begin
+    if (not GetRT(PosX,PosZ).PushPlayer[Up])
+    and (not GetRT(PosX,PosZ).PushPlayer[Down])
+    and (not GetRT(LastX,LastZ).PushPlayer[Up])
+    and (not GetRT(LastX,LastZ).PushPlayer[Down]) then
+    Form1.ChangeSpeedBy(-0.08);
+
+    if ((Camera.Position.X<-8.5) and
+    (((nx in Map[PosX,PosZ].UpWalls) and players[MyId].CeilWalk)
+    or ((nx in Map[PosX,PosZ].DownWalls) and not players[MyId].CeilWalk)))
+    then Form1.ChangeSpeedBy(-1);
+    if ((Camera.Position.X>8.5) and
+    (((px in Map[PosX,PosZ].UpWalls) and players[MyId].CeilWalk)
+    or ((px in Map[PosX,PosZ].DownWalls) and not players[MyId].CeilWalk)))
+    then Form1.ChangeSpeedBy(-1);
+    if ((Camera.Position.Z<-8.5) and
+    (((nz in Map[PosX,PosZ].UpWalls) and players[MyId].CeilWalk)
+    or ((nz in Map[PosX,PosZ].DownWalls) and not players[MyId].CeilWalk)))
+    then Form1.ChangeSpeedBy(-1);
+    if ((Camera.Position.Z>8.5) and
+    (((pz in Map[PosX,PosZ].UpWalls) and players[MyId].CeilWalk)
+    or ((pz in Map[PosX,PosZ].DownWalls) and not players[MyId].CeilWalk)))
+    then Form1.ChangeSpeedBy(-1);
+  end;
+end;
+
+
+procedure ChangePlayerSpeed(LastX,LastZ:Integer);
+label LNormalLoss;
+begin
+  if sqrt(sqr(PosX)+sqr(PosZ))>Spawnradius then begin
+  
+    if GetRT(PosX,PosZ).SPInvisible
+    and not Form3.ClientSocket.Active
+    and not Form3.ServerSocket.Active then begin
+      NormalSpeedLoss(LastX,LastZ);
+      Exit;
+    end;
+
+    if GetRT(PosX,PosZ).ChangeSpeedRandom[THeight(Players[MyID].Ceilwalk)]
+    then begin
+      if not Won then begin
+        Form1.ChangeSpeedBy(
+        GetRT(PosX,PosZ).ChangeSpeedAtArrival*(Random-0.4)/0.6);
+      end else begin
+        Form1.ChangeSpeedBy(GetRT(PosX,PosZ).ChangeSpeedAtArrival*Random);
+      end;   
+      Form1.Panel11.Visible:=true;
+      Form1.Panel11.Caption:='Speed changed randomly to '
+      +Floattostr(Round(100*Players[MyID].Speed)/100);
+      Panel11Seconds:=3;
+    end else if (GetRT(PosX,PosZ).ChangeSpeedAtArrival<0.0001)
+    and (GetRT(PosX,PosZ).ChangeSpeedAtArrival>-0.0001) then begin
+      NormalSpeedLoss(LastX,LastZ)
+    end else if (GetRT(PosX,PosZ).ChangeSpeedAtArrival<0.0001)
+    and not Won then begin
+      Form1.ChangeSpeedBy(GetRT(PosX,PosZ).ChangeSpeedAtArrival);
+    end else if (GetRT(PosX,PosZ).ChangeSpeedAtArrival>0.0001) then begin
+      Form1.ChangeSpeedBy(GetRT(PosX,PosZ).ChangeSpeedAtArrival);
+    end;
+  end;
+end;
+
+procedure MoveToRoom(LastX,LastZ:Integer);
+var Pos:TPoint; C1:Integer; OrigHeight:THeight;
+label LSPInvisible,LOutOfMaze;
+begin
+  OrigHeight:=THeight(Players[MyID].Ceilwalk);
+  
+  if PosX<-mapsize+RaumRange+1 then
+  PosX:=mapsize-RaumRange-1;
+  if PosX>mapsize-RaumRange-1 then
+  PosX:=-mapsize+RaumRange+1;
+  if PosZ<-mapsize+RaumRange+1 then
+  PosZ:=mapsize-RaumRange-1;
+  if PosZ>mapsize-RaumRange-1 then
+  PosZ:=-mapsize+RaumRange+1;
+
+  if Players[MyID].OutOfMaze then
+  goto LOutOfMaze;
+
+  ChangePlayerSpeed(LastX,LastZ);
+
+  if GetRT(PosX,PosZ).SPInvisible
+  and not Form3.ClientSocket.Active
+  and not Form3.ServerSocket.Active then
+  goto LSPInvisible;
+
+  if GetRT(PosX,PosZ).PortPlayerToCenter and not Won then begin
+    Camera.Up.X:=0;
+    Camera.Up.Z:=0;
+    Camera.Position.X:=0;
+    Camera.Position.Z:=0;
+  end;
+
+  
+  if GetRT(PosX,PosZ).TurnPlayer and not Won then begin
+    Camera.Direction.X:=0;
+    Camera.Direction.Y:=0;
+    Camera.Direction.Z:=0;
+    if not players[MyId].CeilWalk
+    then Camera.Up.Y:=1
+    else Camera.Up.Y:=-1;
+    Camera.Turn(Random(360));
+  end;
+        
+  if GetRT(PosX,PosZ).WinAtArrival then
+  if not Won then begin
+    Form1.WinGame(MyID);  
+    Form3.SendWin(MyID);
+  end;
+
+  if not Players[MyID].jumping then begin
+    Players[MyID].jumptime:=
+    (100*sqrt(sqr(Form4.JumpStrength(Players[MyID].Speed))-
+    (981*(-2+PlayerDepth[false]))/50)+100
+    *Form4.JumpStrength(Players[MyID].Speed))/981
+  end;
+
+  if GetRT(PosX,PosZ).YSNP[THeight(Players[MyID].Ceilwalk)] and (not Won)
+  then begin
+    Form1.Panel8.Font.Color:=RGB(150,25,25);
+    Form1.Panel8.Color:=RGB(38,38,38);
+    Form1.Panel8.Visible:=true;
+    Form1.Panel8.Caption:='You Shall not Pass!';
+    Form1.LoseGame;
+  end;
+
+  if GetRT(PosX,PosZ).OPTanzGegner and (not Won)
+  then begin
+    Form1.Panel8.Font.Color:=RGB(202,0,215);
+    Form1.Panel8.Color:=RGB(127,127,127);
+    Form1.Panel8.Visible:=true;
+    Form1.Panel8.Caption:='Overpowered: Muh!';
+    Form1.LoseGame;
+  end;
+  
+  if (Map[PosX,PosZ].Inhalt.Sorte=Integer(RainbowTrap)) and (not Won)
+  then begin   //todo 2:ini
+    Form1.RichEdit1.Color:=RGB(38,38,38);
+    Form1.RichEdit1.Visible:=true;
+    Form1.RichEdit1.Lines.Clear;
+    Form1.RichEdit1.Lines.Add('');
+    Form1.RichEdit1.Lines.Add('A Hidden Rainbow!');
+
+    Form1.RichEdit1.SelStart:=2;
+    Form1.RichEdit1.SelLength:=1;
+    Form1.RichEdit1.SelAttributes.Color := RGB(122,0,255);
+
+    Form1.RichEdit1.SelStart:=4;
+    Form1.RichEdit1.SelLength:=2;
+    Form1.RichEdit1.SelAttributes.Color := RGB(0,0,255);
+
+    Form1.RichEdit1.SelStart:=6;
+    Form1.RichEdit1.SelLength:=2;
+    Form1.RichEdit1.SelAttributes.Color := RGB(0,184,0);
+
+    Form1.RichEdit1.SelStart:=8;
+    Form1.RichEdit1.SelLength:=2;
+    Form1.RichEdit1.SelAttributes.Color := RGB(244,244,0);
+
+    Form1.RichEdit1.SelStart:=11;
+    Form1.RichEdit1.SelLength:=1;
+    Form1.RichEdit1.SelAttributes.Color := RGB(244,177,0);
+
+    Form1.RichEdit1.SelStart:=12;
+    Form1.RichEdit1.SelLength:=2;
+    Form1.RichEdit1.SelAttributes.Color := RGB(246,74,0);
+
+    Form1.RichEdit1.SelStart:=14;
+    Form1.RichEdit1.SelLength:=1;
+    Form1.RichEdit1.SelAttributes.Color := RGB(255,0,0);
+
+    Form1.RichEdit1.SelStart:=16;
+    Form1.RichEdit1.SelLength:=2;
+    Form1.RichEdit1.SelAttributes.Color := RGB(135,1,0);
+
+    Form1.RichEdit1.SelStart:=18;
+    Form1.RichEdit1.SelLength:=1;
+    Form1.RichEdit1.SelAttributes.Color := RGB(0,0,0);
+
+    
+    RE1Seconds:=3;
+  end;
+
+  if GetRT(PosX,PosZ).ChangeWallsAtArrival and (not Won) then
+  WarpWalls(LastX,LastZ);
+
+  if GetRT(PosX,PosZ).WallCageTrap and (not Won) then begin
+    Map[PosX,PosZ].Walls:=[pz,px,nx,nz];
+    Map[PosX,PosZ].UpWalls:=[];
+    Map[PosX,PosZ].DownWalls:=[];
+    Map[PosX+1,PosZ].Walls:=Map[PosX+1,PosZ].Walls+[nx];
+    Map[PosX-1,PosZ].Walls:=Map[PosX+1,PosZ].Walls+[px];
+    Map[PosX,PosZ+1].Walls:=Map[PosX+1,PosZ].Walls+[nz];
+    Map[PosX,PosZ-1].Walls:=Map[PosX+1,PosZ].Walls+[pz];
+    Map[PosX+1,PosZ].UpWalls:=Map[PosX+1,PosZ].UpWalls-[nx];
+    Map[PosX-1,PosZ].UpWalls:=Map[PosX+1,PosZ].UpWalls-[px];
+    Map[PosX,PosZ+1].UpWalls:=Map[PosX+1,PosZ].UpWalls-[nz];
+    Map[PosX,PosZ-1].UpWalls:=Map[PosX+1,PosZ].UpWalls-[pz];
+    Map[PosX+1,PosZ].DownWalls:=Map[PosX+1,PosZ].DownWalls-[nx];
+    Map[PosX-1,PosZ].DownWalls:=Map[PosX+1,PosZ].DownWalls-[px];
+    Map[PosX,PosZ+1].DownWalls:=Map[PosX+1,PosZ].DownWalls-[nz];
+    Map[PosX,PosZ-1].DownWalls:=Map[PosX+1,PosZ].DownWalls-[pz];
+    Pos.X:=PosX;
+    Pos.Y:=PosZ;
+    Form3.SendRaum(Pos);
+    Pos.X:=PosX+1;
+    Form3.SendRaum(Pos); 
+    Pos.X:=PosX-1;
+    Form3.SendRaum(Pos); 
+    Pos.X:=PosX;
+    Pos.Y:=PosZ+1;
+    Form3.SendRaum(Pos);
+    Pos.Y:=PosZ-1;
+    Form3.SendRaum(Pos);
+  end;   
+  if GetRT(PosX,PosZ).Contaminate and (not Won)  
+  then begin
+    Form1.ChangeSpeedBy(-RandomRange(-50,292)/100);
+    Form1.Panel11.Font.Color:=RGB(0,0,0);
+    Form1.Panel11.Color:=RGB(249,245,0);
+    Form1.Panel11.Visible:=true;
+    Form1.Panel11.Caption:='Contamination! Speed decreased to '
+    +Floattostr(Round(100*Players[MyID].Speed)/100);
+    Panel11Seconds:=3;
+    if Form3.ClientSocket.Active then  
+    Form3.SendContaminate(PosX,PosZ) else
+    Form1.SpreadContamination(PosX,PosZ);
+  end;
+  
+  if GetRT(PosX,PosZ).InkOthers[THeight(Players[MyID].Ceilwalk)]
+  then Form3.SendInkTrigger(MyID);
+
+  if GetRT(PosX,PosZ).PortTo[Up] and (not Won)
+  and not players[MyId].CeilWalk
+  then begin
+    players[MyId].CeilWalk:=true;
+    Form3.SendCeilWalk;
+    Camera.Up.SetVector(0,-1,0);
+  end else
+  if GetRT(PosX,PosZ).PortTo[Down] and (not Won)
+  and players[MyId].CeilWalk
+  then begin
+    players[MyId].CeilWalk:=false;
+    Form3.SendCeilWalk;
+    Camera.Up.SetVector(0,1,0);
+  end;
+  if GetRT(PosX,PosZ).Explode[THeight(Players[MyID].Ceilwalk)]
+  then begin              
+    Form3.SendExplode(PosX,PosZ);
+    Form1.Explode(PosX,PosZ);
+  end else if GetRT(PosX,PosZ).ChangeOtherPlayerSpeed then begin
+    if Form3.ClientSocket.Active then begin
+      Form3.ClientSocket.Socket.SendText(
+      'Lightning;'
+      +IntToStr(MyID)+';')
+    end else if Form3.ServerSocket.Active then begin
+      Form3.SendSpeedChange(MyID);
+    end;
+  end;
+  if GetRT(PosX,PosZ).ExplodeOtherPlayer[THeight(Players[MyID].Ceilwalk)]
+  then begin
+    for C1:=0 to High(Players) do
+    if (Cardinal(C1)<>MyID)
+    and not Players[C1].Dead then begin   
+      Form3.SendExplode(Round(Players[C1].X/20),Round(Players[C1].Z/20));
+      Form1.Explode(Round(Players[C1].X/20),Round(Players[C1].Z/20));
+    end;
+    if not Won then begin
+      Form1.Panel13.Font.Color:=RGB(255,255,255);
+      Form1.Panel13.Color:=RGB(0,0,0);
+      Form1.Panel13.Visible:=true;
+      Form1.Panel13.Caption:='BOOM';
+      Panel13Seconds:=2;
+    end;
+  end;
+
+  LSPInvisible:
+
+
+  Form1.GLHUDText1.Text:='Speed: '
+  +Floattostr(Round(100*Players[MyID].Speed)/100)+' m/s';
+  if Players[MyID].Speed<0.0001 then
+  Form1.GLHUDText1.Text:='Speed: 0 m/s'; 
+
+  if GetPC(PosX,PosZ).Text<>'' then
+  Form1.ShowPanel(Map[PosX,PosZ].Inhalt.Sorte);
+
+  if GetRT(PosX,PosZ).ChangeAtArrivalTo[OrigHeight]>=0 then begin
+    Map[PosX,PosZ].Inhalt.Sorte:=GetRT(PosX,PosZ).ChangeAtArrivalTo[OrigHeight];
+
+    if GetRT(PosX,PosZ).TurnRandom[Up]
+    or GetRT(PosX,PosZ).TurnRandom[Down] then begin
+      if Assigned(Map[PosX,PosZ].Inhalt.Daten) then
+      Map[PosX,PosZ].Inhalt.Daten:=@Richtungen[
+      TRichtung(Random(Integer(High(TRichtung))+1))];
+      Pos.X:=PosX;
+      Pos.Y:=PosZ;
+      Form3.SendRaum(Pos);
+    end else 
+    Form3.SendRaumSorte(PosX,PosZ);
+  end;
+
+  LOutOfMaze:
+
+  if Players[MyID].Ceilwalk then
+  Form1.GLNavigator1.VirtualUp.SetPoint(0,-1,0)
+  else
+  Form1.GLNavigator1.VirtualUp.SetPoint(0,1,0);
+
+  if Random<0.2 then
+  Form1.Memo1.Visible:=false;
+
+  Form1.Reload;
+end;
+
+
+end.

+ 298 - 0
UMyUtils.pas

@@ -0,0 +1,298 @@
+unit UMyUtils;
+
+interface
+uses IniFiles,Graphics,jpeg,classes;
+
+function GetCurrentVersion: String;
+function RandomRound(const R:Extended):Integer;
+procedure MyInputBox(const ACaption, APrompt, ADefault,Invalid: string;
+  out ResString:String); overload;
+procedure MyInputBox(const ACaption, APrompt, ADefault: string;
+  MinVal,MaxVal:Integer; out ResInteger:Integer); overload; 
+procedure MyInputBox(const ACaption, APrompt, ADefault: string;
+  MinVal,MaxVal:Real; out ResFloat:Real); overload;   
+function JPGtoBMP(const FileName:string):Graphics.TBitmap;   
+procedure CalcFPS(MeasureIntervalSec:Real);
+
+
+type TMyIni=class (TIniFile)
+  public
+    SectionDefault:string;
+    ReadStringDefault:string;
+    ReadBoolDefault:Boolean;
+    ReadFloatDefault:Real;
+    ReadIntDefault:Integer;
+    ReadColorDefault:Integer;
+
+    constructor Create(const FileName: string);
+    
+    procedure Read(const Ident, Default: string;
+    Out ResString:string); overload;
+    procedure Read(const Ident: string;
+    Out ResString:string); overload;
+
+    procedure Read(const Ident: string; Default: Integer;
+    Out ResInt:Integer); overload;
+    procedure Read(const Ident: string;
+    Out ResInt:Integer); overload;
+
+    procedure Read(const Ident: string; Default: Real;
+    Out ResFloat:Real); overload;
+    procedure Read(const Ident: string;
+    Out ResFloat:Real); overload;
+    
+    procedure Read(const Ident: string; Default: Boolean;
+    Out ResBool:Boolean); overload;
+    procedure Read(const Ident: string;
+    Out ResBool:Boolean); overload;
+
+    procedure Write(const Name: string; Value: string); overload;
+    procedure Write(const Name: string; Value: Integer); overload;
+    procedure Write(const Name: string; Value: Real); overload;
+    procedure Write(const Name: string; Value: Boolean); overload;
+end;
+
+type TMyStopWatch=class
+  public
+    Start:Cardinal;
+    constructor create;
+    function TimeElapsedmilliSecs:Cardinal;
+    function TimeElapsedSecs:Real;
+    function TimeElapsedmins:Real;
+    procedure ResetTimer;
+end;
+
+var InformationDump:Cardinal;
+
+
+  //FPS Calculation
+  FPS:Real;
+  FPSMeasureCount:Cardinal=0;
+  FrameCount:Cardinal=0;
+  LastFrameCounts:TList;
+
+  
+implementation
+uses Types,Windows,SysUtils,Math,Dialogs,UMessageThread,Forms;
+
+constructor TMyStopWatch.Create;
+begin
+  inherited Create;
+  ResetTimer;
+end;
+
+procedure TMyStopWatch.ResetTimer;
+begin
+  Start:=GetTickCount;
+end;
+
+function TMyStopWatch.TimeElapsedmilliSecs:Cardinal;
+begin
+  Result:=GetTickCount-Start;
+end;
+
+function TMyStopWatch.TimeElapsedSecs:Real;
+begin
+  Result:=TimeElapsedmilliSecs/1000;
+end;
+
+function TMyStopWatch.TimeElapsedMins:Real;
+begin
+  Result:=TimeElapsedmilliSecs/60000;
+end;
+
+constructor TMyIni.Create(const FileName: string);
+begin
+  inherited Create(FileName);
+  SectionDefault:='';
+  ReadStringDefault:='';
+  ReadBoolDefault:=false;
+  ReadFloatDefault:=NaN;
+  ReadIntDefault:=Low(Integer);
+end;
+
+procedure TMyIni.Write(const Name: string; Value: string);
+begin
+  self.WriteString(SectionDefault,Name,Value);
+end;
+
+procedure TMyIni.Write(const Name: string; Value: Integer);
+begin
+  self.WriteInteger(SectionDefault,Name,Value);
+end;
+
+procedure TMyIni.Write(const Name: string; Value: Real);
+begin
+  self.WriteFloat(SectionDefault,Name,Value);
+end;
+
+procedure TMyIni.Write(const Name: string; Value: Boolean);
+begin
+  self.WriteBool(SectionDefault,Name,Value);
+end;
+
+procedure TMyIni.Read(const Ident, Default: string; Out ResString:string);
+begin
+  ResString:=self.ReadString(SectionDefault,Ident,Default);
+end;
+
+procedure TMyIni.Read(const Ident: string; Out ResString:string);
+begin
+  ResString:=self.ReadString(SectionDefault,Ident,ReadStringDefault);
+end;
+
+procedure TMyIni.Read(const Ident: string; Default: Integer; Out ResInt:Integer);
+begin
+  ResInt:=self.ReadInteger(SectionDefault,Ident,Default);
+end;
+
+procedure TMyIni.Read(const Ident: string; Out ResInt:Integer);
+begin
+  ResInt:=self.ReadInteger(SectionDefault,Ident,ReadIntDefault);
+end;
+
+procedure TMyIni.Read(const Ident: string; Default: Real; Out ResFloat:Real);
+begin
+  ResFloat:=self.ReadFloat(SectionDefault,Ident,Default);
+end;
+
+procedure TMyIni.Read(const Ident: string; Out ResFloat:Real);
+begin
+  ResFloat:=self.ReadFloat(SectionDefault,Ident,ReadFloatDefault);
+end;
+
+procedure TMyIni.Read(const Ident: string; Default: Boolean; Out ResBool:Boolean);
+begin
+  ResBool:=self.ReadBool(SectionDefault,Ident,Default);
+end;
+
+procedure TMyIni.Read(const Ident: string; Out ResBool:Boolean);
+begin
+  ResBool:=self.ReadBool(SectionDefault,Ident,ReadBoolDefault);
+end;
+
+
+procedure MyInputBox(const ACaption, APrompt, ADefault: string;
+  MinVal,MaxVal:Real; out ResFloat:Real);
+var Error:Boolean; S1:String;
+begin
+  repeat
+    try
+      Error:=false;
+      S1:=InputBox(ACaption,APrompt,ADefault);
+      ResFloat:=Strtofloat(S1);
+    except
+      Error:=true;
+    end;
+    if Error then
+    MessageOut('An unknown error occured. Please check if "'+S1+
+    '" is a valid floating point number',
+    'Invalid value') else if (ResFloat>MaxVal) or (ResFloat<MinVal) then
+    MessageOut('Must be true: '+FloatToStr(MinVal)+'<=X<='+FloatToStr(MaxVal),
+    'Invalid value');
+    if Application.Terminated then Break;
+  until (ResFloat<=MaxVal) and (ResFloat>=MinVal) and not Error;
+end;
+
+procedure MyInputBox(const ACaption, APrompt, ADefault: string;
+  MinVal,MaxVal:Integer; out ResInteger:Integer);
+var Error:Boolean; S1:String;
+begin
+  repeat
+    try  
+      Error:=false;
+      S1:=InputBox(ACaption,APrompt,ADefault);
+      ResInteger:=Strtoint(S1);
+    except
+      Error:=true;
+    end;
+    if Error then
+    MessageOut('An unknown error occured. Please check if "'+S1+
+    '" is a valid integer number',
+    'Invalid value') else
+    if (ResInteger>MaxVal) or (ResInteger<MinVal) then
+    MessageOut('Must be true: '+IntToStr(MinVal)+'<=X<='+IntToStr(MaxVal),
+    'Invalid value');
+    if Application.Terminated then Break;
+  until (ResInteger<=MaxVal) and (ResInteger>=MinVal) and not Error;
+end;
+
+function JPGtoBMP(const FileName:string):Graphics.TBitmap;
+var jpg1:TJPEGImage;
+begin
+  Result:=Graphics.TBitmap.Create;
+  jpg1:=TJPEGImage.Create;
+  jpg1.LoadFromFile(FileName);
+  Result.Assign(jpg1);
+end;
+
+procedure CalcFPS(MeasureIntervalSec:Real);
+Var P1:PCardinal; C1:Integer;
+begin
+  if not assigned(LastFrameCounts) then
+  LastFrameCounts:=TList.create;
+  Inc(FPSMeasureCount);
+  if FrameCount<>0 then begin
+    New(P1);
+    P1^:=FrameCount;
+    LastFrameCounts.Add(P1);
+    FrameCount:=0;
+    while LastFrameCounts.Count>Round(5/MeasureIntervalSec) do begin
+      P1:=LastFrameCounts[0];
+      Dispose(P1);
+      LastFrameCounts.Delete(0);
+    end;
+  end;
+  FPS:=0;
+  for C1:=0 to LastFrameCounts.Count-1 do begin
+    P1:=LastFrameCounts[C1];
+    FPS:=FPS+P1^;
+  end;
+  FPS:=FPS/LastFrameCounts.Count/MeasureIntervalSec;
+end;
+
+procedure MyInputBox(const ACaption, APrompt, ADefault,Invalid: string;
+  out ResString:String);
+begin
+  repeat
+    try
+      ResString:=InputBox(ACaption,APrompt,ADefault);
+    except
+      ResString:=Invalid;
+    end;
+    if ResString=Invalid then
+    MessageOut('An unknown error occured.',
+    'Invalid value');   
+    if Application.Terminated then Break;
+  until ResString<>Invalid;
+end;
+
+function GetCurrentVersion: String;
+var
+  VerInfoSize: DWORD;
+  VerInfo: Pointer;
+  VerValueSize: DWORD;
+  VerValue: PVSFixedFileInfo;
+  Dummy: DWORD;
+begin
+  VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy);
+  GetMem(VerInfo, VerInfoSize);
+  GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize, VerInfo);
+  VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
+  with VerValue^ do begin
+    Result := 'Version '+IntToStr(dwFileVersionMS shr 16);
+    Result := Result + '.' + IntToStr(dwFileVersionMS and $FFFF);
+    Result := Result + '.' + IntToStr(dwFileVersionLS shr 16);
+  end;
+  FreeMem(VerInfo, VerInfoSize);
+end;
+
+
+
+function RandomRound(const R:Extended):Integer;
+begin
+  Result:=Floor(R);
+  if Random>Frac(R) then Inc(Result);
+end;
+
+end.

+ 44 - 0
UNetwork.dfm

@@ -0,0 +1,44 @@
+object Form3: TForm3
+  Left = 222
+  Top = 237
+  Caption = 'Form3'
+  ClientHeight = 230
+  ClientWidth = 432
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Timer3: TTimer
+    Interval = 100
+    OnTimer = Timer3Timer
+    Left = 64
+    Top = 104
+  end
+  object ClientSocket: TClientSocket
+    Active = False
+    ClientType = ctNonBlocking
+    Port = 0
+    OnConnect = ClientSocketConnect
+    OnDisconnect = ClientSocketDisconnect
+    OnRead = SocketRead
+    OnError = ClientSocketError
+    Left = 152
+    Top = 56
+  end
+  object ServerSocket: TServerSocket
+    Active = False
+    Port = 0
+    ServerType = stNonBlocking
+    OnClientConnect = ServerSocketClientConnect
+    OnClientRead = SocketRead
+    Left = 160
+    Top = 152
+  end
+end

+ 893 - 0
UNetwork.pas

@@ -0,0 +1,893 @@
+unit UNetwork;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, ScktComp, ExtCtrls;
+                             
+type                         
+  TForm3 = class(TForm)
+    Timer3: TTimer;
+    ClientSocket: TClientSocket;
+    ServerSocket: TServerSocket;
+    procedure ClientSocketConnect(Sender: TObject;
+      Socket: TCustomWinSocket);
+    procedure ClientSocketDisconnect(Sender: TObject;
+      Socket: TCustomWinSocket);
+    procedure ClientSocketError(Sender: TObject; Socket: TCustomWinSocket;
+      ErrorEvent: TErrorEvent; var ErrorCode: Integer);
+    procedure SocketRead(Sender: TObject; Socket: TCustomWinSocket);
+    procedure ServerSocketClientConnect(Sender: TObject;
+      Socket: TCustomWinSocket);
+    procedure Timer3Timer(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure SendMap(Socket: TCustomWinSocket);
+    procedure SendNewID(Socket: TCustomWinSocket);
+    procedure SendGoalPos(Socket: TCustomWinSocket); 
+    procedure RequestNewID(Socket: TCustomWinSocket);
+    procedure AddToPlayerArr(ID:Cardinal);
+  private
+  public
+    procedure SendSpeedChange(ID:Cardinal);
+    procedure SendRaum(Socket: TCustomWinSocket; RaumPos:TPoint);overload;
+    procedure SendRaum(RaumPos:TPoint);overload;
+    procedure SendCeilWalk; overload;
+    procedure SendCeilWalk(Socket: TCustomWinSocket); overload;
+    procedure SendCeilWalk(ID: Cardinal); overload;
+    procedure SendCeilWalk(ID: Cardinal; Socket: TCustomWinSocket); overload;
+    procedure SendWin(ID: Cardinal); overload;
+    procedure SendWin(ID: Cardinal;Socket: TCustomWinSocket); overload;
+    procedure SendKill(ID: Cardinal); overload;
+    procedure SendKill(ID: Cardinal;Socket: TCustomWinSocket); overload;
+    procedure SendJump; overload;
+    procedure SendJump(Socket: TCustomWinSocket); overload;
+    procedure SendJump(ID: Cardinal); overload;
+    procedure SendJump(ID: Cardinal; Socket: TCustomWinSocket); overload;
+    procedure SendRaumSorte(Socket: TCustomWinSocket; RaumPos:TPoint); overload;
+    procedure SendRaumSorte(RaumPos:TPoint); overload;
+    procedure SendRaumSorte(X,Z:Integer); overload;
+    procedure SendExplode(X,Z:Integer; Socket: TCustomWinSocket); overload;
+    procedure SendExplode(X,Z:Integer); overload;
+    procedure SendContaminate(X,Z:Integer);
+    procedure SendPosition; overload;
+    procedure SendPosition(Socket: TCustomWinSocket); overload;
+    procedure SendPosition(ID: Cardinal); overload;
+    procedure SendPosition(ID: Cardinal; Socket: TCustomWinSocket); overload;  
+    procedure SendInkTrigger(ID: Cardinal); overload;
+    procedure SendInkTrigger(ID: Cardinal;Socket: TCustomWinSocket); overload;
+  end;
+
+  
+var
+  Form3:TForm3;
+  IDRecieved:Boolean=true;
+
+  Buffer:Ansistring;
+  NextObjectToRecieve:Ansistring;
+  LastObjectRecieved:Ansistring;
+  RoomRecievePos:TPoint;
+
+  MPServerAddress:string='Localhost';
+  MPPort:Integer=10808;
+
+implementation
+uses Unit1, UMaterials,Math,UCreateRaum;
+
+{$R *.dfm}
+
+
+procedure TForm3.AddToPlayerArr(ID:Cardinal);
+var C3:Integer;
+begin
+  if ID>=Cardinal(Length(Players)) then setlength(Players,ID+1);
+  if ID>=Cardinal(Length(playerarr)) then begin
+    Setlength(playerarr,ID+1);
+    for C3:=0 to High(playerarr) do
+    if not assigned(playerarr[C3])
+    then playerarr[C3]:=Form1.NewPlayer(C3);
+  end;
+  Players[ID].Dead:=false;
+end;
+
+procedure TForm3.SocketRead(Sender: TObject;
+  Socket: TCustomWinSocket);
+var C1,C2,C3,C6,C5:Integer; Data:array of AnsiString;
+  P1:PWallset; C4:Byte; S1:AnsiString; B1:Boolean;
+begin
+  Buffer:=Buffer+Socket.ReceiveText;        
+  C2:=0;
+  C3:=1;
+  for C1:=1 to Length(Buffer) do
+  if Buffer[C1]=';' then begin
+    Inc(C2);
+    Setlength(Data,C2);
+    Data[C2-1]:=copy(Buffer,C3,C1-C3);
+    C3:=C1+1;
+  end;
+  S1:=copy(Buffer,C3,Length(Buffer));
+
+  C1:=0;
+  try
+    while true do begin
+      if NextObjectToRecieve='Reload' then begin
+        Form1.Reload;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        Continue;
+      end;
+      
+      if NextObjectToRecieve='RequestNewID' then begin
+        if ServerSocket.Active then
+        SendNewID(Socket);      
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        Continue;
+      end;
+
+      if C1>High(Data) then Break;      
+
+      if NextObjectToRecieve='Lightning' then begin   
+        C2:=strtoint(String(Data[C1]));
+        if ServerSocket.Active then SendSpeedChange(C2);
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        Continue;
+      end;
+
+      if NextObjectToRecieve='PlayerKill' then begin
+        C2:=strtoint(String(Data[C1]));
+        Players[C2].Dead:=true;
+
+
+        if ServerSocket.Active then
+        SendKill(C2);
+        
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';  
+        C1:=C1+1;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='GameWin' then begin
+        C2:=strtoint(String(Data[C1]));
+        Form1.WinGame(C2);
+
+
+        if ServerSocket.Active then
+        SendWin(C2);
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';  
+        C1:=C1+1;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='InkTrigger' then begin
+        C2:=strtoint(String(Data[C1]));
+        Form1.Memo1.Visible:=true;
+
+
+        if ServerSocket.Active then
+        SendInkTrigger(C2);
+        
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';  
+        C1:=C1+1;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='' then begin
+        NextObjectToRecieve:=Data[C1];
+        C1:=C1+1;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='NewID' then begin
+        IDRecieved:=true; 
+        Players[MyID].Dead:=true;
+        SendKill(MyID);
+        
+        MyID:=strtoint(String(Data[C1]));
+        AddToPlayerArr(MyID);
+        Form1.ChangeSpeedTo(StartSpeed);
+        Form1.GLHUDText1.Text:='Speed: '+Floattostr(Round(100*Players[MyID].Speed)/100);
+        Form1.GLCamera1.Position.X:=0;
+        Form1.GLCamera1.Position.Z:=0; 
+        Form1.GLCamera1.Up.SetVector(0,1,0);
+        PosX:=0;
+        PosZ:=0;
+        Players[MyID].jumping:=false;
+        Players[MyID].X:=0;
+        Players[MyID].Y:=0;
+        Players[MyID].Z:=0;
+        Players[MyID].LastX:=0;
+        Players[MyID].LastZ:=0;
+        Players[MyID].Ceilwalk:=false;      
+        Form1.Reload;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+1;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='JumpStart' then begin
+        C2:=StrToInt(Data[C1]);
+        if C2>=Length(Players) then begin 
+          LastObjectRecieved:=NextObjectToRecieve;
+          NextObjectToRecieve:='';
+          C1:=C1+1;
+          Continue;
+        end;
+        Form1.startJump(C2);
+
+        if ServerSocket.Active then
+        for C3:=0 to ServerSocket.Socket.ActiveConnections-1 do
+        if ServerSocket.Socket.Connections[C3]<>Socket then
+        SendJump(C2,ServerSocket.Socket.Connections[C3]);
+        
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+
+        C1:=C1+1;
+        Continue;
+      end;
+
+
+      if C1+1>High(Data) then Break;  
+
+      if NextObjectToRecieve='ChangeSpeed' then begin
+        C3:=Strtoint(Data[C1+1]);
+        if not ClientSocket.Active then begin
+          LastObjectRecieved:=NextObjectToRecieve;
+          NextObjectToRecieve:='';
+          C1:=C1+2;
+          Continue;
+        end;
+
+        Form1.MultiplySpeedBy(sqrt(
+        sqr(Players[MyID].X-GoalPos.X*20)
+        +sqr(Players[MyID].Z-GoalPos.Y*20))
+        /StrToFloat(Data[C1]));
+
+        if Cardinal(C3)<>MyID then begin
+          Form1.Panel11.Font.Color:=RGB(255,255,0);
+          Form1.Panel11.Color:=RGB(0,0,0);
+          Form1.Panel11.Visible:=true;
+          Form1.Panel11.Caption:='Speed decreased to '
+          +Floattostr(Round(100*Players[MyID].Speed)/100);
+          Panel11Seconds:=3;
+          Form1.GLHUDText1.Text:='Speed: '
+          +Floattostr(Round(100*Players[MyID].Speed)/100);
+        end;
+
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='CreateRaum' then begin
+        RoomRecievePos.X:=Strtoint(Data[C1]);
+        RoomRecievePos.Y:=Strtoint(Data[C1+1]);
+        if not Map[RoomRecievePos.X,RoomRecievePos.Y].created then
+        CreateRaum(RoomRecievePos.X,RoomRecievePos.Y);
+        SendRaum(Socket,RoomRecievePos);
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end;  
+
+      if NextObjectToRecieve='Explode' then begin
+        RoomRecievePos.X:=Strtoint(Data[C1]);
+        RoomRecievePos.Y:=Strtoint(Data[C1+1]);
+        Form1.Explode(RoomRecievePos.X,RoomRecievePos.Y);
+        Form1.Reload;
+
+        if ServerSocket.Active then
+        for C3:=0 to ServerSocket.Socket.ActiveConnections-1 do
+        if ServerSocket.Socket.Connections[C3]<>Socket then
+        SendExplode(RoomRecievePos.X,RoomRecievePos.Y,
+        ServerSocket.Socket.Connections[C3]);
+        
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end; 
+
+      if NextObjectToRecieve='Contaminate' then begin
+        RoomRecievePos.X:=Strtoint(Data[C1]);
+        RoomRecievePos.Y:=Strtoint(Data[C1+1]);
+
+        Form1.SpreadContamination(RoomRecievePos.X,RoomRecievePos.Y);
+
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='GoalPos' then begin
+        if not ServerSocket.Active then begin
+          GoalPos.X:=Strtoint(String(Data[C1]));
+          GoalPos.Y:=Strtoint(String(Data[C1+1]));
+        end;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end;
+
+      if NextObjectToRecieve='CeilWalk' then begin
+        C2:=strtoint(Data[C1]);
+        
+        AddToPlayerArr(C2);
+
+        Players[C2].Ceilwalk:=StrToBool(String(Data[C1+1]));
+
+
+        if ServerSocket.Active then
+        for C3:=0 to ServerSocket.Socket.ActiveConnections-1 do
+        if ServerSocket.Socket.Connections[C3]<>Socket then
+        SendCeilWalk(C2,ServerSocket.Socket.Connections[C3]);
+                                 
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        C1:=C1+2;
+        Continue;
+      end;
+
+
+
+      if C1+2>High(Data) then Break;
+
+      if NextObjectToRecieve='RaumSorte' then begin
+        RoomRecievePos.X:=Strtoint(String(Data[C1]));
+        RoomRecievePos.Y:=Strtoint(String(Data[C1+1]));
+        Map[RoomRecievePos.X,RoomRecievePos.Y].Inhalt.Sorte:=
+        Strtoint(Data[C1+2]);
+
+        if ServerSocket.Active then
+        for C3:=0 to ServerSocket.Socket.ActiveConnections-1 do
+        if ServerSocket.Socket.Connections[C3]<>Socket then
+        SendRaumSorte(ServerSocket.Socket.Connections[C3],RoomRecievePos);
+
+        C1:=C1+3;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';  
+        Form1.ReloadRoom(RoomRecievePos.X,RoomRecievePos.Y);
+        Continue;
+      end;
+
+      if NextObjectToRecieve='RaumRichtung' then begin
+        RoomRecievePos.X:=Strtoint(Data[C1]);
+        RoomRecievePos.Y:=Strtoint(Data[C1+1]);
+        Map[RoomRecievePos.X,RoomRecievePos.Y].Inhalt.Daten:=
+        @Richtungen[TRichtung(Strtoint(Data[C1+2]))]; 
+        Form1.ReloadRoom(RoomRecievePos.X,RoomRecievePos.Y);
+        
+        C1:=C1+3;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        Continue;
+      end;
+
+        
+      if C1+3>High(Data) then Break;   
+
+      //Spielerposition empfangen
+      if NextObjectToRecieve='Position' then begin
+        C2:=strtoint(Data[C1]);
+        if Cardinal(C2)=MyID then begin
+          C1:=C1+4;
+          LastObjectRecieved:=NextObjectToRecieve;
+          NextObjectToRecieve:='';
+          Continue;
+        end;
+        AddToPlayerArr(C2);
+        Players[C2].LastX:=Players[C2].X;
+        Players[C2].LastZ:=Players[C2].Z;
+        Players[C2].LastTimeStart:=GetTickCount;
+        Players[C2].LastTimeEnd:=GetTickCount+Timer3.Interval;
+
+
+        Players[C2].X:=Strtofloat(String(Data[C1+1]));
+        Players[C2].Z:=Strtofloat(String(Data[C1+2]));
+        Players[C2].Speed:=Strtofloat(String(Data[C1+3]));
+
+        C1:=C1+4;
+        LastObjectRecieved:=NextObjectToRecieve;
+        NextObjectToRecieve:='';
+        Continue;
+      end;
+
+      if C1+5>High(Data) then Break;
+
+      //Raum empfangen
+      if NextObjectToRecieve='Raum' then begin
+
+        B1:=GetRT(PosX,PosZ).Contaminate;
+
+
+        RoomRecievePos.X:=Strtoint(String(Data[C1]));
+        RoomRecievePos.Y:=Strtoint(String(Data[C1+1]));
+        C4:=Strtoint(String(Data[C1+2]));
+        P1:=@C4;
+        Map[RoomRecievePos.X,RoomRecievePos.Y].Walls:=P1^;
+        C4:=Strtoint(String(Data[C1+3]));
+        P1:=@C4;
+        Map[RoomRecievePos.X,RoomRecievePos.Y].UpWalls:=P1^;
+        C4:=Strtoint(String(Data[C1+4]));
+        P1:=@C4;
+        Map[RoomRecievePos.X,RoomRecievePos.Y].DownWalls:=P1^;
+        Map[RoomRecievePos.X,RoomRecievePos.Y].Inhalt.Sorte:=
+        Strtoint(String(Data[C1+5]));
+        Map[RoomRecievePos.X,RoomRecievePos.Y].Inhalt.Daten:=nil;
+        Map[RoomRecievePos.X,RoomRecievePos.Y].created:=true;
+        LastObjectRecieved:=NextObjectToRecieve;
+
+            
+
+
+        if GetRT(PosX,PosZ).Contaminate and not B1 then begin
+          Form1.ChangeSpeedBy(-RandomRange(-50,292)/100);
+          Form1.Panel11.Font.Color:=RGB(0,0,0);
+          Form1.Panel11.Color:=RGB(249,245,0);
+          Form1.Panel11.Visible:=true;
+          Form1.Panel11.Caption:='Contamination! Speed decreased to '
+          +Floattostr(Round(100*Players[MyID].Speed)/100);
+          Panel11Seconds:=3;
+        end;
+
+        NextObjectToRecieve:='';
+        C1:=C1+6;
+        Form1.ReloadRoom(RoomRecievePos.X,RoomRecievePos.Y);
+        Continue;
+      end;
+
+
+      LastObjectRecieved:='unknown: '+NextObjectToRecieve;
+      NextObjectToRecieve:='';
+    end;
+  except
+    AssignFile(log,'NetworkLog.txt');
+    if not FileExists('NetworkLog.txt') then begin
+      Rewrite(log);
+      Write(log,buffer);
+      CloseFile(log);
+    end;
+  end;
+
+  Buffer:='';
+  for C2:=C1 to High(Data) do
+  Buffer:=Buffer+Data[C2]+';';
+  Buffer:=Buffer+S1;
+end;
+
+
+
+
+
+
+
+
+
+procedure TForm3.ClientSocketConnect(Sender: TObject;
+  Socket: TCustomWinSocket);
+var C1,C2:Integer;
+begin
+  IDRecieved:=false;
+  for C1:=-mapsize to mapsize do
+  for C2:=-mapsize to mapsize do Map[C1,C2].created:=false;
+  ShowMessage('Connected to Server '+MPServerAddress+':'+Inttostr(MPPort));
+end;
+
+procedure TForm3.ServerSocketClientConnect(Sender: TObject;
+  Socket: TCustomWinSocket);
+begin
+  SendNewID(Socket);
+  SendMap(Socket);
+  SendGoalPos(Socket);
+end;
+
+procedure TForm3.ClientSocketDisconnect(Sender: TObject;
+  Socket: TCustomWinSocket);
+begin
+  ShowMessage('Disconnected from Server');
+end;
+
+procedure TForm3.ClientSocketError(Sender: TObject;
+  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
+  var ErrorCode: Integer);
+begin
+  if ErrorCode=10061 then begin
+    ShowMessage('Server not found');
+    ErrorCode:=0;
+  end;
+end;
+
+
+
+
+
+
+
+
+
+
+
+procedure TForm3.SendExplode(X,Z:Integer; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'Explode;'
+  +IntToStr(X)+';'
+  +IntToStr(Z)+';'));
+end;
+
+procedure TForm3.SendExplode(X,Z:Integer);
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendExplode(X,Z,ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendExplode(X,Z,ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+
+procedure TForm3.SendContaminate(X,Z:Integer);
+begin
+  ClientSocket.Socket.SendText(AnsiString(
+  'Contaminate;'
+  +IntToStr(X)+';'
+  +IntToStr(Z)+';'));
+end;
+
+procedure TForm3.SendPosition(Socket: TCustomWinSocket);
+begin          
+  Socket.SendText(AnsiString(
+  'Position;'
+  +intToStr(MyID)+';'
+  +FloatToStr(Players[MyID].X)+';'
+  +FloatToStr(Players[MyID].Z)+';'
+  +FloatToStr(Players[MyID].Speed)+';'));
+end;
+
+procedure TForm3.SendPosition;
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendPosition(ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendPosition(ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendPosition(ID:Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendPosition(ID,ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendPosition(ID,ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendPosition(ID:Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'Position;'
+  +intToStr(ID)+';'
+  +FloatToStr(Players[ID].X)+';'
+  +FloatToStr(Players[ID].Z)+';'
+  +FloatToStr(Players[ID].Speed)+';'));
+end;
+
+
+
+
+procedure TForm3.Timer3Timer(Sender: TObject);
+var C2:Integer;
+begin
+  if (not IDRecieved) and ClientSocket.Active then Exit;
+
+  if ClientSocket.Active then SendPosition
+  else if ServerSocket.Active then begin
+    for C2:=0 to High(Players) do
+    if not Players[C2].Dead then
+    SendPosition(C2);
+  end;
+end;
+
+
+
+
+
+
+
+
+
+
+
+
+procedure TForm3.FormCreate(Sender: TObject);
+begin
+  ServerSocket.Active:=false;
+  ClientSocket.Active:=false;
+  ClientSocket.Port:=MPPort;
+  ServerSocket.Port:=MPPort;
+  ClientSocket.Host:=MPServerAddress;
+end;
+
+procedure TForm3.FormDestroy(Sender: TObject);
+begin
+  Timer3.Enabled:=false;
+end;
+      
+
+procedure TForm3.SendMap(Socket: TCustomWinSocket);
+var C1,C2:Integer;RaumPos:TPoint;
+begin
+  for C1:=-raumrange to raumrange do
+  for C2:=-raumrange to raumrange do
+  if Map[C1,C2].created then begin 
+    RaumPos.X:=C1;
+    RaumPos.Y:=C2;
+    SendRaum(Socket,RaumPos);
+  end;
+end;
+
+
+procedure TForm3.SendCeilWalk(Socket: TCustomWinSocket);
+begin
+  Socket.SendText( AnsiString(
+  'CeilWalk;'   
+  +IntToStr(MyID)+';'
+  +BoolToStr(players[MyID].CeilWalk)+';'));
+end;
+
+procedure TForm3.SendCeilWalk;
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendCeilWalk(ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendCeilWalk(ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendCeilWalk(ID:Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendCeilWalk(ID,ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendCeilWalk(ID,ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendCeilWalk(ID:Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'CeilWalk;'
+  +IntToStr(ID)+';'
+  +BoolToStr(players[ID].CeilWalk)+';'));
+end;
+
+
+procedure TForm3.SendJump(Socket: TCustomWinSocket);
+begin
+  Socket.SendText( AnsiString(
+  'JumpStart;'   
+  +IntToStr(MyID)+';'));
+end;
+
+procedure TForm3.SendJump;
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendJump(ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendJump(ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendJump(ID:Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active then SendJump(ID,ClientSocket.Socket)
+  else if ServerSocket.Active then
+  for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do begin
+    SendJump(ID,ServerSocket.Socket.Connections[C2]);
+  end;
+end;
+
+procedure TForm3.SendJump(ID:Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'JumpStart;'
+  +IntToStr(ID)+';'));
+end;
+
+
+
+
+
+procedure TForm3.SendKill(ID: Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'PlayerKill;'
+  +IntToStr(ID)+';'));
+end;
+
+procedure TForm3.SendKill(ID: Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active
+  then SendKill(ID,ClientSocket.Socket)
+  else if ServerSocket.Active
+  then for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  SendKill(ID,ServerSocket.Socket.Connections[C2]);
+end;
+
+procedure TForm3.SendWin(ID: Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'GameWin;'
+  +IntToStr(ID)+';'));
+end;
+
+procedure TForm3.SendWin(ID: Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active
+  then SendWin(ID,ClientSocket.Socket)
+  else if ServerSocket.Active
+  then for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  SendWin(ID,ServerSocket.Socket.Connections[C2]);
+end;
+
+procedure TForm3.SendInkTrigger(ID: Cardinal; Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'InkTrigger;'
+  +IntToStr(ID)+';'));
+end;
+
+procedure TForm3.SendInkTrigger(ID: Cardinal);
+var C2:Integer;
+begin
+  if ClientSocket.Active
+  then SendInkTrigger(ID,ClientSocket.Socket)
+  else if ServerSocket.Active
+  then for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  SendInkTrigger(ID,ServerSocket.Socket.Connections[C2]);
+end;
+
+
+
+
+
+
+procedure TForm3.SendSpeedChange(ID:Cardinal);
+var C1,C2:Integer; MaxDist:Real;
+begin
+  if not ServerSocket.Active then Exit;
+
+  MaxDist:=0;
+  for C2:=0 to High(Players) do
+  if Cardinal(C2)<>ID then
+  if not Players[C2].Dead then
+  MaxDist:=Max(MaxDist,
+  sqrt(sqr(Players[C2].X-GoalPos.X*20)+sqr(Players[C2].Z-GoalPos.Y*20)));
+
+  MaxDist:=MaxDist*2;
+
+
+  if ID<>MyID then begin 
+    Form1.MultiplySpeedBy(sqrt(
+    sqr(Players[MyID].X-GoalPos.X*20)
+    +sqr(Players[MyID].Z-GoalPos.Y*20))
+    /MaxDist);
+    Form1.Panel11.Font.Color:=RGB(255,255,0);
+    Form1.Panel11.Color:=RGB(0,0,0);
+    Form1.Panel11.Visible:=true;
+    Form1.Panel11.Caption:='Speed decreased to '
+    +Floattostr(Round(100*Players[MyID].Speed)/100);
+    Panel11Seconds:=3;
+    Form1.GLHUDText1.Text:='Speed: '
+    +Floattostr(Round(100*Players[MyID].Speed)/100);
+  end;
+
+  for C1:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  ServerSocket.Socket.Connections[C1].SendText(Ansistring(
+  'ChangeSpeed;'
+  +FloatToStr(MaxDist)+';'
+  +FloatToStr(ID)+';'));
+end;
+
+procedure TForm3.SendRaum(Socket: TCustomWinSocket; RaumPos:TPoint);
+begin
+  Socket.SendText(AnsiString(
+  'Raum;'
+  +IntToStr(RaumPos.X)+';'
+  +IntToStr(RaumPos.Y)+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].Walls))+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].UpWalls))+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].DownWalls))+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].Inhalt.Sorte))+';'));
+  if GetRT(RaumPos.X,RaumPos.Y).TurnRandom[Up]
+  or GetRT(RaumPos.X,RaumPos.Y).TurnRandom[Down] then
+  Socket.SendText(AnsiString(
+  'RaumRichtung;'
+  +IntToStr(RaumPos.X)+';'
+  +IntToStr(RaumPos.Y)+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].Inhalt.Daten^))+';'));
+end;
+
+procedure TForm3.SendRaum(RaumPos:TPoint);
+var C2:Integer;
+begin
+  if ClientSocket.Active
+  then SendRaum(ClientSocket.Socket,RaumPos)
+  else if ServerSocket.Active
+  then for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  SendRaum(ServerSocket.Socket.Connections[C2],RaumPos);
+end;
+
+procedure TForm3.SendRaumSorte(Socket: TCustomWinSocket; RaumPos:TPoint);
+begin
+  Socket.SendText(AnsiString(
+  'RaumSorte;'
+  +IntToStr(RaumPos.X)+';'
+  +IntToStr(RaumPos.Y)+';'
+  +IntToStr(Byte(Map[RaumPos.X,RaumPos.Y].Inhalt.Sorte))+';'));
+end;
+
+procedure TForm3.SendRaumSorte(RaumPos:TPoint);
+var C2:Integer;
+begin
+  if ClientSocket.Active
+  then SendRaumSorte(ClientSocket.Socket,RaumPos)
+  else if ServerSocket.Active
+  then for C2:=0 to ServerSocket.Socket.ActiveConnections-1 do
+  SendRaumSorte(ServerSocket.Socket.Connections[C2],RaumPos);
+end;
+
+procedure TForm3.SendRaumSorte(X,Z:Integer);
+var RaumPos:TPoint;
+begin
+  RaumPos.X:=X;
+  RaumPos.Y:=Z;
+  SendRaumSorte(RaumPos);
+end;
+
+procedure TForm3.SendNewID(Socket: TCustomWinSocket);
+var C1:Integer;
+begin          
+  C1:=Length(Players);
+  
+  AddToPlayerArr(C1);
+
+  Socket.SendText(AnsiString(
+  'NewID;'
+  +IntToStr(C1)+';'));
+end;
+
+procedure TForm3.RequestNewID(Socket: TCustomWinSocket);
+begin
+  Socket.SendText(
+  'RequestNewID;');
+end;
+
+procedure TForm3.SendGoalPos(Socket: TCustomWinSocket);
+begin
+  Socket.SendText(AnsiString(
+  'GoalPos;'
+  +IntToStr(GoalPos.X)+';'
+  +IntToStr(GoalPos.Y)+';'));
+end;
+
+end.

+ 405 - 0
Unit1.dfm

@@ -0,0 +1,405 @@
+object Form1: TForm1
+  Left = 13
+  Top = 37
+  HorzScrollBar.Visible = False
+  VertScrollBar.Visible = False
+  BorderIcons = [biSystemMenu, biMinimize]
+  Caption = 'Randomaze'
+  ClientHeight = 654
+  ClientWidth = 1110
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  OnKeyPress = FormKeyPress
+  OnMouseUp = GLSceneViewer1MouseUp
+  OnResize = FormResize
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 1110
+    Height = 654
+    Camera = GLCamera1
+    VSync = vsmSync
+    Buffer.BackgroundColor = clWindow
+    FieldOfView = 160.224029541015600000
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    OnMouseUp = GLSceneViewer1MouseUp
+    TabOrder = 0
+  end
+  object Panel1: TPanel
+    Left = 8
+    Top = 8
+    Width = 150
+    Height = 25
+    Caption = 'Panel1'
+    TabOrder = 1
+    Visible = False
+  end
+  object Panel2: TPanel
+    Left = 8
+    Top = 40
+    Width = 150
+    Height = 25
+    Caption = 'Panel2'
+    TabOrder = 2
+    Visible = False
+  end
+  object Panel3: TPanel
+    Left = 8
+    Top = 72
+    Width = 150
+    Height = 25
+    Caption = 'Panel3'
+    TabOrder = 3
+    Visible = False
+  end
+  object Panel4: TPanel
+    Left = 8
+    Top = 104
+    Width = 150
+    Height = 25
+    Caption = 'Panel4'
+    TabOrder = 4
+    Visible = False
+  end
+  object Panel5: TPanel
+    Left = 8
+    Top = 136
+    Width = 150
+    Height = 25
+    Caption = 'Panel5'
+    TabOrder = 5
+    Visible = False
+  end
+  object Panel6: TPanel
+    Left = 8
+    Top = 176
+    Width = 150
+    Height = 25
+    Caption = 'Panel6'
+    TabOrder = 6
+    Visible = False
+  end
+  object Panel8: TPanel
+    Left = 136
+    Top = 16
+    Width = 569
+    Height = 49
+    BevelOuter = bvNone
+    Caption = 'Panel8'
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -32
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 7
+    Visible = False
+  end
+  object Panel9: TPanel
+    Left = 136
+    Top = 64
+    Width = 569
+    Height = 49
+    BevelOuter = bvNone
+    Caption = 'Panel9'
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -32
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 8
+    Visible = False
+  end
+  object Panel11: TPanel
+    Left = 136
+    Top = 112
+    Width = 849
+    Height = 49
+    BevelOuter = bvNone
+    Caption = 'Panel11'
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -32
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 9
+    Visible = False
+  end
+  object Panel13: TPanel
+    Left = 216
+    Top = 216
+    Width = 729
+    Height = 169
+    BevelOuter = bvNone
+    Caption = 'Panel13'
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -133
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 10
+    Visible = False
+  end
+  object RichEdit1: TRichEdit
+    Left = 304
+    Top = 400
+    Width = 473
+    Height = 94
+    Alignment = taCenter
+    BevelInner = bvNone
+    BevelOuter = bvNone
+    BorderStyle = bsNone
+    Color = clBtnFace
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -32
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    Lines.Strings = (
+      ''
+      'RichEdit1')
+    ParentFont = False
+    ReadOnly = True
+    TabOrder = 11
+    Visible = False
+  end
+  object Memo1: TMemo
+    Left = 872
+    Top = 520
+    Width = 201
+    Height = 111
+    Alignment = taCenter
+    BevelInner = bvNone
+    BevelOuter = bvNone
+    BiDiMode = bdLeftToRight
+    BorderStyle = bsNone
+    Color = clBlack
+    DragCursor = crDefault
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWhite
+    Font.Height = -32
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Lines.Strings = (
+      'Memo1')
+    ParentBiDiMode = False
+    ParentFont = False
+    ReadOnly = True
+    TabOrder = 12
+    OnKeyPress = FormKeyPress
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+  end
+  object ThrustBar: TProgressBar
+    Left = 1072
+    Top = 24
+    Width = 30
+    Height = 617
+    Max = 1000
+    Orientation = pbVertical
+    Smooth = True
+    TabOrder = 13
+    OnMouseDown = ThrustBarMouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    OnMouseUp = GLSceneViewer1MouseUp
+  end
+  object Scene1: TGLScene
+    Left = 160
+    Top = 256
+    object Walls: TGLDummyCube
+      CubeSize = 1.000000000000000000
+    end
+    object OtherPlayers: TGLDummyCube
+      CubeSize = 1.000000000000000000
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 1000.000000000000000000
+      FocalLength = 57.000000000000000000
+      Position.Coordinates = {00000000000000BF000000000000803F}
+      object PlayerLight: TGLLightSource
+        ConstAttenuation = 1.000000000000000000
+        SpotCutOff = 180.000000000000000000
+      end
+    end
+    object Planes: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      object Pushers: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object UpDownPorters: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object GreenSpeeds: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Explosions: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object BadSpeeds: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Turners: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Grounds: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Speeds: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Arrows: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object YSNPs: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Ceilings: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Blackexplosions: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object Lightnings: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+    end
+    object Menu: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      object MPJoinMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'Server-IP:'
+          'Port:'
+          'Join Game!'
+          'Return')
+        Selected = 0
+      end
+      object MPHostMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'Port:'
+          'Host Game!'
+          'Return')
+        Selected = 0
+      end
+      object MPMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'Host Game'
+          'Join Game'
+          'Return')
+        Selected = 0
+      end
+      object VideoMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'Fullscreen (M)'
+          'Resolution (non-fullscreen)'
+          'Shading Distance'
+          'Return')
+        Selected = 0
+      end
+      object SettingsMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'Video'
+          'Return')
+        Selected = 0
+      end
+      object MainMenu: TGLGameMenu
+        Position.Coordinates = {0000964300006643000000000000803F}
+        Font = MenuFont
+        Items.Strings = (
+          'CONTINUE (P/Esc)'
+          'RESTART GAME (N)'
+          'SETTINGS (-)'
+          'MULTIPLAYER'
+          'RESPAWN (R)'
+          'QUIT GAME (B)')
+        Selected = 0
+      end
+    end
+    object HUDTexts: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      object GLHUDText1: TGLHUDText
+        Position.Coordinates = {008031440000F041000000000000803F}
+        BitmapFont = MenuFont
+        Text = 'Speed:15'
+        Rotation = 0.000000000000000000
+      end
+      object PlayerGoalDists: TGLDummyCube
+        CubeSize = 1.000000000000000000
+      end
+      object GLHUDText2: TGLHUDText
+        Position.Coordinates = {0000484200001644000000000000803F}
+        BitmapFont = MenuFont
+        Text = 'Version'
+        Rotation = 0.000000000000000000
+      end
+    end
+    object MuhNPCs: TGLDummyCube
+      CubeSize = 1.000000000000000000
+    end
+  end
+  object Timer1: TTimer
+    Interval = 200
+    OnTimer = Timer1Timer
+    Left = 200
+    Top = 296
+  end
+  object GLUserInterface1: TGLUserInterface
+    MouseSpeed = 15.000000000000000000
+    GLNavigator = GLNavigator1
+    GLVertNavigator = GLNavigator1
+    Left = 120
+    Top = 384
+  end
+  object GLNavigator1: TGLNavigator
+    VirtualUp.Coordinates = {000000000000803F0000000000000000}
+    MovingObject = GLCamera1
+    UseVirtualUp = True
+    AutoUpdateObject = True
+    MaxAngle = 90.000000000000000000
+    MinAngle = -90.000000000000000000
+    AngleLock = True
+    Left = 112
+    Top = 440
+  end
+  object MenuFont: TGLWindowsBitmapFont
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clWhite
+    Font.Height = -35
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    Left = 136
+    Top = 304
+  end
+  object PlayerGoalDistFont: TGLWindowsBitmapFont
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clWhite
+    Font.Height = -16
+    Font.Name = 'Lucida Console'
+    Font.Style = []
+    Left = 88
+    Top = 344
+  end
+end

+ 1753 - 0
Unit1.pas

@@ -0,0 +1,1753 @@
+unit Unit1;
+
+interface
+      
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, GLScene, GLObjects, GLCoordinates, GLWin32Viewer,
+  GLCrossPlatform, GLCadencer,  jpeg,
+  GLNavigator, Math, ExtCtrls, StdCtrls, ComCtrls,
+  GLBitmapFont, GLWindowsFont,
+  GLGameMenu, GLHUDObjects, GLConsole, GLGui, GLWindows,
+  typinfo, ScktComp, GLGeomObjects,UMyUtils, GLBaseClasses;
+  
+type THeight=(Down,Up);     //todo 1:Zeitanzeige
+
+type TInhaltSorte=(
+  empty,Arrow,Goal,YSNP,Green,GreenTrap,                             //0..8
+  WallTrap,Speed,BadSpeed,GreenSpeed,Turner,UpDownPorter,UpPorter,   //9..15
+  DownPorter,Explosion,RainbowTrap,Pusher,BlackExplosion,Lightning   //16..20
+  );
+
+type TPanelConfig=record  
+  ID:Cardinal;
+  TopDivH,LeftDivW,HeightDivH,WidthDivW:Real;
+  Text:String;
+  FontColor,BackGroundColor:TColor;
+  FontSizeDivH:Real;
+  Seconds:Real;
+  DontShowIfWon:Boolean;
+  SpeedAtEnd:Boolean;
+end;
+
+type PPanelConfig=^TPanelConfig;
+
+type TInhalt=record
+  Sorte:Integer;
+  Daten:Pointer;
+end;       
+
+type TPlayer=record
+  X,Y,Z:Real;
+  LastX,LastZ:Real;
+  LastTimeStart,LastTimeEnd:Cardinal;
+  Ceilwalk:Boolean;
+  jumping:Boolean;
+  jumptime:Real;
+  Speed:Real;
+  Dead:Boolean;
+  OutOfMaze:Boolean;
+end;
+
+type TRoomtype=record
+  MaterialName:array[THeight] of string; 
+  ID:Cardinal;
+  Roomfrequenzy:Real;
+  Explode:array[THeight] of Boolean;
+  ExplodeOtherPlayer:array[THeight] of Boolean;
+  PortTo:array[THeight] of Boolean;
+  TurnToGoal:array[THeight] of Boolean;
+  WinAtArrival:Boolean;
+  YSNP:array[THeight] of Boolean;
+  GreenWallsAround:Boolean;
+  ChangeAtArrivalTo:array[THeight] of Integer;//-1=nicht ändern, 0=Feld leeren
+  ChangeWallsAtArrival:Boolean;
+  ChangeSpeedAtArrival:Real;
+  ChangeSpeedRandom:array[THeight] of Boolean;
+  TurnPlayer:Boolean;
+  PortPlayerToCenter:Boolean;
+  PushPlayer:array[THeight] of Boolean;
+  TurnRandom:array[THeight] of Boolean;    
+  InkOthers:array[THeight] of Boolean;    
+  ChangeOtherPlayerSpeed:Boolean;
+  Contaminate:Boolean;
+  OPTanzGegner:Boolean;
+  Passierbar:Boolean;
+  NotAtSpawn:Boolean;
+  WallCageTrap:Boolean;
+  NotNextToSelf:Boolean;
+  SPInvisible:Boolean; //todo 1: raus
+end;
+
+type PRoomtype=^TRoomtype;
+
+type PGLCube=^TGLCube;
+
+type TRichtung=(px,nx,pz,nz);
+
+type TWallset=set of TRichtung;
+type PWallset=^TWallset;
+
+type TRaum=record
+  created:Boolean;
+  Walls,UpWalls,DownWalls:TWallset;
+  Inhalt:TInhalt;
+end;
+
+type PRaum=^TRaum;
+
+const mapsize=500;
+type TMap=array[-mapsize..mapsize,-mapsize..mapsize] of TRaum;
+
+type TMuhNPC=record  //todo 2:nach Inhalt.Daten
+  Body:TGLCube;
+  MoveX,MoveY,MoveZ:Real;
+end;
+
+
+type
+  TForm1 = class(TForm)
+    Scene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    Panel1: TPanel;
+    Timer1: TTimer;
+    GLUserInterface1: TGLUserInterface;
+    GLNavigator1: TGLNavigator;
+    Panel2: TPanel;
+    Panel3: TPanel;
+    Panel4: TPanel;
+    Panel5: TPanel;
+    Panel6: TPanel;
+    Panel8: TPanel;
+    Panel9: TPanel;
+    Panel11: TPanel;
+    Panel13: TPanel;
+    RichEdit1: TRichEdit;
+    MenuFont: TGLWindowsBitmapFont;
+    PlayerGoalDistFont: TGLWindowsBitmapFont;
+    Memo1: TMemo;
+    Walls: TGLDummyCube;
+    OtherPlayers: TGLDummyCube;
+    GLCamera1: TGLCamera;
+    Planes: TGLDummyCube;
+    Pushers: TGLDummyCube;
+    UpDownPorters: TGLDummyCube;
+    GreenSpeeds: TGLDummyCube;
+    Explosions: TGLDummyCube;
+    BadSpeeds: TGLDummyCube;
+    Turners: TGLDummyCube;
+    Grounds: TGLDummyCube;
+    Speeds: TGLDummyCube;
+    Arrows: TGLDummyCube;
+    YSNPs: TGLDummyCube;
+    Ceilings: TGLDummyCube;
+    Blackexplosions: TGLDummyCube;
+    Lightnings: TGLDummyCube;
+    Menu: TGLDummyCube;
+    MPJoinMenu: TGLGameMenu;
+    MPHostMenu: TGLGameMenu;
+    MPMenu: TGLGameMenu;
+    VideoMenu: TGLGameMenu;
+    SettingsMenu: TGLGameMenu;
+    MainMenu: TGLGameMenu;
+    HUDTexts: TGLDummyCube;
+    GLHUDText1: TGLHUDText;
+    PlayerGoalDists: TGLDummyCube;
+    GLHUDText2: TGLHUDText;
+    MuhNPCs: TGLDummyCube;
+    ThrustBar: TProgressBar;
+    PlayerLight: TGLLightSource;
+    procedure Timer1Timer(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure FormKeyPress(Sender: TObject; var Key: Char);
+    function NewWall(x,z:Integer; width,depth:Real):TGLCube;
+    function NewUpWall(x,z:Integer; width,depth:Real):TGLCube;
+    function NewDownWall(x,z:Integer; width,depth:Real):TGLCube;
+    function NewMuhNPCBody(x,z:Integer):TGLCube;
+    procedure startJump(ID:Integer);
+    procedure activateWall(dir,x,z:Integer; activate:Boolean);
+    procedure activateUpWall(dir,x,z:Integer; activate:Boolean);
+    procedure activateDownWall(dir,x,z:Integer; activate:Boolean);
+    procedure activateGreen(x,z:Integer; activate:Boolean);
+    procedure Reload;
+    procedure ReloadWallShaders;
+    procedure ReloadTexQual;
+    procedure CreateMap;
+    procedure ReloadRoom(X,Z:Integer);
+    procedure SpreadContamination(X,Z:Integer);
+    procedure Explode(X,Z:Integer);
+    function NewPlane(x,z:Integer; Height:THeight;
+      Sorte:Integer):TGLPlane;
+    function NewPlayer(ID:Integer):TGLCylinder;
+    procedure Creategoal;
+    procedure FormResize(Sender: TObject);
+    procedure RearrangePanels;
+    procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
+      X, Y: Integer);
+    procedure Respawn;
+    procedure GLSceneViewer1MouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure WinGame(ID: Cardinal);
+    procedure LoseGame;
+    procedure ChangeSpeedTo(NewSpeed:Real);
+    procedure MultiplySpeedBy(Factor:Real);
+    procedure ChangeSpeedBy(DeltaSpeed:Real);
+    procedure ThrustBarMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);   
+    procedure ShowPanel(ID:Cardinal);
+  private
+  end;
+
+function GetRT(X,Z:Integer):PRoomtype;
+function GetPC(X,Z:Integer):PPanelConfig;
+
+const                
+  PlayerDepth:array[Boolean] of Real=(1.6,0.3);
+  PlayerHeight:array[Boolean] of Real=(0.3,1.6);
+  RaumRange=8;
+  Exploradius=4;
+  Spawnradius=4;
+  SpawnradiusNoSorte=7;
+  SpawnradiusNoWalls=3;
+  ViewFullscreen:Boolean=false;
+  colortest=false;
+  Debug=true;
+  showMapCreateTime=false;
+
+  Richtungen:array[TRichtung] of TRichtung=(px,nx,pz,nz);
+var
+  StartSpeed:Real=15;
+
+  start:Cardinal; 
+
+  GameEnded:Boolean=false;
+  
+  Camera:TGLCamera;
+  PlayerGoalDistPanels:array of TGLHUDText;
+
+  jumppressed:Boolean;
+
+  log:TextFile;
+  npl:TGLCylinder;
+  Roomtypes:array of TRoomType;
+  PanelConfigs:array of TPanelConfig;
+
+  Players:array of TPlayer;
+  MyID:Cardinal;
+
+  MinGoalDist:Integer=22;
+  MaxGoalDist:Integer=26;
+  ShaderWidth:Integer=6;
+  GoalProtectionRadius:Integer=2;
+  inMenu:Boolean;
+  Panel11Seconds,Panel13Seconds,RE1Seconds:Real;
+  Form1: TForm1;
+  Map:TMap;
+
+  PosX,PosZ:Integer;
+
+  playerarr:array of TGLCylinder;
+
+  RoomInvisible,PlaneInvisible:array[-RaumRange..RaumRange,-RaumRange..RaumRange]
+  of Boolean;
+
+  Wallarr,DownWallArr,UpWallArr:
+  array[0..1,-RaumRange..RaumRange+1,-RaumRange..RaumRange+1] of TGLCube;
+  PlayerList:TList;
+
+  MuhNPCArr:array[-RaumRange..RaumRange,-RaumRange..RaumRange] of
+  TMuhNPC;
+
+  PlaneArr:
+  array of array[THeight,-RaumRange..RaumRange,-RaumRange..RaumRange] of
+  TGLPlane;
+
+  lasttime:Cardinal=0;
+
+  PGoal:PRaum;
+  GoalPos:TPoint;
+
+  Lost,Won:Boolean;
+
+  ThrustDrag:Boolean;  
+
+  SW:TMyStopWatch;
+
+
+
+
+implementation
+
+uses UNetwork, UMaterials, UCadencer, UMoveToRoom,UCreateRaum,UColorByID,
+  UCheckmaze, UMessageThread, ShellAPI, UIni, IniFiles, UMainMenu, System.UITypes;
+
+{$R *.dfm}
+
+
+function GetRT(X,Z:Integer):PRoomtype;
+begin
+  Result:=@Roomtypes[Map[X,Z].Inhalt.Sorte];
+end;
+
+
+function GetPC(X,Z:Integer):PPanelConfig;  
+begin
+  Result:=@PanelConfigs[Map[X,Z].Inhalt.Sorte];
+end;
+
+
+               
+procedure TForm1.ChangeSpeedBy(DeltaSpeed:Real);
+begin                                          
+  Players[MyID].Speed:=Players[MyID].Speed+DeltaSpeed*ThrustBar.Position/1000;
+end;
+
+procedure TForm1.ChangeSpeedTo(NewSpeed:Real);
+begin                                       
+  Players[MyID].Speed:=NewSpeed*ThrustBar.Position/1000;
+end;
+
+procedure TForm1.MultiplySpeedBy(Factor:Real);
+begin
+  Players[MyID].Speed:=Players[MyID].Speed*Factor;
+end;
+
+
+procedure TForm1.WinGame(ID: Cardinal);
+begin
+  if Won then Exit;
+  GameEnded:=true;
+  if ID=MyID then begin
+    Panel8.Font.Color:=RGB(25,150,25);
+    Panel8.Color:=RGB(38,38,38);
+    Panel8.Visible:=true;
+    Panel8.Caption:='You win!';
+    Panel9.Font.Color:=RGB(25,150,25);
+    Panel9.Color:=RGB(38,38,38);
+    Panel9.Visible:=true;
+    Panel9.Caption:='Made by EBY aka Eror';
+    ChangeSpeedBy(30);
+    Won:=true;
+    Beep;
+  end else begin
+    Panel8.Font.Color:=RGB(150,25,25);
+    Panel8.Color:=RGB(38,38,38);
+    Panel8.Visible:=true;
+    Panel8.Caption:='Player '+IntToStr(ID)+' won the game!';
+    LoseGame;
+  end;
+end;
+
+procedure TForm1.LoseGame;
+begin
+  Form3.SendPosition;
+  if Lost then Exit;
+  Players[MyID].Dead:=true;
+  Form3.SendKill(MyID);
+  Panel9.Font.Color:=RGB(150,25,25);
+  Panel9.Color:=RGB(38,38,38);
+  Panel9.Visible:=true;
+  Panel9.Caption:='You Lose...';
+  Lost:=true;
+
+  
+  Beep;
+end;
+
+
+
+
+
+procedure TForm1.RearrangePanels;
+var C2:Integer;
+begin
+  MenuFont.Font.Size:=Round(OrigSizes[13]*self.Height);
+  PlayerGoalDistFont.Font.Size:=Round(OrigSizes[14]*self.Height);
+
+  for C2:=0 to High(PlayerGoalDistPanels) do
+  PlayerGoalDistPanels[C2].Position.SetPoint
+  (0.01*self.Width,Form1.PlayerGoalDistFont.Font.Size*(C2+0.5),0);
+
+  Panel8.SetBounds(
+  Round(self.Width*OrigSizes[5]),
+  Round(self.Height*OrigSizes[7]),
+  Round(self.Width*OrigSizes[6]),
+  Round(self.Height*OrigSizes[8]));
+  Panel9.SetBounds(
+  Round(self.Width*OrigSizes[9]),
+  Round(self.Height*OrigSizes[11]),
+  Round(self.Width*OrigSizes[10]),
+  Round(self.Height*OrigSizes[12]));
+  MainMenu.Position.X:=self.Width*OrigSizes[15];
+  MainMenu.Position.Y:=self.Height*OrigSizes[16];
+
+  GLHUDText1.Position.X:=Round(self.Width*OrigSizes[21]);
+  GLHUDText1.Position.Y:=Round(self.Height*OrigSizes[22]);
+
+  GLHUDText2.Position.X:=Round(self.Width*OrigSizes[23]);
+  GLHUDText2.Position.Y:=Round(self.Height*OrigSizes[24]);
+
+  Panel13.SetBounds(
+  Round(self.Width*OrigSizes[25]), 
+  Round(self.Height*OrigSizes[27]),
+  Round(self.Width*OrigSizes[26]),
+  Round(self.Height*OrigSizes[28]));
+  Panel8.Font.Size:=Round(self.Width*OrigSizes[29]);
+  Panel9.Font.Size:=Round(self.Width*OrigSizes[30]);
+  Panel11.Font.Size:=Round(self.Width*OrigSizes[32]);
+  MenuFont.Font.Size:=Round(self.Width*OrigSizes[33]);
+  Panel13.Font.Size:=Round(self.Width*OrigSizes[34]);
+
+
+  RichEdit1.SetBounds(
+  Round(OrigSizes[35]*self.Width),
+  Round(OrigSizes[37]*self.Height),
+  Round(OrigSizes[36]*self.Width),
+  Round(OrigSizes[38]*self.Height));
+  RichEdit1.Font.SIZE:=Round(OrigSizes[39]*self.Height);   
+  SettingsMenu.Position.X:=self.Width*OrigSizes[40];
+  SettingsMenu.Position.Y:=self.Height*OrigSizes[41]; 
+  VideoMenu.Position.X:=self.Width*OrigSizes[42];
+  VideoMenu.Position.Y:=self.Height*OrigSizes[43];
+  MPMenu.Position.X:=self.Width*OrigSizes[46];
+  MPMenu.Position.Y:=self.Height*OrigSizes[47];
+  MPHostMenu.Position.X:=self.Width*OrigSizes[48];
+  MPHostMenu.Position.Y:=self.Height*OrigSizes[49];
+  MPJoinMenu.Position.X:=self.Width*OrigSizes[50];
+  MPJoinMenu.Position.Y:=self.Height*OrigSizes[51];
+  
+  ThrustBar.Top:=Round(self.Height*OrigSizes[52]);
+  ThrustBar.Left:=Round(self.Width*OrigSizes[53]);
+  ThrustBar.Height:=Round(self.Height*OrigSizes[54]);
+  ThrustBar.Width:=Round(self.Width*OrigSizes[55]);
+end;
+                          
+procedure TForm1.ReloadRoom(X,Z:Integer);
+var C1,C2:Integer;
+begin
+  if (X<PosX-RaumRange)
+  or (X>PosX+RaumRange)
+  or (Z<PosZ-RaumRange)
+  or (Z>PosZ+RaumRange) then
+  Exit;
+
+  if not Map[X,Z].created then CreateRaum(X,Z);
+
+  if RoomInvisible[X-PosX,Z-PosZ] then begin
+    Wallarr[0,X-posX,Z-PosZ].Visible:=false;
+    Wallarr[1,X-posX,Z-PosZ].Visible:=false;
+    UpWallarr[0,X-posX,Z-PosZ].Visible:=false;
+    UpWallarr[1,X-posX,Z-PosZ].Visible:=false;
+    DownWallarr[0,X-posX,Z-PosZ].Visible:=false;
+    DownWallarr[1,X-posX,Z-PosZ].Visible:=false;
+
+    for C1:=0 to High(Roomtypes) do begin
+      PlaneArr[C1,Down,X-posX,Z-PosZ].Visible:=false;
+      PlaneArr[C1,Up,X-posX,Z-PosZ].Visible:=false;
+    end;
+    MuhNPCArr[X-posX,Z-posZ].Body.Visible:=false;
+
+    Exit;
+  end;
+
+
+  if Map[X-1,Z].Inhalt.Sorte<>Integer(Green) then begin
+    activateWall(0,X-posX,Z-posZ,nx in Map[X,Z].Walls);
+    activateUpWall(0,X-posX,Z-posZ,nx in Map[X,Z].UpWalls);
+    activateDownWall(0,X-posX,Z-posZ,nx in Map[X,Z].DownWalls);
+  end;
+  if Map[X+1,Z].Inhalt.Sorte<>Integer(Green) then begin
+    activateWall(0,X+1-posX,Z-posZ,px in Map[X,Z].Walls);
+    activateUpWall(0,X+1-posX,Z-posZ,px in Map[X,Z].UpWalls);
+    activateDownWall(0,X+1-posX,Z-posZ,px in Map[X,Z].DownWalls);
+  end;
+  if Map[X,Z-1].Inhalt.Sorte<>Integer(Green) then begin
+    activateWall(1,X-posX,Z-posZ,nz in Map[X,Z].Walls);
+    activateUpWall(1,X-posX,Z-posZ,nz in Map[X,Z].UpWalls);
+    activateDownWall(1,X-posX,Z-posZ,nz in Map[X,Z].DownWalls);
+  end;
+  if Map[X,Z+1].Inhalt.Sorte<>Integer(Green) then begin
+    activateWall(1,X-posX,Z-posZ+1,pz in Map[X,Z].Walls);
+    activateUpWall(1,X-posX,Z-posZ+1,pz in Map[X,Z].UpWalls);
+    activateDownWall(1,X-posX,Z-posZ+1,pz in Map[X,Z].DownWalls);
+  end;
+            
+    
+  activateGreen(X-PosX,Z-posZ,Map[X,Z].Inhalt.Sorte=Integer(Green));
+
+  if PlaneInvisible[X-PosX,Z-PosZ] then begin
+    for C1:=0 to High(Roomtypes) do begin
+      PlaneArr[C1,Down,X-posX,Z-PosZ].Visible:=false;
+      PlaneArr[C1,Up,X-posX,Z-PosZ].Visible:=false;
+    end;
+    MuhNPCArr[X-posX,Z-posZ].Body.Visible:=false;
+
+    Exit;
+  end;
+
+  for C1:=0 to High(Roomtypes) do begin
+    PlaneArr[C1,Down,X-PosX,Z-PosZ].Visible:=Map[X,Z].Inhalt.Sorte=C1;
+    if Map[X,Z].Inhalt.Sorte=C1 then begin
+      for C2:=C1+1 to High(Roomtypes) do
+      if PlaneArr[C1,Down,X-PosX,Z-PosZ]<>PlaneArr[C2,Down,X-PosX,Z-PosZ]
+      then PlaneArr[C2,Down,X-PosX,Z-PosZ].Visible:=false;
+      Break;
+    end;
+  end;
+
+  for C1:=0 to High(Roomtypes) do begin
+    PlaneArr[C1,Up,X-PosX,Z-PosZ].Visible:=Map[X,Z].Inhalt.Sorte=C1;
+    if Map[X,Z].Inhalt.Sorte=C1 then begin
+      for C2:=C1+1 to High(Roomtypes) do
+      if PlaneArr[C1,Up,X-PosX,Z-PosZ]<>PlaneArr[C2,Up,X-PosX,Z-PosZ]
+      then PlaneArr[C2,Up,X-PosX,Z-PosZ].Visible:=false;
+      Break;
+    end;
+  end;
+
+  if (GetRT(X,Z).SPInvisible)
+  and not Form3.ClientSocket.Active
+  and not Form3.ServerSocket.Active then begin
+    for C1:=1 to High(Roomtypes) do begin
+      PlaneArr[C1,Down,X-PosX,Z-PosZ].Visible:=false;
+      PlaneArr[C1,Up,X-PosX,Z-PosZ].Visible:=false;
+    end;                                     
+    MuhNPCArr[X-posX,Z-posZ].Body.Visible:=false;
+    
+    PlaneArr[0,Down,X-PosX,Z-PosZ].Visible:=true;
+    PlaneArr[0,Up,X-PosX,Z-PosZ].Visible:=true;
+    Exit;
+  end;
+
+
+  if GetRT(X,Z).TurnRandom[Up] then
+  if Assigned(Map[X,Z].Inhalt.Daten) then
+  case TRichtung(Map[X,Z].Inhalt.Daten^) of
+    pz:Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=0;
+    nx:Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=90;
+    nz:Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=180;
+    px:Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=270;
+  end;
+  if GetRT(X,Z).TurnRandom[Down] then
+  if Assigned(Map[X,Z].Inhalt.Daten) then
+  case TRichtung(Map[X,Z].Inhalt.Daten^) of
+    pz:Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=180;
+    nx:Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=90;
+    nz:Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=0;  
+    px:Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=270;
+  end;
+
+  if GetRT(X,Z).TurnToGoal[Up] then
+  if Abs(GoalPos.X-X)>Abs(GoalPos.Y-Z) then begin
+    if GoalPos.X-X>0 then
+    Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=-90//px
+    else
+    Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=90//nx
+  end else begin
+    if GoalPos.Y-Z>0 then
+    Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=0//pz
+    else
+    Planearr[Map[X,Z].Inhalt.Sorte,Up,x-PosX,z-posZ].RollAngle:=180//nz
+  end;
+
+  if GetRT(X,Z).TurnToGoal[Down] then
+  if Abs(GoalPos.X-X)>Abs(GoalPos.Y-Z) then begin
+    if GoalPos.X-X>0 then
+    Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=-90//px
+    else
+    Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=90//nx
+  end else begin
+    if GoalPos.Y-Z>0 then
+    Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=180//pz
+    else
+    Planearr[Map[X,Z].Inhalt.Sorte,Down,x-PosX,z-posZ].RollAngle:=0//nu
+  end;
+
+  MuhNPCArr[X-posX,Z-posZ].Body.Visible:=GetRT(X,Z).OPTanzGegner;
+end;
+
+procedure TForm1.Reload;
+var C1,C3,C2:Integer;
+begin
+  CameraDirection:=Ceil(Camera.Direction.X)+2*Ceil(Camera.Direction.Z);
+
+  for C1:=-RaumRange to RaumRange do
+  for C2:=-RaumRange to RaumRange do begin
+    RoomInvisible[C1,C2]:=false;
+    PlaneInvisible[C1,C2]:=false;
+  end;
+
+  if GetRT(PosX,PosZ).GreenWallsAround then  
+  for C1:=-RaumRange to RaumRange do
+  for C2:=-RaumRange to RaumRange do begin
+    RoomInvisible[C1,C2]:=true;
+    PlaneInvisible[C1,C2]:=true;
+  end;
+
+  if not Players[MyID].OutOfMaze then begin
+    for C2:=1 to RaumRange do
+    if (nx in Map[C2+PosX,PosZ].Walls)
+    or (GetRT(C2+PosX,PosZ).GreenWallsAround) then begin
+      PlaneInvisible[C2,0]:=true;
+      for C1:=C2+1 to RaumRange do
+      RoomInvisible[C1,0]:=true;
+      Break;
+    end;            
+    for C2:=1 to RaumRange do
+    if (nz in Map[PosX,C2+PosZ].Walls)
+    or (GetRT(PosX,C2+PosZ).GreenWallsAround) then begin
+      PlaneInvisible[0,C2]:=true;
+      for C1:=C2+1 to RaumRange do
+      RoomInvisible[0,C1]:=true;
+      Break;
+    end;     
+    for C2:=-1 downto -RaumRange do
+    if (pz in Map[PosX,C2+PosZ].Walls)
+    or (GetRT(PosX,C2+PosZ).GreenWallsAround) then begin 
+      PlaneInvisible[0,C2]:=true;
+      for C1:=C2-1 downto -RaumRange do
+      RoomInvisible[0,C1]:=true;
+      Break;
+    end;
+    for C2:=-1 downto -RaumRange do
+    if (px in Map[C2+PosX,PosZ].Walls)
+    or (GetRT(C2+PosX,PosZ).GreenWallsAround) then begin
+      PlaneInvisible[C2,0]:=true;
+      for C1:=C2-1 downto -RaumRange do
+      RoomInvisible[C1,0]:=true;
+      Break;
+    end;
+
+    if (((px in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX+1,PosZ).GreenWallsAround))
+    and ((pz in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX,PosZ+1).GreenWallsAround)))
+    or (CameraDirection=0) then
+    for C1:=1 to RaumRange do
+    for C2:=1 to RaumRange do begin
+      RoomInvisible[C1,C2]:=true;
+    end;
+
+    if (((px in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX+1,PosZ).GreenWallsAround))
+    and ((nz in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX,PosZ-1).GreenWallsAround)))
+    or (CameraDirection=2) then
+    for C1:=1 to RaumRange do
+    for C2:=-1 downto -RaumRange do begin
+      RoomInvisible[C1,C2]:=true;
+    end;
+
+    if (((nx in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX-1,PosZ).GreenWallsAround))
+    and ((nz in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX,PosZ-1).GreenWallsAround)))
+    or (CameraDirection=3) then
+    for C1:=-1 downto -RaumRange do
+    for C2:=-1 downto -RaumRange do begin
+      RoomInvisible[C1,C2]:=true;
+    end;
+
+    if (((nx in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX-1,PosZ).GreenWallsAround))
+    and ((pz in Map[PosX,PosZ].Walls)
+    or (GetRT(PosX,PosZ+1).GreenWallsAround)))
+    or (CameraDirection=1) then
+    for C1:=-1 downto -RaumRange do
+    for C2:=1 to RaumRange do begin
+      RoomInvisible[C1,C2]:=true;
+    end;
+
+    for C1:=-1 to 1 do begin
+      RoomInvisible[C1,0]:=false;
+      RoomInvisible[0,C1]:=false;
+    end;
+    PlaneInvisible[0,0]:=false;
+  end;
+
+  for C1:=PosX-RaumRange to PosX+RaumRange do
+  for C3:=PosZ-RaumRange to PosZ+RaumRange do
+  ReloadRoom(C1,C3);
+
+  ReloadWallShaders;
+  ReloadTexQual;
+end;
+
+procedure TForm1.ReloadWallShaders;
+var C1,C3:Integer;
+begin
+  for C1:=-RaumRange to RaumRange+1 do
+  for C3:=-RaumRange to RaumRange+1 do
+  if (C1<-ShaderWidth+1)
+  or (C3<-ShaderWidth+1)
+  or (C1>ShaderWidth)
+  or (C3>ShaderWidth) then begin
+    if Wallarr[0,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[0,C1,C3].Material.LibMaterialName:='WallFar';
+    if Wallarr[1,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[1,C1,C3].Material.LibMaterialName:='WallFar';
+    if UpWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallFar';
+    if UpWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallFar';
+    if DownWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallFar';
+    if DownWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallFar';
+  end;
+end;
+
+procedure TForm1.ReloadTexQual;
+var C1,C3:Integer;
+const HiResRad=3; LowResRad=6;
+begin
+  for C1:=-RaumRange to RaumRange+1 do
+  for C3:=-RaumRange to RaumRange+1 do
+  if sqrt(sqr(C1)+sqr(C3))>LowResRad then begin
+    if Wallarr[0,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[0,C1,C3].Material.LibMaterialName:='WallVeryLowRes';
+    if Wallarr[1,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[1,C1,C3].Material.LibMaterialName:='WallVeryLowRes';
+    if UpWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallVeryLowRes';
+    if UpWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallVeryLowRes';
+    if DownWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallVeryLowRes';
+    if DownWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallVeryLowRes';
+  end else
+  if sqrt(sqr(C1)+sqr(C3))>HiResRad then begin
+    if Wallarr[0,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[0,C1,C3].Material.LibMaterialName:='WallLowRes';
+    if Wallarr[1,C1,C3].Material.LibMaterialName='Wall'
+    then Wallarr[1,C1,C3].Material.LibMaterialName:='WallLowRes';
+    if UpWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallLowRes';
+    if UpWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then UpWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallLowRes';
+    if DownWallarr[0,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[0,C1,C3].Material.LibMaterialName:='HalfWallLowRes';
+    if DownWallarr[1,C1,C3].Material.LibMaterialName='HalfWall'
+    then DownWallarr[1,C1,C3].Material.LibMaterialName:='HalfWallLowRes';
+  end;
+end;
+
+
+procedure TForm1.Timer1Timer(Sender: TObject);
+begin
+  GLHUDText2.Visible:=inMenu;
+  if VideoMenu.Visible then begin
+    VideoMenu.Items[2]:='Shading Distance: '+IntToStr(ShaderWidth);
+  end;
+  if MPHostMenu.Visible then begin
+    MPHostMenu.Items[0]:='Port: '+IntToStr(MPPort);
+  end;
+  if MPJoinMenu.Visible then begin
+    MPJoinMenu.Items[0]:='Server-IP: '+MPServerAddress;
+    MPJoinMenu.Items[1]:='Port: '+IntToStr(MPPort);
+  end;
+
+
+  GLSceneViewer1MouseMove(
+  Sender,[],Form1.ScreenToClient(Mouse.CursorPos).X,
+  Form1.ScreenToClient(Mouse.CursorPos).Y);
+
+  CalcFPS(TTimer(Sender).Interval/1000);
+  if Panel1.Visible then
+  Panel1.Caption:=floatToStr(Round(100*FPS)/100);
+  Self.Caption:='Randomaze  FPS: '+floatToStr(Round(100*FPS)/100);
+
+  if Panel11.Visible then begin
+    Panel11Seconds:=Panel11Seconds-TTimer(Sender).Interval/1000;
+    if Panel11Seconds<0.01 then begin //Float Comparison
+      Panel11Seconds:=0;
+      Panel11.Visible:=false;
+    end;
+  end;
+  //todo 1:panel11 position in panelconfig, RichEdit1 in origsizes
+  if RichEdit1.Visible then begin
+    RE1Seconds:=RE1Seconds-TTimer(Sender).Interval/1000;
+    if RE1Seconds<0.01 then begin //Float Comparison
+      RE1Seconds:=0;
+      RichEdit1.Visible:=false;
+    end;
+  end;
+
+  if Panel13.Visible then begin
+    Panel13Seconds:=Panel13Seconds-TTimer(Sender).Interval/1000;
+    if Panel13Seconds<0.01 then begin //Float Comparison
+      Panel13Seconds:=0;
+      Panel13.Visible:=false;
+    end;
+  end;
+
+
+  if Panel2.Visible then
+  Panel2.Caption:=
+  FloatToStr(Round(100*GLCamera1.Position.X)/100)+','
+  +FloatToStr(Round(100*GLCamera1.Position.Y)/100)+','
+  +FloatToStr(Round(100*GLCamera1.Position.Z)/100);       
+  if Panel3.Visible then
+  Panel3.Caption:=BoolToStr(players[MyId].CeilWalk,true);     
+  if Panel4.Visible then
+  Panel4.Caption:=BoolToStr(won,true)+','+BoolToStr(lost,true);
+
+  if Panel6.Visible then
+  Panel6.Caption:=IntToStr(PosX)+','+IntToStr(PosZ);
+   
+  if Players[MyID].Speed<=0.01 then
+  if IDRecieved then begin   
+    Panel8.Font.Color:=RGB(150,25,25);
+    Panel8.Color:=RGB(38,38,38);
+    Panel8.Visible:=true;
+    Panel8.Caption:='Anticamper:';
+    LoseGame;
+  end;
+end;
+
+function TForm1.NewWall(x,z:Integer; width,depth:Real):TGLCube;
+begin
+  Result:=TGLCube(Walls.AddNewChild(TGLCube));
+  Result.Position.X:=x;
+  Result.Position.Y:=1;
+  Result.Position.Z:=z;
+  Result.CubeWidth:=width;
+  Result.CubeHeight:=6;
+  Result.CubeDepth:=depth;
+  Result.Material.MaterialLibrary:=Form2.GLMaterialLibrary1;
+  Result.Material.LibMaterialName:='Wall';
+end;
+
+function TForm1.NewMuhNPCBody(X,Z:Integer):TGLCube;
+begin
+  Result:=TGLCube(MuhNPCs.AddNewChild(TGLCube)); 
+  Result.Position.X:=20*X;
+  Result.Position.Y:=0;
+  Result.Position.Z:=20*Z;
+  Result.CubeWidth:=2;
+  Result.CubeHeight:=2;
+  Result.CubeDepth:=2;
+  Result.Material.MaterialLibrary:=Form2.GLMaterialLibrary1;
+  Result.Material.LibMaterialName:='Muh';
+end;
+
+function TForm1.NewUpWall(x,z:Integer; width,depth:Real):TGLCube;
+begin
+  Result:=TGLCube(Walls.AddNewChild(TGLCube));
+  Result.Position.X:=x;
+  Result.Position.Y:=2.5;
+  Result.Position.Z:=z;
+  Result.CubeWidth:=width;
+  Result.CubeHeight:=3;
+  Result.CubeDepth:=depth;
+  Result.Material.MaterialLibrary:=Form2.GLMaterialLibrary1;
+  Result.Material.LibMaterialName:='HalfWall';
+end;
+
+function TForm1.NewDownWall(x,z:Integer; width,depth:Real):TGLCube;
+begin
+  Result:=TGLCube(Walls.AddNewChild(TGLCube));
+  Result.Position.X:=x;
+  Result.Position.Y:=-0.5;
+  Result.Position.Z:=z;
+  Result.CubeWidth:=width;
+  Result.CubeHeight:=3;
+  Result.CubeDepth:=depth;
+  Result.Material.MaterialLibrary:=Form2.GLMaterialLibrary1;
+  Result.Material.LibMaterialName:='HalfWall';
+end;
+
+procedure TForm1.SpreadContamination(X,Z:Integer);
+var C1,C2:Integer; R1:Real; Pos:TPoint;
+begin
+  for C1:=X-1 to X+1 do
+  for C2:=Z-1 to Z+1 do begin
+    R1:=Random;
+    if R1<0.3 then begin
+      Map[C1,C2].Inhalt.Sorte:=Map[X,Z].Inhalt.Sorte;
+      if GetRT(C1,C2).TurnRandom[Down]
+      or GetRT(C1,C2).TurnRandom[Up]
+      then Map[C1,C2].Inhalt.Daten:=@Richtungen[
+      TRichtung(Random(Integer(High(TRichtung))+1))]
+    end else if R1<0.5 then
+    Map[C1,C2].Inhalt.Sorte:=0;
+    
+    if R1<0.5 then
+    if Form3.ServerSocket.Active then begin
+      Pos.X:=C1;
+      Pos.Y:=C2;
+      Form3.SendRaum(Pos);
+    end;
+  end;
+end;
+
+
+
+procedure TForm1.ShowPanel(ID:Cardinal);
+begin
+  Panel11.Top:=Round(PanelConfigs[ID].TopDivH*Self.Height);
+  Panel11.Left:=Round(PanelConfigs[ID].LeftDivW*Self.Width);
+  Panel11.Width:=Round(PanelConfigs[ID].WidthDivW*Self.Width);
+  Panel11.Height:=Round(PanelConfigs[ID].HeightDivH*Self.Height);
+  
+  Panel11.Caption:=PanelConfigs[ID].Text;
+
+  if PanelConfigs[ID].SpeedAtEnd then
+  Panel11.Caption:=Panel11.Caption+' '+
+  Floattostr(Round(100*Players[MyID].Speed)/100);
+
+  Panel11.Font.Color:=PanelConfigs[ID].FontColor;
+  Panel11.Color:=PanelConfigs[ID].BackGroundColor;
+  Panel11.Font.SIZE:=Round(PanelConfigs[ID].FontSizeDivH*Self.Height);
+  Panel11Seconds:=PanelConfigs[ID].Seconds;
+  Panel11.Visible:=true;
+end;
+
+procedure TForm1.Explode(X,Z:Integer);
+var C1,C2:Integer;
+begin
+  if (X=PosX) and (Z=PosZ) then
+  Form1.ShowPanel(14);//todo 1:testen
+
+  if GetRT(X,Z).Explode[Up]
+  or GetRT(X,Z).Explode[Down] then 
+  Map[X,Z].Inhalt.Sorte:=0;
+  for C1:=X-Exploradius to X+Exploradius do
+  for C2:=Z-Exploradius to Z+Exploradius do
+  if (C1<MapSize)
+  and (C1>-MapSize)
+  and (C2<MapSize)
+  and (C2>-MapSize) then begin
+    if not Map[C1,C2].created then CreateRaum(C1,C2);
+    if sqrt(sqr(X-C1)+sqr(Z-C2))<Exploradius then begin
+      Map[C1,C2].Walls:=[];
+      Map[C1+1,C2].Walls:=Map[C1+1,C2].Walls-[nx];
+      Map[C1,C2+1].Walls:=Map[C1,C2+1].Walls-[nz];
+      Map[C1,C2-1].Walls:=Map[C1,C2-1].Walls-[pz];
+      Map[C1-1,C2].Walls:=Map[C1-1,C2].Walls-[px];
+      Map[C1,C2].UpWalls:=[];
+      Map[C1+1,C2].UpWalls:=Map[C1+1,C2].UpWalls-[nx];
+      Map[C1,C2+1].UpWalls:=Map[C1,C2+1].UpWalls-[nz];
+      Map[C1,C2-1].UpWalls:=Map[C1,C2-1].UpWalls-[pz];
+      Map[C1-1,C2].UpWalls:=Map[C1-1,C2].UpWalls-[px];
+      Map[C1,C2].DownWalls:=[];
+      Map[C1+1,C2].DownWalls:=Map[C1+1,C2].DownWalls-[nx];
+      Map[C1,C2+1].DownWalls:=Map[C1,C2+1].DownWalls-[nz];
+      Map[C1,C2-1].DownWalls:=Map[C1,C2-1].DownWalls-[pz];
+      Map[C1-1,C2].DownWalls:=Map[C1-1,C2].DownWalls-[px];
+      if not Won then begin
+        if (Map[C1,C2].Inhalt.Sorte=Integer(GreenTrap))
+        then begin
+          Map[C1,C2].Inhalt.Sorte:=Integer(Green);
+        end;
+        if (Map[C1+1,C2].Inhalt.Sorte=Integer(GreenTrap))
+        then begin
+          Map[C1+1,C2].Inhalt.Sorte:=Integer(Green);
+        end;
+        if (Map[C1,C2+1].Inhalt.Sorte=Integer(GreenTrap))
+        then begin
+          Map[C1,C2+1].Inhalt.Sorte:=Integer(Green);
+        end;
+        if (Map[C1-1,C2].Inhalt.Sorte=Integer(GreenTrap))
+        then begin
+          Map[C1-1,C2].Inhalt.Sorte:=Integer(Green);
+        end;
+        if (Map[C1,C2-1].Inhalt.Sorte=Integer(GreenTrap))
+        then begin
+          Map[C1,C2-1].Inhalt.Sorte:=Integer(Green);
+          Form3.SendRaumSorte(C1,C2-1);
+        end;
+      end;
+      if (Map[C1,C2].Inhalt.Sorte=Integer(Explosion))
+      then Explode(C1,C2);
+      if (Map[C1+1,C2].Inhalt.Sorte=Integer(Explosion))
+      then Explode(C1+1,C2);
+      if (Map[C1,C2+1].Inhalt.Sorte=Integer(Explosion))
+      then Explode(C1,C2);
+      if (Map[C1-1,C2].Inhalt.Sorte=Integer(Explosion))
+      then Explode(C1-1,C2);
+      if (Map[C1,C2-1].Inhalt.Sorte=Integer(Explosion))
+      then Explode(C1,C2-1);
+    end;
+  end;
+end;
+
+function TForm1.NewPlayer(ID:Integer):TGLCylinder;
+var R,G,B:Real;
+begin                                     
+  Result:=TGLCylinder(OtherPlayers.AddNewChild(TGLCylinder));
+  Result.Slices:=50;
+  Result.Height:=PlayerDepth[false]+PlayerHeight[false];
+  Result.Position.Y:=-2+(PlayerDepth[false]+PlayerHeight[false])/2;
+  Result.TopRadius:=1;
+  Result.BottomRadius:=1;
+  Result.Up.SetVector(0,1,0);    
+  RedbyID(ID,R);
+  GreenbyID(ID,G);
+  BluebyID(ID,B);
+  Result.Material.FrontProperties.Ambient.SetColor(R,G,B);
+  Result.Material.FrontProperties.Diffuse.SetColor(R,G,B);
+  Result.Material.FrontProperties.Emission.SetColor(R,G,B);
+  Result.Material.BackProperties.Ambient.SetColor(R,G,B);
+  Result.Material.BackProperties.Diffuse.SetColor(R,G,B);
+  Result.Material.BackProperties.Emission.SetColor(R,G,B);
+end;
+
+function TForm1.NewPlane(x,z:Integer; Height:THeight;
+  Sorte:Integer):TGLPlane;
+const HiResRad=1.5; LowResRad=3;
+begin
+  Result:=TGLPlane(Planes.AddNewChild(TGLPlane));
+  Result.Position.X:=x*20;
+  if Height=Down then
+  Result.Position.Y:=-2
+  else Result.Position.Y:=4;
+  Result.Position.Z:=z*20;
+  Result.Width:=20;
+  Result.Height:=20;  
+  if Height=Down then
+  Result.PitchAngle:=90
+  else 
+  Result.PitchAngle:=-90;
+  Result.Material.MaterialLibrary:=Form2.GLMaterialLibrary1;
+  Result.Material.LibMaterialName:=Roomtypes[Sorte].MaterialName[Height];
+  if sqrt(sqr(x)+sqr(z))>LowResRad then begin
+    if (Roomtypes[Sorte].MaterialName[Height]='Grass') then
+    Result.Material.LibMaterialName:='GrassVeryLowRes';
+    if (Roomtypes[Sorte].MaterialName[Height]='Ceiling') then
+    Result.Material.LibMaterialName:='CeilingVeryLowRes';
+  end else if sqrt(sqr(x)+sqr(z))>HiResRad then begin
+    if (Roomtypes[Sorte].MaterialName[Height]='Grass') then
+    Result.Material.LibMaterialName:='GrassLowRes';
+    if (Roomtypes[Sorte].MaterialName[Height]='Ceiling') then
+    Result.Material.LibMaterialName:='CeilingLowRes';
+  end;
+end;
+
+procedure TForm1.activateWall(dir,x,z:Integer; activate:Boolean);
+begin
+  Wallarr[dir,x,z].Visible:=activate;
+end;
+
+procedure TForm1.activateUpWall(dir,x,z:Integer; activate:Boolean);
+begin
+  UpWallarr[dir,x,z].Visible:=activate;
+end;
+
+procedure TForm1.activateDownWall(dir,x,z:Integer; activate:Boolean);
+begin
+  DownWallarr[dir,x,z].Visible:=activate;
+end;
+
+procedure TForm1.activateGreen(X,Z:Integer; activate:Boolean);
+begin
+  if activate then begin
+    if nx in Map[x+PosX,z+PosZ].UpWalls then begin
+      DownWallarr[0,X,Z].Material.LibMaterialName:='HalfGreenWall';
+      UpWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X,Z].Visible:=true;
+      UpWallarr[0,X,Z].Visible:=true;
+      Wallarr[0,X,Z].Visible:=false;
+    end else if nx in Map[x+PosX,z+PosZ].DownWalls then begin
+      DownWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X,Z].Material.LibMaterialName:='HalfGreenWall';
+      Wallarr[0,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X,Z].Visible:=true;
+      UpWallarr[0,X,Z].Visible:=true;
+      Wallarr[0,X,Z].Visible:=false;
+    end else if not (nx in Map[x+PosX,z+PosZ].Walls) then begin
+      DownWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X,Z].Material.LibMaterialName:='GreenWall';
+      DownWallarr[0,X,Z].Visible:=false;
+      UpWallarr[0,X,Z].Visible:=false;
+      Wallarr[0,X,Z].Visible:=true;
+    end else begin                                 
+      DownWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X,Z].Visible:=false;
+      UpWallarr[0,X,Z].Visible:=false;
+      Wallarr[0,X,Z].Visible:=true;
+    end;
+
+    if px in Map[x+PosX,z+PosZ].UpWalls then begin
+      DownWallarr[0,X+1,Z].Material.LibMaterialName:='HalfGreenWall';
+      UpWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X+1,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X+1,Z].Visible:=true;
+      UpWallarr[0,X+1,Z].Visible:=true;
+      Wallarr[0,X+1,Z].Visible:=false;
+    end else if px in Map[x+PosX,z+PosZ].DownWalls then begin
+      DownWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X+1,Z].Material.LibMaterialName:='HalfGreenWall';
+      Wallarr[0,X+1,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X+1,Z].Visible:=true;
+      UpWallarr[0,X+1,Z].Visible:=true;
+      Wallarr[0,X+1,Z].Visible:=false;
+    end else if not (px in Map[x+PosX,z+PosZ].Walls) then begin
+      DownWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X+1,Z].Material.LibMaterialName:='GreenWall';
+      DownWallarr[0,X+1,Z].Visible:=false;
+      UpWallarr[0,X+1,Z].Visible:=false;
+      Wallarr[0,X+1,Z].Visible:=true;
+    end else begin                                 
+      DownWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X+1,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[0,X+1,Z].Visible:=false;
+      UpWallarr[0,X+1,Z].Visible:=false;
+      Wallarr[0,X+1,Z].Visible:=true;
+    end;
+
+    if nz in Map[x+PosX,z+PosZ].UpWalls then begin
+      DownWallarr[1,X,Z].Material.LibMaterialName:='HalfGreenWall';
+      UpWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z].Visible:=true;
+      UpWallarr[1,X,Z].Visible:=true;
+      Wallarr[1,X,Z].Visible:=false;
+    end else if nz in Map[x+PosX,z+PosZ].DownWalls then begin
+      DownWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z].Material.LibMaterialName:='HalfGreenWall';
+      Wallarr[1,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z].Visible:=true;
+      UpWallarr[1,X,Z].Visible:=true;
+      Wallarr[1,X,Z].Visible:=false;
+    end else if not (nz in Map[x+PosX,z+PosZ].Walls) then begin
+      DownWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z].Material.LibMaterialName:='GreenWall';
+      DownWallarr[1,X,Z].Visible:=false;
+      UpWallarr[1,X,Z].Visible:=false;
+      Wallarr[1,X,Z].Visible:=true;
+    end else begin                                 
+      DownWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z].Visible:=false;
+      UpWallarr[1,X,Z].Visible:=false;
+      Wallarr[1,X,Z].Visible:=true;
+    end;
+
+    
+    if pz in Map[X+PosX,Z+PosZ].UpWalls then begin
+      DownWallarr[1,X,Z+1].Material.LibMaterialName:='HalfGreenWall';
+      UpWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z+1].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z+1].Visible:=true;
+      UpWallarr[1,X,Z+1].Visible:=true;
+      Wallarr[1,X,Z+1].Visible:=false;
+    end else if pz in Map[x+PosX,z+PosZ].DownWalls then begin
+      DownWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z+1].Material.LibMaterialName:='HalfGreenWall';
+      Wallarr[1,X,Z+1].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z+1].Visible:=true;
+      UpWallarr[1,X,Z+1].Visible:=true;
+      Wallarr[1,X,Z+1].Visible:=false;
+    end else if not (pz in Map[x+PosX,z+PosZ].Walls) then begin
+      DownWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z+1].Material.LibMaterialName:='GreenWall';
+      DownWallarr[1,X,Z+1].Visible:=false;
+      UpWallarr[1,X,Z+1].Visible:=false;
+      Wallarr[1,X,Z+1].Visible:=true;
+    end else begin
+      DownWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z+1].Material.LibMaterialName:='Wall';
+      DownWallarr[1,X,Z+1].Visible:=false;
+      UpWallarr[1,X,Z+1].Visible:=false;
+      Wallarr[1,X,Z+1].Visible:=true;
+    end;
+
+  end else begin 
+    if (Map[X+PosX-1,Z+PosZ].Inhalt.Sorte<>Integer(Green)) then begin
+      DownWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X,Z].Material.LibMaterialName:='Wall';
+    end;
+    if (Map[X+PosX+1,Z+PosZ].Inhalt.Sorte<>Integer(Green)) then begin
+      DownWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[0,X+1,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[0,X+1,Z].Material.LibMaterialName:='Wall';
+    end;
+    if (Map[X+PosX,Z+PosZ].Inhalt.Sorte<>Integer(Green)) then begin
+      DownWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X+1,Z].Material.LibMaterialName:='Wall';
+    end;
+    if (Map[X+PosX,Z+PosZ+1].Inhalt.Sorte<>Integer(Green)) then begin
+      DownWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      UpWallarr[1,X,Z+1].Material.LibMaterialName:='HalfWall';
+      Wallarr[1,X,Z+1].Material.LibMaterialName:='Wall';
+    end;
+  end;
+end;
+
+procedure TForm1.Creategoal;
+var C1,C2,C3,C4:Integer;
+begin
+  Lost:=false;
+  Won:=false;
+  if PGoal<>nil then begin
+    PGoal.Inhalt.Sorte:=0;
+    PGoal:=nil;
+  end;
+  Panel8.Visible:=false;
+  C1:=GoalPos.x;
+  C3:=GoalPos.y;
+//  Map[C1,C3].created:=true;
+  Map[C1,C3].Inhalt.Daten:=nil;
+
+  for C4:=C1-GoalProtectionRadius to C1+GoalProtectionRadius do
+  for C2:=C3-GoalProtectionRadius to C3+GoalProtectionRadius do begin
+    if sqrt(sqr(C1-C4)+sqr(C3-C2))<GoalProtectionRadius then begin
+      if not Map[C4,C2].created then CreateRaum(C4,C2);
+      if not Map[C4-1,C2].created then CreateRaum(C4,C2);
+      if not Map[C4,C2+1].created then CreateRaum(C4,C2);
+      if not Map[C4,C2-1].created then CreateRaum(C4,C2);
+      if not Map[C4+1,C2].created then CreateRaum(C4,C2);
+      if not GetRT(C4,C2).Passierbar then
+      Map[C4,C2].Inhalt.Sorte:=0;
+      Map[C4,C2].Walls:=[];
+      Map[C4+1,C2].Walls:=Map[C4+1,C2].Walls-[nx];
+      Map[C4,C2+1].Walls:=Map[C4,C2+1].Walls-[nz];
+      Map[C4,C2-1].Walls:=Map[C4,C2-1].Walls-[pz];
+      Map[C4-1,C2].Walls:=Map[C4-1,C2].Walls-[px];
+      Map[C4,C2].UpWalls:=[];
+      Map[C4+1,C2].UpWalls:=Map[C4+1,C2].UpWalls-[nx];
+      Map[C4,C2+1].UpWalls:=Map[C4,C2+1].UpWalls-[nz];
+      Map[C4,C2-1].UpWalls:=Map[C4,C2-1].UpWalls-[pz];
+      Map[C4-1,C2].UpWalls:=Map[C4-1,C2].UpWalls-[px];
+      Map[C4,C2].DownWalls:=[];
+      Map[C4+1,C2].DownWalls:=Map[C4+1,C2].DownWalls-[nx];
+      Map[C4,C2+1].DownWalls:=Map[C4,C2+1].DownWalls-[nz];
+      Map[C4,C2-1].DownWalls:=Map[C4,C2-1].DownWalls-[pz];
+      Map[C4-1,C2].DownWalls:=Map[C4-1,C2].DownWalls-[px];
+    end;
+  end; 
+  Map[C1,C3].Inhalt.Sorte:=Integer(Goal);
+
+  PGoal:=@Map[C1,C3]; //todo 1: hier müssten "Daten" gefüllt werden
+
+  if GetRT(C1,C3).TurnRandom[Up]
+  or GetRT(C1,C3).TurnRandom[Down] then
+  Map[C1,C3].Inhalt.Daten:=@Richtungen[
+  TRichtung(Random(Integer(High(TRichtung))+1))];
+
+  ReloadRoom(C1,C3);
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+var C1,C3,C4:integer;         
+  Repcount:Cardinal;
+begin
+  
+  Memo1.Align:=alClient;
+  Memo1.Width:=Form1.Width;
+  Memo1.Lines.Clear;
+  Memo1.Lines.Add('');
+  Memo1.Lines.Add('');
+  Memo1.Lines.Add('');
+  Memo1.Lines.Add('This is not a Bug and the Game has not stopped running.');
+  Memo1.Lines.Add('Please go to the next Room to remove this Message.');
+  Memo1.Lines.Add('This works at a proability of 20%.');
+  Memo1.Lines.Add('If you can see the Cursor you might be in a Menu.');
+  Memo1.Visible:=false;
+
+  ThrustBar.Position:=ThrustBar.Max;
+
+  LastPos:=ThrustBar.Position;
+
+  GLHUDText2.ModulateColor.SetColor(162,162,162);
+  GLHUDText2.Text:=GetCurrentVersion;
+
+  Randomize;
+  FrameCount:=0;
+  Camera:=GLCamera1;
+  Form2:=TForm2.Create(Self);
+  Form3:=TForm3.Create(Self);
+  Form4:=TForm4.Create(Self);
+
+  if colortest then
+  for C1:=0 to 20 do begin
+    npl:=NewPlayer(C1);
+    npl.Position.SetPoint(C1*3-30,2,0);
+  end;
+  
+  MyID:=0;
+  if MyID>=Cardinal(Length(Players)) then setlength(Players,MyID+1);
+  if MyID>=Cardinal(Length(playerarr)) then begin
+    Setlength(playerarr,MyID+1);
+    for C3:=0 to High(playerarr) do
+    if not assigned(playerarr[C3]) then playerarr[C3]:=Form1.NewPlayer(C3);
+  end;
+  Players[MyID].Dead:=false;
+  Players[MyID].jumping:=false;
+
+  Players[MyID].X:=GLCamera1.Position.X;
+  Players[MyID].Y:=GLCamera1.Position.Y;
+  Players[MyID].Z:=GLCamera1.Position.Z;
+  Players[MyID].CeilWalk:=false; 
+  ChangeSpeedTo(StartSpeed);          
+
+  ini:=TMyIni.Create(ExtractFilePath(ParamStr(0))+'Settings.ini');
+  ROOMini:=TMyIni.Create(ExtractFilePath(ParamStr(0))+'Roomtypes.ini');
+  ROOMini.ReadFloatDefault:=0;
+  PanelIni:=TMyIni.Create(ExtractFilePath(ParamStr(0))+'PanelConfigs.ini');
+
+  if not ini.SectionExists('Difficulty') then begin
+    RewriteDifficulty;
+  end else ReadDifficulty;
+              
+  if not ini.SectionExists('Multiplayer') then begin
+    RewriteMPSet;
+  end else ReadMPSet;
+
+  if (not ini.SectionExists('Roomtypelist'))
+  or (not FileExists(ExtractFilePath(ParamStr(0))+'Roomtypes.ini')) then
+  RewriteRoomtypes;
+
+  ReadRoomtypes;
+
+  if not FileExists(ExtractFilePath(ParamStr(0))+'PanelConfigs.ini')
+  then
+  RewritePanelConfigs;
+
+  ReadPanelConfigs;
+
+  Setlength(PlaneArr,Length(Roomtypes));
+
+  maxJumpHeight:=4-PlayerHeight[false];
+  Form2.loadTextures;
+  Form1.Icon.LoadFromFile('Wall.ico');
+  MainMenu.Visible:=true;
+  SettingsMenu.Visible:=false;
+  VideoMenu.Visible:=false;
+  MPMenu.Visible:=false;
+  MPHostMenu.Visible:=false;
+  MPJoinMenu.Visible:=false;
+  inMenu:=true;
+  if not inMenu then
+  GLUserInterface1.MouseLookActivate
+  else GLUserInterface1.MouseLookDeactivate;
+
+  
+  GLHUDText1.ModulateColor.SetColor(0/255,168/255,255/255);
+  GLHUDText1.Visible:=true;
+  ChangeSpeedTo(StartSpeed);
+  GLHUDText1.Text:=
+  'Speed: '+Floattostr(Round(100*Players[MyID].Speed)/100)+' m/s';
+  Panel13.Left:=Round(Self.Width*0.05);
+  Panel13.Width:=Round(Self.Width*0.9);
+  Panel13.Top:=Round(Self.Height*0.1);
+  Panel13.Height:=Round(Self.Height*0.8);
+  Panel13.Font.Size:=300;
+  
+  PosX:=0;
+  PosZ:=0;
+  for C1:=-RaumRange to RaumRange+1 do
+  for C3:=-RaumRange to RaumRange+1 do begin
+    Wallarr[0,C1,C3]:=NewWall(20*C1-10,20*C3,1,20);
+    Wallarr[1,C1,C3]:=NewWall(20*C1,20*C3-10,20,1);
+    UpWallarr[0,C1,C3]:=NewUpWall(20*C1-10,20*C3,1,20);
+    UpWallarr[1,C1,C3]:=NewUpWall(20*C1,20*C3-10,20,1);
+    DownWallarr[0,C1,C3]:=NewDownWall(20*C1-10,20*C3,1,20);
+    DownWallarr[1,C1,C3]:=NewDownWall(20*C1,20*C3-10,20,1);
+  end;
+
+  for C1:=-RaumRange to RaumRange do
+  for C3:=-RaumRange to RaumRange do begin
+    PlaneArr[0,Down,C1,C3]:=NewPlane(C1,C3,Down,0);
+    PlaneArr[0,Up,C1,C3]:=NewPlane(C1,C3,Up,0);
+  end;
+
+  for C4:=1 to High(Roomtypes) do
+  for C1:=-RaumRange to RaumRange do
+  for C3:=-RaumRange to RaumRange do begin
+    if Roomtypes[C4].MaterialName[Down]=Roomtypes[0].MaterialName[Down]
+    then PlaneArr[C4,Down,C1,C3]:=PlaneArr[0,Down,C1,C3]
+    else PlaneArr[C4,Down,C1,C3]:=NewPlane(C1,C3,Down,C4);
+    if Roomtypes[C4].MaterialName[Up]=Roomtypes[0].MaterialName[Up]
+    then PlaneArr[C4,Up,C1,C3]:=PlaneArr[0,Up,C1,C3]
+    else PlaneArr[C4,Up,C1,C3]:=NewPlane(C1,C3,Up,C4);
+  end;
+
+  for C1:=-RaumRange to RaumRange do
+  for C3:=-RaumRange to RaumRange do begin
+    MuhNPCarr[C1,C3].Body:=NewMuhNPCBody(C1,C3);
+    MuhNPCarr[C1,C3].MoveX:=(Random-0.5)*3;
+    MuhNPCarr[C1,C3].MoveY:=(Random-0.5)*3;
+    MuhNPCarr[C1,C3].MoveZ:=(Random-0.5)*3;
+  end;
+
+  GLSceneViewer1.FieldOfView:=150;
+
+  GLSceneViewer1.Buffer.BackgroundColor:=RGB(66,66,66);
+
+  Panel11.Left:=Panel9.Left;
+  Panel11.Top:=Panel9.Top;
+  RichEdit1.Left:=Panel9.Left;
+  RichEdit1.Top:=Panel9.Top;
+
+  if not ini.SectionExists('Proportions') then RewriteOrigSizes
+  else ReadOrigSizes;
+
+                 
+  start:=GetTickCount;
+  Repcount:=0;
+  repeat
+    Inc(Repcount);
+    CreateMap;
+    InitValidate;
+    Validate(0,0,Down);
+    if Application.Terminated then Exit;
+    if GetTickCount>start+20000 then
+    if MessageDlg(
+    'The game is taking very a long time to create a winable map. '+#13+#10+
+    'Try using "reini.bat" to reset the settings. Continue trying?',
+    mtWarning, [mbYes, mbNo], 0) =mrNo then begin
+      Application.Terminate;
+      Break;
+    end else start:=High(Cardinal)-20000;
+  until valid[0,0,Down];
+  if showMapCreateTime then
+  MessageOut(
+  'Map generated:'+#13+#10
+  +IntToStr(GetTickCount-start)+' ms,'+#13+#10
+  +IntToStr(Repcount)+' tries,'+#13+#10
+  +FloatToStr((GetTickCount-start)/repcount)+' ms/try',
+  'Map generated') else InformationDump:=Repcount;
+    
+  if Application.Terminated then Exit;
+  Reload;
+
+
+  SW:=TMyStopWatch.Create;
+end;
+
+procedure TForm1.CreateMap;
+var C1,C3,C4,C5:Integer;
+begin
+  for C1:=-mapsize to mapsize do
+  for C3:=-mapsize to mapsize do
+  Map[C1,C3].created:=false;
+
+  repeat
+    GoalPos.x:=RandomRange(-MaxGoalDist-1,MaxGoalDist+1);
+    GoalPos.y:=RandomRange(-MaxGoalDist-1,MaxGoalDist+1);
+    
+
+    if Application.Terminated then Exit;
+    if GetTickCount>start+20000 then
+    if MessageDlg(
+    'The game is taking very a long time to create a winable map. '+#13+#10+
+    'Try using "reini.bat" to reset the settings. Continue trying?',
+    mtWarning, [mbYes, mbNo], 0) =mrNo then begin
+      Application.Terminate;
+      Break;
+    end else start:=High(Cardinal)-20000;
+  until (sqrt(sqr(GoalPos.X)+sqr(GoalPos.Y))>=MinGoalDist)
+  and (sqrt(sqr(GoalPos.X)+sqr(GoalPos.Y))<=MaxGoalDist);
+
+  PGoal:=nil;
+  Creategoal;
+  
+  for C4:=-SpawnradiusNoWalls to SpawnradiusNoWalls do
+  for C5:=-SpawnradiusNoWalls to SpawnradiusNoWalls do begin
+    if sqrt(sqr(PosX-C4)+sqr(PosZ-C5))<SpawnradiusNoWalls then begin
+      if not Map[C4,C5].created then CreateRaum(C4,C5);
+      if not Map[C4-1,C5].created then CreateRaum(C4,C5);
+      if not Map[C4,C5+1].created then CreateRaum(C4,C5);
+      if not Map[C4,C5-1].created then CreateRaum(C4,C5);
+      if not Map[C4+1,C5].created then CreateRaum(C4,C5);
+      if not GetRT(C4,C5).Passierbar then
+      Map[C4,C5].Inhalt.Sorte:=0;
+      Map[C4,C5].Walls:=[];
+      Map[C4+1,C5].Walls:=Map[C4+1,C5].Walls-[nx];
+      Map[C4,C5+1].Walls:=Map[C4,C5+1].Walls-[nz];
+      Map[C4,C5-1].Walls:=Map[C4,C5-1].Walls-[pz];
+      Map[C4-1,C5].Walls:=Map[C4-1,C5].Walls-[px];
+      Map[C4,C5].UpWalls:=[];
+      Map[C4+1,C5].UpWalls:=Map[C4+1,C5].UpWalls-[nx];
+      Map[C4,C5+1].UpWalls:=Map[C4,C5+1].UpWalls-[nz];
+      Map[C4,C5-1].UpWalls:=Map[C4,C5-1].UpWalls-[pz];
+      Map[C4-1,C5].UpWalls:=Map[C4-1,C5].UpWalls-[px];
+      Map[C4,C5].DownWalls:=[];
+      Map[C4+1,C5].DownWalls:=Map[C4+1,C5].DownWalls-[nx];
+      Map[C4,C5+1].DownWalls:=Map[C4,C5+1].DownWalls-[nz];
+      Map[C4,C5-1].DownWalls:=Map[C4,C5-1].DownWalls-[pz];
+      Map[C4-1,C5].DownWalls:=Map[C4-1,C5].DownWalls-[px];
+    end;
+  end;
+
+  for C4:=-SpawnradiusNoSorte to SpawnradiusNoSorte do
+  for C5:=-SpawnradiusNoSorte to SpawnradiusNoSorte do
+  if sqrt(sqr(PosX-C4)+sqr(PosZ-C5))<SpawnradiusNoSorte then begin
+    if not Map[C4,C5].created then CreateRaum(C4,C5);
+    if GetRT(C4,C5).NotAtSpawn then
+    Map[C4,C5].Inhalt.Sorte:=0;
+  end;
+end;
+
+procedure TForm1.FormDestroy(Sender: TObject);
+var C1,C2,C3:integer;
+begin
+  if assigned(LastFrameCounts) then
+  FreeAndNil(LastFrameCounts);
+  Freeandnil(ini);
+  Freeandnil(ROOMini);
+  Timer1.Enabled:=false;
+  for C1:=-RaumRange to RaumRange do
+  for C2:=-RaumRange to RaumRange do begin
+    FreeAndNil(PlaneArr[0,Down,C1,C2]);
+    FreeAndNil(PlaneArr[0,Up,C1,C2]);
+  end;
+  for C1:=-RaumRange to RaumRange do
+  for C2:=-RaumRange to RaumRange do
+  for C3:=0 to High(Roomtypes) do begin
+    if Roomtypes[C3].MaterialName[Down]<>'Grass' then
+    if Assigned(PlaneArr[C3,Down,C1,C2]) then
+    FreeAndNil(PlaneArr[C3,Down,C1,C2]);
+    if Roomtypes[C3].MaterialName[Up]<>'Ceiling' then
+    if Assigned(PlaneArr[C3,Up,C1,C2]) then
+    FreeAndNil(PlaneArr[C3,Up,C1,C2]);
+  end;
+end;
+
+procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
+var vis:Boolean; C2:Char;
+begin
+  if Debug then
+  if Key='v' then begin
+    vis:=not Panel1.Visible;
+    Panel1.Visible:=vis;
+    Panel2.Visible:=vis;
+    Panel3.Visible:=vis;
+    Panel4.Visible:=vis;
+    Panel5.Visible:=vis;
+    Panel6.Visible:=vis;
+  end;
+  if Key='b' then begin
+    Close;
+  end;
+  if Key='m' then begin  
+    if self.Left=OrigSizes[0] then begin  
+      Self.BorderStyle:=bsnone;
+      Self.Left:=0;
+      Self.Top:=0;
+      Self.Width:=Screen.Width;
+      Self.Height:=Screen.Height;
+    end else begin
+      Self.BorderStyle:=TFormBorderStyle(Round(OrigSizes[4]));
+      Self.SetBounds(
+      Round(OrigSizes[0]),
+      Round(OrigSizes[1]),
+      Round(OrigSizes[2]),
+      Round(OrigSizes[3]));
+    end;
+  end;
+  if Key='n' then begin
+    ShellExecute(Handle, 'open','restart.bat',
+    PChar(extractFileName(application.ExeName)), nil, SW_SHOWNORMAL);
+    Close;        //parameter dateiname
+  end;
+  if (Key='p') or (Key=Char(27)) then begin
+    inMenu:=not MainMenu.Visible;
+    MainMenu.Visible:=inMenu;
+    SettingsMenu.Visible:=false;
+    VideoMenu.Visible:=false;
+    MPMenu.Visible:=false;
+    MPHostMenu.Visible:=false;
+    MPJoinMenu.Visible:=false;
+    if not inMenu then begin
+      if players[MyId].CeilWalk then
+      GLCamera1.Up.SetVector(0,-1,0)
+      else
+      GLCamera1.Up.SetVector(0,1,0);
+      GLUserInterface1.MouseLookActivate;
+    end else GLUserInterface1.MouseLookDeactivate;
+  end;
+  if Key='-' then begin
+    inMenu:=not SettingsMenu.Visible;
+    MainMenu.Visible:=false;
+    SettingsMenu.Visible:=inMenu;
+    VideoMenu.Visible:=false;
+    MPMenu.Visible:=false;   
+    MPHostMenu.Visible:=false;
+    MPJoinMenu.Visible:=false;
+    if not inMenu then begin
+      if players[MyId].CeilWalk then
+      GLCamera1.Up.SetVector(0,-1,0)
+      else
+      GLCamera1.Up.SetVector(0,1,0);
+      GLUserInterface1.MouseLookActivate;
+    end else GLUserInterface1.MouseLookDeactivate;
+  end;
+  if Key='w' then if inMenu then begin
+    MainMenu.SelectPrev;
+    SettingsMenu.SelectPrev;
+    VideoMenu.SelectPrev;
+    MPMenu.SelectPrev;
+    MPHostMenu.SelectPrev;
+    MPJoinMenu.SelectPrev;
+  end;
+  if Key='r' then begin
+    if (MessageDlg('Do you really want to respawn?', mtConfirmation,
+    [mbYes, mbNo], 0) = mrYes) then begin
+      Respawn;
+      while inMenu do begin
+        C2:='p';
+        FormKeyPress(Sender,C2);
+      end;
+    end;
+  end;
+  if Key='s' then if inMenu then begin
+    MainMenu.SelectNext;
+    SettingsMenu.SelectNext;
+    VideoMenu.SelectNext;
+    MPMenu.SelectNext;
+    MPHostMenu.SelectNext;
+    MPJoinMenu.SelectNext;
+  end;
+  if Key=Char(32) then begin       
+    if not inMenu then begin
+      StartJump(MyID);
+      Form3.SendJump(MyID);
+    end else GLSceneViewer1MouseDown(Sender,TMouseButton(3),[],
+    Mouse.CursorPos.X,Mouse.CursorPos.Y);
+    jumppressed:=true;
+  end;
+  Panel5.Caption:=IntToStr(Ord(Key))+'='+Key;
+end;
+
+procedure TForm1.StartJump(ID:Integer);
+begin
+  if jumppressed then Exit;
+  if Lost then Exit;
+  if players[ID].jumping then Exit;
+  players[ID].jumptime:=0.00001;
+  players[ID].jumping:=true;
+end;
+                      
+procedure TForm1.FormResize(Sender: TObject);
+begin
+  RearrangePanels;
+  Camera.SetFieldOfView(160,GLSceneviewer1.Width);
+end;
+
+procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  if not inMenu then Exit;
+  
+  if MainMenu.Visible then
+  MenuSelect2(MainMenu,X,Y);
+
+  if SettingsMenu.Visible then
+  MenuSelect2(SettingsMenu,X,Y);
+
+  if VideoMenu.Visible then
+  MenuSelect2(VideoMenu,X,Y);
+
+  if MPMenu.Visible then
+  MenuSelect2(MPMenu,X,Y);
+
+  if MPHostMenu.Visible then
+  MenuSelect2(MPHostMenu,X,Y);
+
+  if MPJoinMenu.Visible then
+  MenuSelect2(MPJoinMenu,X,Y);
+  
+  if ThrustDrag then
+  ThrustBarMouseDown(Sender,TMousebutton(mbLeft),Shift,X,Y);
+end;
+
+procedure TForm1.Respawn;
+var C3:Integer;
+begin
+  if GameEnded then begin
+    MessageOut('Game has already ended. Try "N" instead.','Respawn impossible');
+    Exit;
+  end;
+  Lost:=false;
+  Panel8.Visible:=false;
+  Panel9.Visible:=false;
+  ThrustBar.Position:=ThrustBar.Max;
+
+  if Form3.ClientSocket.Active then begin
+    Form3.RequestNewID(Form3.ClientSocket.Socket);
+  end else begin   
+    Players[MyID].Dead:=true;
+
+    MyID:=High(Players)+1;
+    Setlength(Players,MyID+1);
+    Setlength(playerarr,MyID+1);
+    for C3:=0 to High(playerarr) do
+    if not assigned(playerarr[C3]) then playerarr[C3]:=Form1.NewPlayer(C3);
+
+    Players[MyID].Dead:=false;
+
+
+    ChangeSpeedTo(StartSpeed);
+
+    Form1.GLHUDText1.Text:=
+    'Speed: '+Floattostr(Round(100*Players[MyID].Speed)/100)+' m/s';
+    Form1.GLCamera1.Up.SetVector(0,1,0);
+    Form1.GLCamera1.Position.X:=0;
+    Form1.GLCamera1.Position.Z:=0;
+    Form1.GLNavigator1.VirtualUp.SetPoint(0,1,0);
+    PosX:=0;
+    PosZ:=0;
+    Players[MyID].jumping:=false;
+    Players[MyID].X:=0;
+    Players[MyID].Y:=0;
+    Players[MyID].Z:=0;
+    Players[MyID].jumptime:=0.00001;
+    Players[MyID].LastX:=0;
+    Players[MyID].LastZ:=0;
+    Players[MyID].Ceilwalk:=false;
+    Form3.SendCeilWalk;
+    Reload;
+  end;
+end;
+
+procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin                          
+  if not inMenu then Exit;
+  MouseDownMenu(Sender,Button,Shift,X,Y);
+end;
+
+procedure TForm1.ThrustBarMouseDown(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: Integer);
+var m,b:real;
+begin                       
+  if not inMenu then Exit;
+  ThrustDrag:=true;
+  m:=-(ThrustBar.Max-ThrustBar.Min)/ThrustBar.Height;
+  b:=ThrustBar.Max-m*ThrustBar.Top;
+  ThrustBar.Position:=
+  Round(m*ScreenToClient(Mouse.CursorPos).Y+b);
+  if Round(m*Mouse.CursorPos.Y+b)>ThrustBar.Max then
+  ThrustBar.Position:=ThrustBar.Max
+  else if Round(m*Mouse.CursorPos.Y+b)<5 then  
+  ThrustBar.Position:=5;
+  Form4.UpdateSpeed;
+end;
+
+procedure TForm1.GLSceneViewer1MouseUp(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin                
+  if not inMenu then Exit;
+  ThrustDrag:=false;
+end;
+
+end.

+ 1 - 0
Unit1.vlb

@@ -0,0 +1 @@
+

+ 1 - 0
falling calculation.gcw

@@ -0,0 +1 @@
+<CasDocument DocVersion="4.0"><Entries ZoomFactor="1"><Entry Id="0" NumberField="Real" TrigUnit="Radians"><Type>Equation</Type><Sub Type="input" Width="511" Height="40"><Formula>SymbolicSolveRequest[List[Equal[Minus[Sum[Product[Negative[4.905],Exponent[t,2]],Product[v_0,t]],s_0],0]],List[t]]</Formula></Sub><Sub Type="output" Width="511" Height="68"><Formula>Solution[{t,ExpressionSetPoint[ExpressionWithCondition[Divide[Sum[Product[100,Sqrt[Sum[Exponent[v_0,2],Negative[Divide[Product[981,s_0],50]]]]],Product[100,v_0]],981],GreaterOrEqual[Sum[Negative[Divide[Product[981,s_0],50]],Exponent[v_0,2]],0]],False,ReservedReal]}]</Formula></Sub><Sub Type="output" Width="511" Height="68"><Formula>Solution[{t,ExpressionSetPoint[ExpressionWithCondition[Divide[Sum[Negative[Product[100,Sqrt[Sum[Exponent[v_0,2],Negative[Divide[Product[981,s_0],50]]]]]],Product[100,v_0]],981],GreaterOrEqual[Sum[Negative[Divide[Product[981,s_0],50]],Exponent[v_0,2]],0]],False,ReservedReal]}]</Formula></Sub><Templates><Template>1Eq.1Var.2Inst.Quad.QuadForm.6</Template><Template>1Eq.1Var.2Inst.Quad.CompSq.37</Template></Templates></Entry></Entries><Assignments /></CasDocument>

+ 1 - 0
jumping calculation.gcw

@@ -0,0 +1 @@
+<CasDocument DocVersion="4.0"><Entries ZoomFactor="1"><Entry Id="0" NumberField="Real" TrigUnit="Radians"><Type>Equation</Type><Sub Type="input" Width="928" Height="40"><Formula>SymbolicSolve[Equal[Sum[Sum[Product[Aggregate[Negative[4.905]],Exponent[t,2]],Product[v_0,t]],h_0],h_max],t]</Formula></Sub><Sub Type="output" Width="928" Height="68"><Formula>Solution[{t,ExpressionSetPoint[ExpressionWithCondition[Divide[Sum[Product[100,Sqrt[Sum[Exponent[v_0,2],Divide[Product[981,h_0],50],Negative[Divide[Product[981,h_max],50]]]]],Product[100,v_0]],981],GreaterOrEqual[Sum[Negative[Divide[Product[981,h_max],50]],Divide[Product[981,h_0],50],Exponent[v_0,2]],0]],False,ReservedReal]}]</Formula></Sub><Sub Type="output" Width="928" Height="68"><Formula>Solution[{t,ExpressionSetPoint[ExpressionWithCondition[Divide[Sum[Negative[Product[100,Sqrt[Sum[Exponent[v_0,2],Divide[Product[981,h_0],50],Negative[Divide[Product[981,h_max],50]]]]]],Product[100,v_0]],981],GreaterOrEqual[Sum[Negative[Divide[Product[981,h_max],50]],Divide[Product[981,h_0],50],Exponent[v_0,2]],0]],False,ReservedReal]}]</Formula></Sub><Templates><Template>1Eq.1Var.2Inst.Quad.QuadForm.6</Template><Template>1Eq.1Var.2Inst.Quad.CompSq.37</Template></Templates></Entry><Entry Id="1" NumberField="Real" TrigUnit="Radians"><Type>Worksheet</Type><Sub Type="input" Width="928" Height="68"><Formula>Minus[Divide[Sum[Product[100,Sqrt[Minus[Sum[Exponent[v_0,2],Divide[Product[981,h_0],50]],Divide[Product[981,h_max],50]]]],Product[100,v_0]],981],Divide[Sum[Product[Negative[100],Sqrt[Minus[Sum[Exponent[v_0,2],Divide[Product[981,h_0],50]],Divide[Product[981,h_max],50]]]],Product[100,v_0]],981]]</Formula></Sub><Sub Type="output" Width="928" Height="68"><Formula>Divide[Product[200,Sqrt[Sum[Exponent[v_0,2],Divide[Product[981,h_0],50],Negative[Divide[Product[981,h_max],50]]]]],981]</Formula></Sub></Entry></Entries><Assignments /></CasDocument>

+ 1 - 0
jumpstrength.gcw

@@ -0,0 +1 @@
+<CasDocument DocVersion="4.0"><Entries ZoomFactor="1"><Entry Id="0" NumberField="Real" TrigUnit="Radians"><Type>Equation</Type><Sub Type="input" Width="944" Height="40"><Formula>SymbolicSolve[List[Equal[Sum[Product[a,Exponent[15,2]],Product[b,15]],8.5],Equal[Sum[Product[a,Exponent[9,2]],Product[b,9]],7.2]]]</Formula></Sub><Sub Type="output" Width="944" Height="84"><Formula>Solution[{a,ExpressionSetPoint[-7/180,False,ReservedReal],-0.0388888888889},{b,ExpressionSetPoint[23/20,False,ReservedReal],1.15}]</Formula></Sub><Templates><Template>2Eq.2Var.2Inst.2Inst.Substitution.1</Template><Template>2Eq.2Var.2Inst.2Inst.Matrix.1</Template><Template>2Eq.2Var.2Inst.2Inst.Addition.3</Template></Templates></Entry></Entries><Assignments /></CasDocument>