Attribute VB_Name = "modPlayerFunc" Option Explicit Type Player Name As String vbColor As Long iColor As Integer iType As Integer sColor As String 'sType As String Score As Integer End Type Public Sub GenerePlayer() Nb_Player = 2 Nb_Player_Old = 2 CurPlayer = 1 'ReDim Preserve PlayerDefs(Nb_Player) As Player PlayerDefs(1).Name = "Human1" PlayerDefs(1).sColor = "Black" PlayerDefs(1).iColor = 0 'PlayerDefs(1).sType = "Human" PlayerDefs(1).iType = 0 PlayerDefs(1).Score = 0 PlayerDefs(1).vbColor = vbBlack PlayerDefs(2).Name = "Zaky" PlayerDefs(2).sColor = "Blue" PlayerDefs(2).iColor = 1 'PlayerDefs(2).sType = "Human" PlayerDefs(2).iType = 1 PlayerDefs(2).Score = 0 PlayerDefs(2).vbColor = vbBlue PlayerDefs(3).Name = "Cop Yutor" PlayerDefs(3).sColor = "Green" PlayerDefs(3).iColor = 2 'PlayerDefs(3).sType = "Human" PlayerDefs(3).iType = 1 PlayerDefs(3).Score = 0 PlayerDefs(3).vbColor = vbGreen PlayerDefs(4).Name = "Daemon" PlayerDefs(4).sColor = "Red" PlayerDefs(4).iColor = 3 'PlayerDefs(4).sType = "Human" PlayerDefs(4).iType = 1 PlayerDefs(4).Score = 0 PlayerDefs(4).vbColor = vbRed End Sub Public Sub ResetScore() Dim I As Integer For I = 1 To Nb_Player PlayerDefs(I).Score = 0 Next End Sub Public Function PlayerPix() As String Dim Letter As String Dim Final As String Letter = Mid(PlayerDefs(CurPlayer).Name, 1, 1) Final = SMKIMAGEPATH & "cc\" & Letter & "-" & PlayerDefs(CurPlayer).sColor & ".jpg" PlayerPix = Final End Function Public Sub FillCenter(Index As Integer) 'If PlayerDefs(CurPlayer).usepix Then 'sht_Game1.img_game(index).Picture = LoadPicture(PlayerPix()) 'Else sht_Game1.img_game(Index).Picture = Nothing sht_Game1.img_game(Index).Cls sht_Game1.img_game(Index).FontName = "verdana" sht_Game1.img_game(Index).FontSize = 22 sht_Game1.img_game(Index).ForeColor = PlayerDefs(CurPlayer).vbColor sht_Game1.img_game(Index).FontBold = True ' bug 480 ! Call TextOut(sht_Game1.img_game(Index).hdc, 5, -1, Mid(PlayerDefs(CurPlayer).Name, 1, 1), 1) sht_Game1.img_game(Index).Refresh 'End If End Sub Public Function IsAComputer() As Boolean Dim Alors As Boolean If PlayerDefs(CurPlayer).iType = iComputer Then Alors = True End If IsAComputer = Alors End Function Public Function IsAHuman() As Boolean Dim Alors As Boolean If PlayerDefs(CurPlayer).iType = iHuman Then Alors = True End If IsAHuman = Alors End Function Public Function RandomizeSelectioningPiece() Dim Index As Integer Dim TempIndex As Integer Dim I As Integer Dim RandPos As Position Dim Fuck As Integer Dim Count As Integer Dim x, y As Boolean TempIndex = SquareCanBeClose If TempIndex = 0 Then Count = 0 Do Do Index = Entier(1, (((My_Width_X + 1) * My_Height_Y) + ((My_Height_Y + 1) * My_Width_X))) CalculPosition TabPiece(Index).Index, RandPos y = MoveIsPossible(RandPos, Fuck) Loop While y = False Count = Count + 1 x = CouldBeClose(RandPos) Loop While ((x = True) And Count <> 25) Else For I = 1 To (((My_Width_X + 1) * My_Height_Y) + ((My_Height_Y + 1) * My_Width_X)) If TabPiece(I).Index = TempIndex Then Index = I End If Next End If RandomizeSelectioningPiece = Index End Function