Results 1 to 9 of 9

Thread: Little prob with my game (help needed)

  1. #1

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21

    Talking Little prob with my game (help needed)

    ok i have a little prob. i want to know how to use bitblt for my game.

    my game is a rts, a commandos style game, that u must infiltrate ennemy base with elite soldier. i want to use bitblt to load my picture for the color mask (i dont kknow how to use it and incorpor it into my game), work in frame per second, because now im using a timer (yep one timer for 6 soldier ), and finnaly i want to know how to delete a frame in the memory because my soldier have 6 frame per animation ( ex the firering animation while the soldier stand up have 6 frame per derection (8 direction)
    so in all it have 6 * 8 frame for firering) and putting all that in one bmp will be long but its is better?

    i have also my map editor for my game and i want to know how to unload picture from the memory when i dont looking a tile.


    there is my map editor coding:


    VB Code:
    1. Private Sub BoNextTile_Click()
    2. If TileView = NbOfTile Then TileView = 0
    3. TileView = TileView + 1
    4. TileSelectionSub
    5. End Sub
    6.  
    7. Private Sub BoPrevTile_Click()
    8. If TileView = 1 Then TileView = (NbOfTile + 1)
    9. TileView = TileView - 1
    10. TileSelectionSub
    11. End Sub
    12.  
    13. Private Sub TileSelectionSub()
    14. SelectionTile.Picture = LoadPicture(App.Path & "/tiles/" & TypeOfTerrain & "/" & TileView & ".bmp")
    15. LaTileInfo.Caption = "Type :" & TypeOfTerrain & " Tile #: " & TileView
    16. SelectionTile.Left = (PicSelectTile.Width - SelectionTile.Width) / 2
    17. SelectionTile.Top = (PicSelectTile.Height - SelectionTile.Height) / 2
    18. SelectiontileCase.Width = SelectionTile.Width
    19. SelectiontileCase.Height = SelectionTile.Height
    20. SelectiontileCase.Top = SelectionTile.Top
    21. SelectiontileCase.Left = SelectionTile.Left
    22.  
    23. End Sub
    24.  
    25. Private Sub Form_Activate()
    26.  
    27. If LoadingNew = True Then
    28. Largeur = Int(Map.Width / ImMapTile(0).Width)
    29. Hauteur = Int(Map.Height / ImMapTile(0).Height)
    30. RadarTile(0).Width = Int((ImMapTile(0).Width / Map.Width) * Radar.Width)
    31. RadarTile(0).Height = Int((ImMapTile(0).Height / Map.Height) * Radar.Height)
    32.  
    33. LoadingTest = Largeur * Hauteur
    34.  
    35. NbTile = 0
    36. For l = 0 To Largeur
    37.   For h = 0 To Hauteur
    38.      Randomize
    39.      GrassTile = Int((16 * Rnd) + 1)
    40.      NbTile = NbTile + 1
    41.      Load ImMapTile(NbTile)
    42.      Load RadarTile(NbTile)
    43.      RadarTile(NbTile).Visible = True
    44.      RadarTile(NbTile).Left = RadarTile(0).Width * l
    45.      RadarTile(NbTile).Top = RadarTile(0).Height * h
    46.      RadarTile(NbTile).BackColor = &H8000&
    47.      RadarTile(NbTile).BorderColor = RadarTile(NbTile).BackColor
    48.      'ImMapTile(NbTile).Picture = LoadPicture(App.Path & "/tiles/grass/" & GrassTile & ".bmp")
    49.      ImMapTile(NbTile).Visible = True
    50.      ImMapTile(NbTile).Left = ImMapTile(0).Width * l
    51.      ImMapTile(NbTile).Top = ImMapTile(0).Height * h
    52.      ImMapTile(NbTile).ZOrder 1
    53.      If loadingbar.Value > 99 Then GoTo Suite
    54.      loadingbar.Value = (NbTile / LoadingTest) * 100
    55. Suite:
    56.      Debug.Print NbTile
    57.   Next h
    58. Next l
    59. Radar.Visible = True
    60. Map.Visible = True
    61. TypeOfTerrain = "Grass"
    62. TileView = 1
    63. NbOfTile = 16
    64. SelectionTile.Picture = LoadPicture(App.Path & "/tiles/" & TypeOfTerrain & "/" & TileView & ".bmp")
    65.  
    66. RectRadar.Height = (MapView.Height * Radar.Height) / Map.Height
    67. RectRadar.Width = (MapView.Width * Radar.Width) / Map.Width
    68.  
    69. LoadingNew = False
    70.  
    71. loadingbar.Value = 0
    72. End If
    73.  
    74. End Sub
    75.  
    76. Private Sub Form_Load()
    77. CellLoad = 0
    78. LoadingNew = False
    79. ImMapTile(0).Picture = LoadPicture(App.Path & "/tiles/" & "grass" & "/" & "1.bmp")
    80. SelectTile.Width = ImMapTile(0).Width
    81. SelectTile.Height = ImMapTile(0).Height
    82. RectRadar.Top = 0
    83. RectRadar.Left = 0
    84.  
    85.  
    86.   For f = 0 To 3
    87.    
    88.  Select Case f
    89.   Case 0
    90.     Frame(0).Top = 1920
    91.   Case 1
    92.     Frame(1).Top = 2170
    93.   Case 2
    94.     Frame(2).Top = 2425
    95.   Case 3
    96.     Frame(3).Top = 2680
    97.   End Select
    98.   Frame(f).Height = 255
    99.  
    100.   Next f
    101.  
    102. End Sub
    103.  
    104. Private Sub Form_Unload(Cancel As Integer)
    105. For u = 1 To NbTile
    106. Unload ImMapTile(u)
    107. Next u
    108. End Sub
    109.  
    110. Private Sub Frame_Click(Index As Integer)
    111.  
    112.  
    113.   If Frame(Index).Height = 1815 Then
    114.   Frame(Index).Height = 255
    115.  
    116.   For f = 0 To 3
    117.   Frame(f).Visible = True
    118.   Next f
    119.  
    120.   Select Case Index
    121.   Case 0
    122.     Frame(0).Top = 1920
    123.   Case 1
    124.     Frame(1).Top = 2170
    125.   Case 2
    126.     Frame(2).Top = 2425
    127.   Case 3
    128.     Frame(3).Top = 2680
    129.   End Select
    130.   PicMenu(Index).Visible = False
    131.   Exit Sub
    132.  
    133.   End If
    134.  
    135.   If Frame(Index).Height = 255 And Frame(Index).Width = 2295 Then
    136.   Frame(Index).Height = 1815
    137.   Frame(Index).Top = 1920
    138.   PicMenu(Index).Visible = True
    139.  
    140.    
    141.   Select Case Index
    142.   Case 0
    143.     MenuSelect = "Terrain"
    144.   Case 1
    145.     MenuSelect = "Units"
    146.   Case 2
    147.     MenuSelect = "Buildings"
    148.   Case 3
    149.     MenuSelect = "Cell"
    150.   End Select
    151.  
    152.     For f = 0 To 3
    153.       Frame(f).Visible = False
    154.     Next f
    155.     Frame(Index).Visible = True
    156.   End If
    157. Debug.Print MenuSelect
    158.  
    159. End Sub
    160.  
    161.  
    162. Private Sub Frame_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    163. Select Case Index
    164.   Case 0
    165.   Frame(1).ForeColor = &H80000012
    166.   Frame(2).ForeColor = &H80000012
    167.   Frame(3).ForeColor = &H80000012
    168.   Frame(0).ForeColor = &H404040
    169.  
    170.   Case 1
    171.   Frame(0).ForeColor = &H80000012
    172.   Frame(2).ForeColor = &H80000012
    173.   Frame(3).ForeColor = &H80000012
    174.   Frame(1).ForeColor = &H404040
    175.  
    176.   Case 2
    177.   Frame(1).ForeColor = &H80000012
    178.   Frame(0).ForeColor = &H80000012
    179.   Frame(3).ForeColor = &H80000012
    180.   Frame(2).ForeColor = &H404040
    181.  
    182.   Case 3
    183.     Frame(1).ForeColor = &H80000012
    184.   Frame(2).ForeColor = &H80000012
    185.   Frame(0).ForeColor = &H80000012
    186.   Frame(3).ForeColor = &H404040
    187.  
    188.  
    189. End Select
    190.  
    191.  
    192. End Sub
    193.  
    194. Private Sub ImMapTile_Click(Index As Integer)
    195. If MenuSelect = "Terrain" Then
    196. ImMapTile(Index).Picture = ImSelectedTile.Picture
    197. If LaSelectedTileType.Caption = "Grass" Then
    198.   RadarTile(Index).BackColor = &H8000&
    199.   RadarTile(Index).BorderColor = &H8000&
    200. ElseIf LaSelectedTileType.Caption = "Water" Then
    201.   RadarTile(Index).BackColor = &HC0C000
    202.   RadarTile(Index).BorderColor = &HC0C000
    203.   End If
    204. End If
    205.  
    206. If MenuSelect = "Cell" Then
    207. If CellWay(1).Value = True Then
    208.   CellLoad = CellLoad + 1
    209.   Load ImMapCelltag(CellLoad)
    210.   ImMapCelltag(CellLoad).Visible = True
    211.   ImMapCelltag(CellLoad).Top = ImMapTile(Index).Top
    212.   ImMapCelltag(CellLoad).Left = ImMapTile(Index).Left
    213.   ImMapCelltag(CellLoad).ZOrder 0
    214.   ImMapCelltag(CellLoad).Enabled = False
    215. End If
    216. If CellWay(0).Value = True Then
    217.   WayLoad = WayLoad + 1
    218.   Load ImMapWaypoint(WayLoad)
    219.   ImMapWaypoint(WayLoad).Visible = True
    220.   ImMapWaypoint(WayLoad).Top = ImMapTile(Index).Top
    221.   ImMapWaypoint(WayLoad).Left = ImMapTile(Index).Left
    222.   ImMapWaypoint(WayLoad).ZOrder 0
    223.   ImMapWaypoint(WayLoad).Enabled = False
    224. End If
    225. End If
    226.  
    227.  
    228. End Sub
    229.  
    230. Private Sub ImMapTile_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    231. SelectTile.Top = ImMapTile(Index).Top
    232. SelectTile.Left = ImMapTile(Index).Left
    233. End Sub
    234.  
    235. Private Sub MeFiExit_Click()
    236. End
    237. End Sub
    238.  
    239. Private Sub MeFiNew_Click()
    240. Load FoNew
    241. FoNew.Visible = True
    242. End Sub
    243.  
    244. Private Sub Option1_Click(Index As Integer)
    245. Debug.Print Index
    246. Select Case Index
    247.   Case 0
    248.     TypeOfTerrain = "Grass"
    249.     NbOfTile = 16
    250.   Case 1
    251.   Case 2
    252.     TypeOfTerrain = "Rock"
    253.     NbOfTile = 1
    254.   Case 3
    255.   Case 4
    256.   Case 5
    257.     TypeOfTerrain = "Water"
    258.     NbOfTile = 1
    259. End Select
    260. TileView = 1
    261. LaTileInfo.Caption = "Type :" & TypeOfTerrain & " Tile #: " & TileView
    262. SelectionTile.Picture = LoadPicture(App.Path & "/tiles/" & TypeOfTerrain & "/" & TileView & ".bmp")
    263. SelectionTile.Left = (PicSelectTile.Width - SelectionTile.Width) / 2
    264. SelectionTile.Top = (PicSelectTile.Height - SelectionTile.Height) / 2
    265. SelectiontileCase.Width = SelectionTile.Width
    266. SelectiontileCase.Height = SelectionTile.Height
    267. SelectiontileCase.Top = SelectionTile.Top
    268. SelectiontileCase.Left = SelectionTile.Left
    269. End Sub
    270.  
    271. Private Sub Radar_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    272. On Error Resume Next
    273.  
    274. Select Case Button
    275.  
    276.   Case 1
    277.     RectRadar.Top = Y - (RectRadar.Height / 2)
    278.     RectRadar.Left = X - (RectRadar.Width / 2)
    279.    
    280.     If (RectRadar.Left + RectRadar.Width) > Radar.Width Then
    281.     RectRadar.Left = Radar.Width - RectRadar.Width
    282.     End If
    283.  
    284.     If RectRadar.Left < 0 Then
    285.     RectRadar.Left = 0
    286.     End If
    287.  
    288.     If (RectRadar.Top + RectRadar.Height) > Radar.Height Then
    289.     RectRadar.Top = Radar.Height - RectRadar.Height
    290.     End If
    291.  
    292.     If RectRadar.Top < 0 Then
    293.     RectRadar.Top = 0
    294.     End If
    295.  
    296.     Map.Left = -((RectRadar.Left * Map.Width) / Radar.Width)
    297.     Map.Top = -((RectRadar.Top * Map.Height) / Radar.Height)
    298.  
    299. End Select
    300.  
    301. Map.SetFocus
    302.  
    303. End Sub
    304.  
    305. Private Sub SelectionTile_Click()
    306. LaSelectedTileType.Caption = TypeOfTerrain
    307. LaSelectedTileNb.Caption = TileView
    308. ImSelectedTile.Picture = SelectionTile.Picture
    309. 'LaTileSelect.Caption = "Type :" & TypeOfTerrain & " Tile #: " & TileView
    310. End Sub

    i have a module that contain all my variable

    VB Code:
    1. Public Largeur As Long
    2. Public Hauteur As Long
    3. Public NbTile As Long
    4. Public GrassTile As Integer
    5. Public TypeOfTerrain As String
    6. Public TileView As Integer
    7. Public IsMouse1Down As Boolean
    8. Public NbOfTile As Integer
    9. Public MiniMapTileH As Long
    10. Public MiniMapTileL As Long
    11. Public TileIndex As Long
    12. Public LoadingNew As Boolean
    13. Public LoadingTest As Long
    14. Public AlreadyMapped As Boolean
    15. Public MenuSelect As String
    16. Public Choix As Long
    17. Public CellLoad As Long
    18. Public WayLoad As Long
    Last edited by TheKGBspy; Jan 10th, 2002 at 10:11 AM.

  2. #2

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21

    Exclamation i forgot to put the other form code

    VB Code:
    1. Private Sub BoCancel_Click()
    2. Unload Me
    3. End Sub
    4.  
    5. Private Sub BoOK_Click()
    6. If AlreadyMapped = True Then
    7. FoMain.Radar.Visible = False
    8. FoMain.Map.Visible = False
    9. For u = 1 To NbTile
    10. Unload FoMain.RadarTile(u)
    11. Unload FoMain.ImMapTile(u)
    12. Next u
    13. DoEvents
    14. End If
    15.  
    16. If TxtHeight.Text = "" Or TxtWidth.Text = "" Then
    17. MsgBox ("Il manque des informations a quelque part")
    18. Exit Sub
    19. Else
    20. FoMain.Map.Height = FoMain.ImMapTile(0).Height * TxtHeight.Text
    21. FoMain.Map.Width = FoMain.ImMapTile(0).Width * TxtWidth.Text
    22. LoadingNew = True
    23. AlreadyMapped = True
    24. Unload Me
    25. FoMain.SetFocus
    26. End If
    27. End Sub
    Last edited by TheKGBspy; Jan 10th, 2002 at 10:12 AM.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    arrrgh, timers
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Junior Member
    Join Date
    Dec 2001
    Posts
    23

    MY TUT!

    Or you can always look at my bitblt tutorial www.geocities.com/mman76dev

  5. #5

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21
    ok ill explain more how my game work. i have 6 soldier now, they are walking, crawling, firering...

    and there is what the timer have to make them move or firering....

    VB Code:
    1. Private Sub Timer1_Timer()
    2. On Error Resume Next
    3.  
    4. Timer1.Interval = speed
    5.  
    6.  
    7. For k = 0 To 5
    8.  
    9. If Image1(k).Tag = "On" Then
    10.  
    11. If IsFirering(k + 1) <> True Then
    12.  
    13. ConscAnim(k + 1) = ConscAnim(k + 1) + 1
    14. If ConscAnim(k + 1) = 7 Then
    15. ConscAnim(k + 1) = 1
    16. End If
    17.  
    18. Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ConscAnim(k + 1) & ".gif")
    19. Image1(k).Left = Image1(k).Left + Hori(k + 1)
    20. Image1(k).Top = Image1(k).Top + Verti(k + 1)
    21.  
    22. If Angle(k + 1) = "n" And (Image1(k).Top < ConscY(k + 1) - 600) Then
    23. Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ".gif")
    24. ConscAnim1 = 0
    25. Image1(k).Tag = "Off"
    26. End If
    27.  
    28. If Angle(k + 1) = "e" And (Image1(k).Left > ConscX(k + 1) - (Image1(k).Width / 2)) Then
    29. Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ".gif")
    30. ConscAnim1 = 0
    31. Image1(k).Tag = "Off"
    32. End If
    33.  
    34. If Angle(k + 1) = "w" And (Image1(k).Left < ConscX(k + 1) - (Image1(k).Width / 2)) Then
    35. Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ".gif")
    36. ConscAnim1 = 0
    37. Image1(k).Tag = "Off"
    38. End If
    39.  
    40. If Angle(k + 1) = "s" And (Image1(k).Top > ConscY(k + 1) - 600) Then
    41. Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ".gif")
    42. ConscAnim1 = 0
    43. Image1(k).Tag = "Off"
    44. End If
    45.  
    46. If Angle(k + 1) = "ne" And Image1(k).Left > (ConscX(k + 1) - (Image1(k).Width / 2)) Then
    47. Angle(k + 1) = "n"
    48. Hori(k + 1) = "0"
    49. Verti(k + 1) = "-60"
    50. End If
    51.  
    52. If Angle(k + 1) = "ne" And Image1(k).Top < (ConscY(k + 1) - 600) Then
    53. Angle(k + 1) = "e"
    54. Hori(k + 1) = "60"
    55. Verti(k + 1) = "0"
    56. End If
    57.  
    58. If Angle(k + 1) = "nw" And Image1(k).Left < (ConscX(k + 1) - (Image1(k).Width / 2)) Then
    59. Angle(k + 1) = "n"
    60. Hori(k + 1) = "0"
    61. Verti(k + 1) = "-60"
    62. End If
    63.  
    64. If Angle(k + 1) = "nw" And Image1(k).Top < (ConscY(k + 1) - 600) Then
    65. Angle(k + 1) = "w"
    66. Hori(k + 1) = "-60"
    67. Verti(k + 1) = "0"
    68. End If
    69.  
    70. If Angle(k + 1) = "se" And Image1(k).Left > (ConscX(k + 1) - (Image1(k).Width / 2)) Then
    71. Angle(k + 1) = "s"
    72. Hori(k + 1) = "0"
    73. Verti(k + 1) = "60"
    74. End If
    75.  
    76. If Angle(k + 1) = "se" And Image1(k).Top > (ConscY(k + 1) - 600) Then
    77. Angle(k + 1) = "e"
    78. Hori(k + 1) = "60"
    79. Verti(k + 1) = "0"
    80. End If
    81.  
    82. If Angle(k + 1) = "sw" And Image1(k).Left < (ConscX(k + 1) - (Image1(k).Width / 2)) Then
    83. Angle(k + 1) = "s"
    84. Hori(k + 1) = "0"
    85. Verti(k + 1) = "60"
    86. End If
    87.  
    88. If Angle(k + 1) = "sw" And Image1(k).Top > (ConscY(k + 1) - 600) Then
    89. Angle(k + 1) = "w"
    90. Hori(k + 1) = "-60"
    91. Verti(k + 1) = "0"
    92. End If
    93.  
    94. Shape1(k).Top = (Image1(k).Top * Picture3.Height) / Picture2.Height
    95. Shape1(k).Left = (Image1(k).Left * Picture3.Width) / Picture2.Width
    96.  
    97. ElseIf IsFirering(k + 1) = True Then
    98.  
    99.  ConscAnim(k + 1) = ConscAnim(k + 1) + 1
    100.  Image1(k).Picture = LoadPicture(App.Path + "\fire" & MarcheRamp(k + 1) & Angle(k + 1) & ConscAnim(k + 1) & ".gif")
    101.  
    102.  
    103. Select Case ConscAnim(k + 1)
    104.  
    105.   Case 1
    106.     Randomize
    107.     son = Int((4 * Rnd) + 1)
    108.     FoHidMusic.MediaPlayer1.Open (App.Path + "\fire-" & son & ".wav")
    109.  
    110.   Case 7
    111.     Image1(k).Picture = LoadPicture(App.Path + "\" & MarcheRamp(k + 1) & Angle(k + 1) & ".gif")
    112.  
    113.   Case 15
    114.     ConscAnim(k + 1) = 0
    115. End Select
    116.  
    117. End If
    118.  
    119. End If ' fin conscript 1
    120.  
    121.  
    122. Next k
    123.  
    124.  
    125. 'LaImX.Caption = "Im. X:" & Image1(PicIndex).Left + (Image1(PicIndex).Width / 2)
    126. 'LaImY.Caption = "Im. Y:" & Image1(PicIndex).Top + 600
    127.  
    128. 'Energiebar
    129.  
    130.  
    131.  
    132. End Sub

    just tell me if there is a better way, and how to put the dc thing in my timer becauase its a little laggy when the 6 soldiers run all togheter!!

    and this my sub for detecting the angle and direction on the soldier must take:

    VB Code:
    1. Public Sub DetectAngle()
    2.  
    3.  
    4. For I = 0 To 5
    5.  
    6.   If Image4(I).Tag = "Off" Then
    7.     GoTo Prochain
    8. Else
    9. If x2 < Image1(I).Left And y2 < (Image1(I).Top + Image1(I).Height) And y2 > Image1(I).Top Then
    10. Angle(I + 1) = "w"
    11. Hori(I + 1) = "-60"
    12. Verti(I + 1) = "0"
    13. End If
    14.  
    15. If x2 > Image1(I).Left And y2 < (Image1(I).Top + Image1(I).Height) And y2 > Image1(I).Top Then
    16. Angle(I + 1) = "e"
    17. Hori(I + 1) = "60"
    18. Verti(I + 1) = "0"
    19. End If
    20.  
    21. If y2 < Image1(I).Top And x2 > Image1(I).Left And x2 < (Image1(I).Left + Image1(I).Width) Then
    22. Angle(I + 1) = "n"
    23. Verti(I + 1) = "-60"
    24. Hori(I + 1) = "0"
    25. End If
    26.  
    27. If y2 > Image1(I).Top And x2 > Image1(I).Left And x2 < (Image1(I).Left + Image1(I).Width) Then
    28. Angle(I + 1) = "s"
    29. Verti(I + 1) = "60"
    30. Hori(I + 1) = "0"
    31. End If
    32.  
    33. If y2 < Image1(I).Top And x2 > (Image1(I).Left + Image1(I).Width) Then
    34. Angle(I + 1) = "ne"
    35. Verti(I + 1) = "-30"
    36. Hori(I + 1) = "30"
    37. End If
    38.  
    39. If y2 > (Image1(I).Top + Image1(I).Height) And x2 > (Image1(I).Left + Image1(I).Width) Then
    40. Angle(I + 1) = "se"
    41. Verti(I + 1) = "30"
    42. Hori(I + 1) = "30"
    43. End If
    44.  
    45. If x2 < Image1(I).Left And y2 < Image1(I).Top Then
    46. Angle(I + 1) = "nw"
    47. Hori(I + 1) = "-30"
    48. Verti(I + 1) = "-30"
    49. End If
    50.  
    51. If x2 < Image1(I).Left And y2 > (Image1(I).Top + Image1(I).Height) Then
    52. Angle(I + 1) = "sw"
    53. Hori(I + 1) = "-30"
    54. Verti(I + 1) = "30"
    55. End If
    56.  
    57. ConscX(I + 1) = x2
    58. ConscY(I + 1) = y2
    59.  
    60.  
    61. Image1(I).Tag = "On"
    62.  
    63. Debug.Print Angle(I + 1), Hori(I + 1), Verti(I + 1), Image1(I).Tag, Image4(I).Tag
    64.  
    65.  
    66. End If
    67.  
    68. Prochain:
    69.  
    70. Next I
    71.  
    72.  
    73.  
    74. End Sub

    how my game work: you select the soldier, click on the map and the soldier move where you have order to it.

    it is the best way to do not put timer and put a fps system? and for my lagging prob, how can i put my image in memory? Using dc thing?
    Last edited by TheKGBspy; Jan 10th, 2002 at 10:13 AM.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    please, use [/Highlight] and [Highlight=VB] when writing code.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21

    Talking ok

    all done!! i edit all my post. and tanx a i was wondering wath was the command for make vb code appear in vb code color.. so can you help me now?

  8. #8

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21

    Post

    littile pic of my game. for the graphic they are not final!!! i took them only for code my game first and after ill make my own graphic, so if i took graphic of game, its only for alpha testing purpose!
    Attached Images Attached Images  

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Without looking at your code I'd say:
    If you're only drawing the tiles you see it is no problem. Just add a boolean variable to each tile. Set all to false before you draw. When you draw a tile, you also set it's variable to true. After you've draw, you look which tiles still have false and unload them if ot already happened. This also means that they need to be reloaded if they need to be drawn again, so you must catch that possibility. I don't have code, I can't do VB.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width