sorry forgot to add the code and it wont let me edit my frst post.
sync on
`#########Create Soldier#############
Load image \"Soldier.bmp\",1
sprite 1,50,50,1
offset sprite 1,25,25
hide sprite 1
`Set stats for soldier
Type Unit
ID as string
Unit as string
Health as word
MaxHealth as word
x as float
y as float
Selected as string
EndType
Dim Unit(50) as Unit
`Variables for Selection
Dim SelectionBox(2,2)
Global Clicked=0
Dim Selected(1)
`Unit Variables
Global SolNum=0
`##############MAIN LOOP###############
do
Selection()
UnitMovement()
if spacekey() then CreateUnit()
RenderUnits()
set cursor 400,400
Print \"Press space key to create some soldiers\"
Print \"Use the cursor to select them\"
sync
cls
loop
`#################SELECT THE UNITS####################
Function Selection()
if mouseclick()
`get box cords from mouse
if Clicked=0
SelectionBox(1,1)=mousex()
SelectionBox(1,2)=mousey()
Clicked=1
endif
SelectionBox(2,1)=mousex()
SelectionBox(2,2)=mousey()
`Draw our box
line SelectionBox(1,1),SelectionBox(1,2),SelectionBox(2,1),SelectionBox(1,2)
line SelectionBox(1,1),SelectionBox(1,2),SelectionBox(1,1),SelectionBox(2,2)
line SelectionBox(1,1),SelectionBox(2,2),SelectionBox(2,1),SelectionBox(2,2)
line SelectionBox(2,1),SelectionBox(1,2),SelectionBox(2,1),SelectionBox(2,2)
endif
`##########################################
`Reset our Box
if mouseclick()=0
Clicked=0
SelectionBox(1,1)=0
SelectionBox(1,2)=0
SelectionBox(2,1)=0
SelectionBox(2,2)=0
endif
`#########################################
`print \"Unit: \"+Unit(SolNum).x + \",\"
`print \"Selection:\"+ SelectionBox(1,1) + \",\" + SelectionBox(2,1)
for Num=1 to SolNum
if Unit(SolNum).x => SelectionBox(1,1) and Unit(SolNum).x=< SelectionBox(2,1)
if Unit(SolNum).y => SelectionBox(1,2) and Unit(SolNum).y=< SelectionBox(2,2)
Unit(SolNum).Selected=\"Yes\"
`print \"yes\"
endif
endif
next Num
endfunction
`###########MOVE SELECTED CHARACTERS###################
function UnitMovement()
endfunction
`#################CREATE a UNIT#######################
function CreateUnit()
if SolNum<50
`Add to the amount of soldiers we have
SolNum=SolNum+1
`Create our Soldiers stats
Unit(SolNum).ID=\"Sol\" + BIN$(SolNum)
Unit(SolNum).Unit=\"Soldier\"
Unit(SolNum).Health=200
Unit(SolNum).MaxHealth=200
Unit(SolNum).x=rnd(600)
Unit(SolNum).y=rnd(600)
Unit(SolNum).Selected=\"No\"
endif
endfunction
`###############RENDER UNITS##################
function RenderUnits()
for Num=1 to SolNum
`Draw the Unit
`paste sprite 1,Unit(Num).x,Unit(Num).y
box Unit(Num).x, Unit(Num).y, Unit(Num).x+10,Unit(Num).y+10
`Draw the Selection Circle
if Unit(SolNum).Selected=\"Yes\"
circle Unit(Num).x,Unit(Num).y,10
endif
next Num
endfunction