Endif Expected ?

Blitz3D Forums/Blitz3D Beginners Area/Endif Expected ?

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I forgot about the dims being before the includes. Strange that, but always put them above everything as you might refer to the array in one of the include files before you've declared it. This works:
Dim hold.gameitems(18)

; include "load.bb"



Graphics3D 1024,768,16,2

Type gameitems
  Field item
  Field anim1
  Field anim2
  Field gridx%
  Field gridy%
  Field points%
  Field time%
  Field lives%
  Field ID%
  Field status%
  Field puzzle%
  Field nextitem%
End Type




Global GX#
Global GY#
Global Current_Piece%  ;use this to track what piece player should hit.
Global currlevel% ;use this to track the current level we are on.
Global countx%



GX# = 64
GY# = 64

LoadMyStuff()



; loop

Repeat
RenderWorld
Flip
Until KeyHit(1)



Function nS_LoadImage(txt$,a,b)

End Function

Function nS_LoadAnimImage(txt$,GX#,GY#,a,b,c,d)

End Function


Function LoadMyStuff()
	For countx = 0 To 18
		hold(countx) = New gameitems
	Next

	For i=0 To 18
	  hold(i)\item = nS_LoadImage("../media/image"+i+".jpg",4,True)
	  hold(i)\anim1 = nS_LoadAnimImage("../media/particle1.jpg",GX#,GY#,0,10,4,True)
	  hold(i)\anim2 = nS_LoadAnimImage("../media/particle2.jpg",GX#,GY#,0,10,4,True)
	  hold(i)\gridx = -1
	  hold(i)\gridy = -1
	  hold(i)\points = 0 ;0=stopped
	  hold(i)\time = 0
	  hold(i)\lives = 0
	  hold(i)\ID = i
	  hold(i)\status = 0 ;0=stopped
	  hold(i)\puzzle = 0 ;not a puzzle piece
	  hold(i)\nextitem = ID_free
	Next
End Function