Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not sure how to use SUBs...
#1
lookie:

Code:
'$DYNAMIC

DECLARE FUNCTION Truwalk% (direction%)
DECLARE SUB FetchInput (keyin$)
DECLARE SUB PutPalette (Pal() AS ANY)
DECLARE SUB SetEms ()
DECLARE SUB LoadSprite (FileName$, sprite%(), spritepal() AS ANY)
'$INCLUDE: 'includes\mapdecl.bi'
'$INCLUDE: 'includes\mapheadr.bi'


TYPE PalType

  r AS STRING * 1
  g AS STRING * 1
  b AS STRING * 1

END TYPE


TYPE SpriteFrame

  max AS INTEGER
  rate AS INTEGER
  current AS INTEGER

END TYPE


TYPE ThreadType

  max AS INTEGER
  node AS INTEGER

END TYPE


CONST SCREENY = 200
CONST SCREENX = 320


DIM Pal(255) AS PalType
DIM thread AS ThreadType
DIM lynnframe AS SpriteFrame

DIM howmuchhere AS STRING * 1
DIM lynn%(0)
DIM grass%(0)

DIM mapinfo AS MapHeader
DIM roominfo(63) AS RoomHeader
DIM roommaps%(63, 0)
DIM doors%(127)

REDIM surrounding%(7)

thread.max = 10000

lynnframe.max = 8
lynnframe.rate = 5

camerax% = 0
cameray% = 0

CLS

RANDOMIZE TIMER

SCREEN 13

LoadMap "test2.map"
LoadSprite "pics/grass.spr", grass%(), Pal()
LoadSprite "pics/dummy.spr", lynn%(), Pal()
PutPalette Pal()


DO
  coinflip% = INT(RND * 2)

  stillmoving% = movedflag%
  movedflag% = 0

  FetchInput


now, i didnt include the actual code for the FetchInput SUB, but the thing is its there down below the module.,, isnt a declare statement on top enough? we dont have to put subs before the code do we??
Reply
#2
The argument is missing, keyin$ -- yeah, i may change the error message for that ;)
Reply
#3
thanks ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)