Hello everyone,
Even though I'm 99% sure that my current code is wrong, I'll post it here anyways:
Public Sub GameLoop()
Dim temp As DarkGDK.Basic2D.AnimatedSprite
DarkGDK.IO.File.SetCurrentDirectory("C:\My Dropbox\Pokemon Echoes\Engine\Anasky\Editors\GDKTest\MapEditor\bin\Debug\Tiles\")
temp = New DarkGDK.Basic2D.AnimatedSprite("Tiles0.PNG", 32, 32)
'temp = New DarkGDK.Basic2D.AnimatedSprite("Tiles0.png", temp.ScaleX, temp.ScaleY)
Dim CurTile As Integer
Dim X As Integer
Dim Y As Integer
Dim Tile_T2 As Object = INI.ReadMap("C:\My Dropbox\Pokemon Echoes\Engine\Anasky\Editors\GDKTest\MapEditor\bin\Debug\Files\Maps\1", "Tiles", "Ground")
Dim Tile_T(26, 26) As String
For X = 0 To 26
For Y = 0 To 26
Do While Tile_T2.ToString.Substring(CurTile, 1) <> "."
Tile_T(X, Y) = Tile_T(X, Y) & Tile_T2.ToString.Substring(CurTile, 1)
CurTile += 1
Loop
CurTile += 1
Next
Next
For X = 0 To 26
For Y = 0 To 26
Dim Tile() As String = Split(Tile_T(X, Y), ":")
Ground(X, Y) = New Point(CInt(Tile(0)), CInt(Tile(1)))
Next
Next
For X = 0 To 24
For Y = 0 To 19
Tile(X, Y) = New DarkGDK.Basic2D.AnimatedSprite("Tiles0.PNG", temp.ScaleX, temp.ScaleY)
Tile(X, Y).Position(X * 32, Y * 32)
Tile(X, Y).Frame = Ground(X, Y).X + Ground(X, Y).Y * 12
Next
Next
While DarkGDK.Engine.LoopGDK()
DarkGDK.Core.Sync()
End While
End Sub
It strips down the tilesheet into animated tiles.
Then, it creates a tile for every 32 pixels on the screen (here is where I go wrong, it takes too long to create and too long to draw).
If anyone knows a better way to do this, please respond with the new code, a way to do it, or a link (or anything else helpfull).
Thanks in advance, Anasky.