Code: Select all
type shipWeapon
identifier as string
damage as integer
AP as integer
health as integer
declare operator cast() as string 'to use print
end type
operator shipWeapon.cast() as string
return identifier + ","+str(damage)+","+str(AP)+","+str(health)
end operator
type ship
fileName as string
imagePtr as any ptr
health as integer
armor as integer
weapons(any) as shipWeapon
'declare constructor (byval fileName as string, byval imagePtr as any ptr, byval health as integer, byval armor as integer, weapons(any) as shipWeapon)'byval size as integer)
declare constructor (byval f as string, byval h as integer, byval a as integer, w() as shipWeapon)
end type
sub create(im as any ptr)
Dim As String boat = _
"S1C0BM110,208M+4,42M+7,7M+1,15M+-6,2M+1,6"_
&"M+38,-1M+-1,-7M+-32,0"_
&"BM+14,4P4294932224,0"_
&"BM+-2,4M+6,7"_
&"M+-2,10M+2,5M+2,17M+2,20M+-1,2M+260,0"_
&"M+16,-10M+9,-13M+5,-16M+5,-11M+14,-7M+14,-6"_
&"M+10,-8M+-55,8M+-13,-6M+-52,3M+-41,3M+-42,1"_
&"M+-22,-2M+-45,-3M+-26,-5M+0,0M+-24,-5M+0,0"_
&"M+-31,-7M+-2,14M+30,1M+1,8M+2,0"_
&"M+0,0M+0,0M+-20,2"_
&"BM+154,32P4288822016,0"_
&"BM+-165,-29M+1,26"_
&"M+-3,18M+0,12M+0,0M+16,-1M+0,-16M+-1,-18"_
&"M+-1,-14M+-2,-6M+-8,-1"_
&"B"_
&"BM+2,-1M+-4,1"_
&""_
&"BM+7,28P4285822068,0"_
&"BM+5,-95M+22,9M+15,9M+4,1M+0,10"_
&"M+16,5M+24,3M+25,4M+8,14M+2,4"_
&"B"_
&"BM+-143,-70M+3,2M+25,7M+3,3M+0,-1"_
&"BM+-28,14M+9,0M+12,5M+9,0M+14,5M+18,7"_
&"M+5,0"_
&"BM+-51,-30M+0,14M+-4,-16M+-1,16M+1,8"_
&"M+-3,10M+8,-10M+-2,14M+8,1M+1,-12"_
&"BM+30,11"_
&"P4285412870,0"_
&"BM+-31,-30P4283708934,0"_
&"BM+195,48M+5,-7M+0,-4M+66,-3M+7,12"_
&""_
&"B"_
&"BM+-80,2M+2,4M+0,-2"_
&"BM+21,-6P4283708934,0"_
&"BM+59,2M+135,-83"_
&"M+-127,87"_
&"BM+6,-7"_
&"B"_
&"BM+-2,5M+1,5"_
&"B"_
&"BM+-6,-13M+-13,6"_
&"BM+16,-1P4279308561,0"_
&"BM+1,-2P4281940281,0"_
&"BM+-39,-10"_
&"BM+6,1M+-8,0"_
&"M+9,-99M+6,1M+-6,98M+-2,0"_
&"BM+0,-23P4281940281,0"_
&"B"_
&"BM+2,-76M+-11,-12M+2,-6M+1,1"_
&"M+25,0M+-3,13M+-8,4M+-2,-1"_
&"B"_
&"BM+-1,-12"_
&"P4294912000,0"_
&"BM+-3,-8M+0,3M+7,-103"_
&"BM+1,1M+3,-1"_
&"M+-2,102M+0,2"_
&"BM+-3,-10"_
&"P4283848278,0"_
&"BM+6,-96M+1,-22"_
&"BM+-136,265M+1,-126M+5,0M+4,125"_
&"BM+-4,-29"_
&"P4283848278,0"_
&"BM+1,-96M+8,-6M+0,-10M+-26,1M+0,8"_
&"M+4,6M+9,2"_
&"BM+-1,-9P4294919424,0"_
&"BM+-1,-8M+4,-123M+4,-1"_
&"M+1,124"_
&"BM+-5,-15P4283256141,0"_
&"BM+-107,106M+9,3M+0,-68M+-6,1"_
&"M+-1,64"_
&"BM+2,-13P4283256141,0"_
&"BM+4,-54M+8,-1M+-1,-8M+-19,0"_
&"M+-1,10M+10,3"_
&"M+11,-5"_
&"BM+-18,-3P4294919424,0"_
&"BM+3,-7M+0,1M+-1,-99M+6,1M+3,98"_
&"BP4283256141,0"_
&"BM+-4,-12"_
&"P4283256141,0"_
&"BM+-1,25M+-15,77M+7,0M+9,-76M+-2,77"_
&"BM+-11,-11"_
&"M+12,-2M+0,-8M+-10,0M+2,-4M+8,0M+0,-5"_
&"M+-10,0M+3,-7M+7,3M+0,-8M+-7,2"_
&"BM+112,-47"_
&"M+-64,136M+9,1M+52,-135M+-44,135M+11,0M+36,-136"_
&"M+-22,136M+6,2M+15,-136M+-58,111M+46,2M+3,-7"_
&"M+-41,-4M+4,-6M+37,1M+1,-8M+-34,-3M+5,-8"_
&"M+27,1M+4,-10M+-28,-2M+4,-8M+22,1M+4,-11"_
&"M+-23,1M+4,-10M+17,0M+3,-9M+-14,-2"_
&"B"_
&"BM+135,-29"_
&"M+-36,114M+8,1M+31,-112M+-25,114M+0,0M+7,-1"_
&"M+0,0M+15,-112M+-5,110M+7,-107M+-6,106M+10,0"_
&"M+-5,-107"_
&"BM+-192,131M+64,3M+0,-4M+-56,-4"_
&"M+-5,5"_
&"BM+24,-2"_
&"BM+0,0P4294955008,0"_
&"BM+0,-58M+-117,-153M+9,2"_
&"M+111,147M+-6,4"_
&"B"_
&"BM+-71,-104P4283848278,0"_
&"BM+71,95P4283848278,0"_
&"BM+-39,54"_
&"M+1,8M+7,0M+-1,-7M+-11,0"_
&""_
&"BM+8,3P4283848278,0"_
&"BM+89,-2M+2,8M+6,0M+1,-8M+-10,0"_
&""_
&"BM+5,5P4283848278,0"_
&"B"_
&"BM+22,-4M+12,-1"_
&"M+0,11M+-13,-1M+1,-9"_
&"BM+3,2P4283848278,0"_
&"BM+27,-4M+14,0"_
&"M+-2,10M+-10,-1M+0,-9"_
&"BM+3,3P4283848278,0"_
&"BM+90,7M+-19,10"_
&"M+-3,-5M+2,-4M+-3,8M+8,6M+0,5M+6,-1"_
&""_
&"B"
dim as long d=700
line im,(780+75-d,100)-(780+85-d,95)
circle im,(780+85-d,95),2,,,,,f
Line im,(780+75-d,100)-(780+10-d,170),0
Line im,(780+75-d,100)-(930-10-d,170),0
Line im,(780-d,150)-(930-d,250),Rgb(0,190,255),bf
Line im,(780-d,220)-(930-d,250),Rgb(0,100,190),bf
For k As Long=-5 To 5
Line im,(780-k-d,150-k)-(930+k-d,250+k),Rgb(150+10*k,30,0),b
Next k
Draw im,boat
end sub
'constructor ship(byval size as integer)
' redim this.weapons(size)
'end constructor
constructor ship(byval f as string, byval h as integer, byval a as integer, w() as shipWeapon)
this.health = h
this.armor = a
redim this.weapons(ubound(w))
for i as integer = 0 to ubound(w) step 1
this.weapons(i) = w(i)
next i
this.fileName = f
this.imagePtr = ImageCreate(300,300,rgb(100,100,100))
create(imageptr)
for i as integer=0 to ubound(w)
draw string imagePtr,(10,i*20+50),weapons(i)
next i
if Bsave(this.fileName, this.imagePtr) <> 0 then
print "Error loading: " & this.fileName
sleep
end
end if
end constructor
dim laser as shipWeapon
laser.identifier = "laz"
laser.damage = 2
laser.AP = -1
laser.health = 2
dim bolter as shipWeapon
bolter.identifier = "blt"
bolter.damage = 3
bolter.AP = 0
bolter.health = 3
screen 20,32
bsave("testbg.bmp",0)
dim as shipweapon temp(0 to 1)={laser,bolter}
dim occult as ship = ship("testbg.bmp", 10, 1,temp())
bload "testbg.bmp"
sleep
kill "testbg.bmp"