I really am starting to think darkbasic pro hates me, is there any reason this isnt working.
remstart---------------|
|----By Darkzombies----|
|----Pre-Alpha-0.1-----|
remend-----------------|
rem --------
rem | DATA |
rem --------
#constant up upkey()
#constant down downkey()
#constant right rightkey()
#constant left leftkey()
#constant true 1
#constant false 0
#constant savedir1 \"data\\save01.dat\"
#constant savedir2 \"data\\save02.dat\"
#constant savedir3 \"data\\save03.dat\"
rem ---------
rem | TYPES |
rem ---------
type entity
x as integer
y as integer
anim as integer
direction as integer
att as integer `Inidividual attack/defence level
def as integer
endtype
type terrain
x as integer
y as integer
direction as integer
anim as integer
endtype
rem -------------
rem | FUNCTIONS |
rem -------------
function playerinput() `THESE WILL BE EXECUTED IN THE GAME LOOP, MAYBE A FUNCTION LOOP!
do
if up = 1
player.direction = 0 `Face up.
endif
if down = 1
player.direction = 1 `Face down.
endif
if right = 1
player.direction = 2 `Face right
endif
if left = 1
player.direction = 3 `Face left.
endif
loop
endfunction player.direction
it also wont ever let me put text on a screen with the text command. (If it has sprites or any sort of image)
EDIT: Never mind... I fixed it, apparently I can use "up, down, left, or right" as constants..
but anyways, how do I avoid the annoying "Function declared mid-program blah blah blah" in this code? Cause im getting it lol
rem ----------------------|
rem |---By Darkzombies----|
rem |---Pre-Alpha-0.1-----|
rem ----------------------|
rem --------
rem | DATA |
rem --------
sync on : sync rate 50
#constant upk upkey()
#constant downk downkey()
#constant rightk rightkey()
#constant leftk leftkey()
#constant true 1
#constant false 0
#constant savedir1 "data\save01.dat"
#constant savedir2 "data\save02.dat"
#constant savedir3 "data\save03.dat"
rem ---------
rem | TYPES |
rem ---------
type entity
x as integer
y as integer
anim as integer
direction as integer
att as integer `Inidividual attack/defence level
def as integer
endtype
type terrain
x as integer
y as integer
direction as integer
anim as integer
endtype
global player as entity
global dim knight(troops) as entity
rem -------------
rem | FUNCTIONS |
rem -------------
function playerinput() `THESE WILL BE EXECUTED IN THE GAME LOOP, MAYBE A FUNCTION LOOP!
do
if upk = 1
player.direction = 0 `Face up.
endif
if downk = 1
player.direction = 1 `Face down.
endif
if rightk = 1
player.direction = 2 `Face right
endif
if leftk = 1
player.direction = 3 `Face left.
endif
loop
endfunction
wait key
"Insert funny coding-related joke here"