Hi,
I have tried searching the forums but can find nothing that makes any sense to me or anything that works how i expect it should.
I am new to AppGameKit (Obviously) and have been pulling my hair out over a timely array. i just want to know how to do it.
I have the following code which is just like a testing playground. if someone could help me/explain why the tiles are not displaying as they should (in a line), it would be very much appreciated.
Many thanks in advance
// Project: Testing
// Created: 2015-01-31
// set window properties
SetWindowTitle( "Testing" )
SetWindowSize( 1280, 800, 0 )
// set display properties
SetVirtualResolution( 320, 200 )
SetVSync(1)
tile = 8
// tiles -----------------------
IMFloor = LoadImage ( "Assets/floor.png" )
IMWall4 = LoadImage ( "Assets/topwall.png" )
IMWall7 = LoadImage ( "Assets/rightwall.png" )
SetImageMagFilter ( IMFloor, 0 )
SetImageMinFilter ( IMFloor, 0 )
SetImageMagFilter ( IMWall4, 0 )
SetImageMinFilter ( IMWall4, 0 )
SetImageMagFilter ( IMWall7, 0 )
SetImageMinFilter ( IMWall7, 0 )
Floor1 = CreateSprite ( IMFloor )
Wall4 = CreateSprite ( IMWall4 )
Wall7 = CreateSprite ( IMWall7 )
imagePL = LoadImage( "Assets/lilChick16x16.png" )
SetImageMagFilter ( imagePL, 0 )
SetImageMinFilter ( imagePL, 0 )
sprite = CreateSprite ( imagePL )
AnimImage = LoadImage ( "Assets/lilChicknoBG.png")
SetImageMagFilter ( AnimImage, 0 )
SetImageMinFilter ( AnimImage, 0 )
AnimSprite = CreateSprite ( AnimImage )
SetSpritePosition ( AnimSprite, 128, 128 )
SetSpriteAnimation ( AnimSprite, 24, 24, 8)
PlaySprite ( AnimSprite, 10, 1, 1, 8)
dim Map [10] = [ 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 ]
for x = 1 to 10
if Map[x] = 0
CreateSprite ( Floor1 )
SetSpritePosition ( Map[x], x*tile, 0 )
elseif Map[x] = 1
CreateSprite ( Wall4 )
SetSpritePosition ( Map[x], x*tile, 0 )
elseif Map[x] = 2
CreateSprite ( Wall7 )
SetSpritePosition ( Map[x], x*tile, 0 )
endif
next
do
SetSpritePosition ( sprite, 64, 64)
//gosub control
/*Print( ScreenFPS() )*/
Sync()
loop