Rev 64 | Rev 70 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 64 | Rev 65 | ||
---|---|---|---|
Line 1912... | Line 1912... | ||
1912 | {$ENDREGION} |
1912 | {$ENDREGION} |
1913 | end; |
1913 | end; |
1914 | FLevelDataAlreadyLoaded := true; // nicht nochmal NewLevel() aufrufen. Erst wieder wenn man gewonnen hat. |
1914 | FLevelDataAlreadyLoaded := true; // nicht nochmal NewLevel() aufrufen. Erst wieder wenn man gewonnen hat. |
1915 | end; |
1915 | end; |
1916 | 1916 | ||
- | 1917 | var |
|
- | 1918 | TitleWasPressed: TDxInputState = isButton32; |
|
- | 1919 | ||
1917 | procedure TMainForm.SceneTitle; |
1920 | procedure TMainForm.SceneTitle; |
1918 | var |
1921 | var |
1919 | Logo: TPictureCollectionItem; |
1922 | Logo: TPictureCollectionItem; |
- | 1923 | colo1, colo2: TColor; |
|
1920 | begin |
1924 | begin |
1921 | DXDraw.Surface.Fill(0); |
1925 | DXDraw.Surface.Fill(0); |
1922 | Logo := GetSpriteGraphic(smgLogo); |
1926 | Logo := GetSpriteGraphic(smgLogo); |
1923 | {Logo.DrawWaveX(DXDraw.Surface, (dxdraw.surfaceWidth div 2) - 181, 65, Logo.Width, Logo.Height, 0, |
1927 | {Logo.DrawWaveX(DXDraw.Surface, (dxdraw.surfaceWidth div 2) - 181, 65, Logo.Width, Logo.Height, 0, |
1924 | Trunc(16 - Cos256(FBlink div 60) * 16), 32, -FBlink div 5);} |
1928 | Trunc(16 - Cos256(FBlink div 60) * 16), 32, -FBlink div 5);} |
1925 | Logo.DrawWaveX(DXDraw.Surface, trunc((dxdraw.surfaceWidth / 2) - (Logo.Width / 2)), 65, Logo.Width, Logo.Height, 0, |
1929 | Logo.DrawWaveX(DXDraw.Surface, trunc((dxdraw.surfaceWidth / 2) - (Logo.Width / 2)), 65, Logo.Width, Logo.Height, 0, |
1926 | 2, 80, Fangle * 4); |
1930 | 2, 80, Fangle * 4); |
1927 | inc(Fangle); |
1931 | inc(Fangle); |
1928 | 1932 | ||
- | 1933 | if FGameMode = gmUnknown then FGameMode := gmLevels; |
|
- | 1934 | ||
1929 | if (isDown in MainForm.DXInput.States) and (FGameMode=gmLevels) then FGameMode := gmRandom; |
1935 | if (isUp in MainForm.DXInput.States) then TitleWasPressed := isUp; |
- | 1936 | if (TitleWasPressed=isUp) and not (isUp in MainForm.DXInput.States) then |
|
- | 1937 | begin |
|
- | 1938 | TitleWasPressed := isButton32; |
|
- | 1939 | if (Ord(FGameMode) <> 1) then |
|
- | 1940 | FGameMode := TGameMode(Ord(FGameMode)-1); |
|
- | 1941 | end; |
|
- | 1942 | ||
- | 1943 | // TODO: Wenn man schnell die Taste drückt, dann kommt es manchmal nicht an! |
|
1930 | if ((isUp in MainForm.DXInput.States) and (FGameMode=gmRandom)) or (FGameMode=gmUnknown) then FGameMode := gmLevels; |
1944 | if (isDown in MainForm.DXInput.States) then TitleWasPressed := isDown; |
- | 1945 | if (TitleWasPressed=isDown) and not (isDown in MainForm.DXInput.States) then |
|
- | 1946 | begin |
|
- | 1947 | TitleWasPressed := isButton32; |
|
- | 1948 | if (FGameMode <> High(TGameMode)) then |
|
- | 1949 | FGameMode := TGameMode(Ord(FGameMode)+1); |
|
- | 1950 | end; |
|
- | 1951 | ||
1931 | DXDraw.Surface.Canvas.Brush.Style := bsClear; |
1952 | DXDraw.Surface.Canvas.Brush.Style := bsClear; |
1932 | DXDraw.Surface.Canvas.Font.Size := 30; |
1953 | DXDraw.Surface.Canvas.Font.Size := 30; |
- | 1954 | ||
- | 1955 | {$REGION 'Menu point: Normal Level'} |
|
1933 | if FGameMode = gmLevels then |
1956 | if FGameMode = gmLevels then |
1934 | begin |
1957 | begin |
- | 1958 | colo1 := clMaroon; |
|
- | 1959 | colo2 := clRed; |
|
- | 1960 | end |
|
- | 1961 | else |
|
- | 1962 | begin |
|
- | 1963 | colo1 := clOlive; |
|
- | 1964 | colo2 := clYellow; |
|
- | 1965 | end; |
|
1935 | DXDraw.Surface.Canvas.Font.Color := clMaroon; |
1966 | DXDraw.Surface.Canvas.Font.Color := colo1; |
1936 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-52, 'Normales Spiel'); |
1967 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-52, 'Normales Spiel'); |
- | 1968 | if FGameMode = gmLevels then |
|
1937 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-187, (dxdraw.surfaceheight div 2)-52, '>'); |
1969 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2)-52, '>'); |
1938 | DXDraw.Surface.Canvas.Font.Color := clRed; |
1970 | DXDraw.Surface.Canvas.Font.Color := colo2; |
1939 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2)-50, 'Normales Spiel'); |
1971 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2)-50, 'Normales Spiel'); |
- | 1972 | if FGameMode = gmLevels then |
|
1940 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2)-50, '>'); |
1973 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2)-50, '>'); |
- | 1974 | {$ENDREGION} |
|
- | 1975 | ||
1941 | DXDraw.Surface.Canvas.Font.Color := clOlive; |
1976 | {$REGION 'Menu point: Random Level'} |
1942 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-2, 'Zufallslevel'); |
1977 | if FGameMode = gmRandom then |
- | 1978 | begin |
|
1943 | DXDraw.Surface.Canvas.Font.Color := clYellow; |
1979 | colo1 := clMaroon; |
1944 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2), 'Zufallslevel'); |
1980 | colo2 := clRed; |
1945 | end |
1981 | end |
1946 | else |
1982 | else |
1947 | begin |
1983 | begin |
1948 | DXDraw.Surface.Canvas.Font.Color := clOlive; |
1984 | colo1 := clOlive; |
1949 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-52, 'Normales Spiel'); |
- | |
1950 | DXDraw.Surface.Canvas.Font.Color := clYellow; |
1985 | colo2 := clYellow; |
1951 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2)-50, 'Normales Spiel'); |
- | |
- | 1986 | end; |
|
1952 | DXDraw.Surface.Canvas.Font.Color := clMaroon; |
1987 | DXDraw.Surface.Canvas.Font.Color := colo1; |
1953 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-2, 'Zufallslevel'); |
1988 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)-2, 'Zufallslevel'); |
- | 1989 | if FGameMode = gmRandom then |
|
1954 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-187, (dxdraw.surfaceheight div 2)-2, '>'); |
1990 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-187, (dxdraw.surfaceheight div 2)-2, '>'); |
1955 | DXDraw.Surface.Canvas.Font.Color := clRed; |
1991 | DXDraw.Surface.Canvas.Font.Color := colo2; |
1956 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2), 'Zufallslevel'); |
1992 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2), 'Zufallslevel'); |
- | 1993 | if FGameMode = gmRandom then |
|
1957 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2), '>'); |
1994 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2), '>'); |
- | 1995 | {$ENDREGION} |
|
- | 1996 | ||
- | 1997 | {$REGION 'Menu point: Level Editor'} |
|
- | 1998 | if FGameMode = gmEditor then |
|
- | 1999 | begin |
|
- | 2000 | colo1 := clMaroon; |
|
- | 2001 | colo2 := clRed; |
|
- | 2002 | end |
|
- | 2003 | else |
|
- | 2004 | begin |
|
- | 2005 | colo1 := clOlive; |
|
- | 2006 | colo2 := clYellow; |
|
1958 | end; |
2007 | end; |
- | 2008 | DXDraw.Surface.Canvas.Font.Color := colo1; |
|
- | 2009 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-152, (dxdraw.surfaceheight div 2)+48, 'Level-Editor'); |
|
- | 2010 | if FGameMode = gmEditor then |
|
- | 2011 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2)+48, '>'); |
|
- | 2012 | DXDraw.Surface.Canvas.Font.Color := colo2; |
|
- | 2013 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-150, (dxdraw.surfaceheight div 2)+50, 'Level-Editor'); |
|
- | 2014 | if FGameMode = gmEditor then |
|
- | 2015 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-185, (dxdraw.surfaceheight div 2)+50, '>'); |
|
- | 2016 | {$ENDREGION} |
|
- | 2017 | ||
1959 | { if (FBlink div 300) mod 2=0 then |
2018 | { if (FBlink div 300) mod 2=0 then |
1960 | begin |
2019 | begin |
1961 | DXDraw.Surface.Canvas.Font.Color := clGreen; |
2020 | DXDraw.Surface.Canvas.Font.Color := clGreen; |
1962 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-187, dxdraw.surfaceheight-117, 'Weiter mit Leertaste'); |
2021 | DXDraw.Surface.Canvas.Textout((dxdraw.surfaceWidth div 2)-187, dxdraw.surfaceheight-117, 'Weiter mit Leertaste'); |
1963 | DXDraw.Surface.Canvas.Font.Color := clLime; |
2022 | DXDraw.Surface.Canvas.Font.Color := clLime; |
Line 1968... | Line 2027... | ||
1968 | 2027 | ||
1969 | // Weiter mit Leertaste oder Enter |
2028 | // Weiter mit Leertaste oder Enter |
1970 | if (isButton1 in DXInput.States) or (isButton2 in DXInput.States) then |
2029 | if (isButton1 in DXInput.States) or (isButton2 in DXInput.States) then |
1971 | begin |
2030 | begin |
1972 | FLevel := 1; |
2031 | FLevel := 1; |
- | 2032 | if FGameMode = gmEditor then |
|
- | 2033 | begin |
|
- | 2034 | ShellExecute(0, 'open', PChar(OwnDirectory+'LevEdit.exe'), '', PChar(OwnDirectory), SW_NORMAL); |
|
- | 2035 | Close; |
|
- | 2036 | exit; |
|
- | 2037 | end; |
|
1973 | if ((FGameMode=gmLevels) and not GetLevelFileName(FLevel,false).found) or ((FGameMode=gmRandom) and (FLevel > 20)) then |
2038 | if ((FGameMode=gmLevels) and not GetLevelFileName(FLevel,false).found) or |
- | 2039 | ((FGameMode=gmRandom) and (FLevel > MaxPossibleLevels)) then |
|
1974 | begin |
2040 | begin |
1975 | //PlaySound('Frage', False); |
2041 | //PlaySound('Frage', False); |
1976 | exit; |
2042 | exit; |
1977 | end; |
2043 | end; |
1978 | PlaySound(smsSceneMov, False); |
2044 | PlaySound(smsSceneMov, False); |