-Korvic
Code: Select all
global vMap, vCharAmount, vHeightCount, f, iPerson, jPerson, iP, jP, e, spritewidth, screenwidth, vshotcount, vshotmax, vshotspeed, nbBullet, FList, DUList, DDList
local vWall, vXDir, vYDir, FirstF, vLayer, FirstDU, FirstDD, roomnumber
on opencard
send mouseup to button "Create"
end opencard
on mapgen
--Variable Reset
put 0 into nbBullet
put 1 into f
put 1 into roomnumber
put 30 into spritewidth
put 100 into vshotspeed
put 900 into screenwidth
put 9001 into vLayer
put true into FirstF
put true into FirstDD
put true into FirstDU
put the number of chars of vMap into vCharAmount
put ( vCharAmount / ( screenwidth / spritewidth ) ) into vHeightCount
--Place / Sort Map Sprites
repeat with j = 1 to vHeightCount
repeat with i = 1 to ( vCharAmount / vHeightCount )
put i + (j-1)*( vCharAmount / vHeightCount ) into n
switch (char n of vMap)
case "W"
clone img WallPNG.png
set the loc of last img to ((i*spritewidth)+49),((j*spritewidth)+62)
put false into vWall
break
case "U"
clone img DoorUpPNG.png
set the name of last img to "dudummy" & n
if FirstDU = true then
put false into FirstDU
put n into DUList
else
put DUList &","&n into DUList
end if
set the loc of last img to ((i*spritewidth)+52),((j*spritewidth)+52)
set the layer of last img to vLayer
clone img FloorPNG.png
put true into vWall
break
case "D"
clone img DoorDownPNG.png
set the name of last img to "dddummy" & n
if FirstDD = true then
put false into FirstDD
put n into DDList
else
put DDList &","&n into DDList
end if
set the loc of last img to ((i*spritewidth)+52),((j*spritewidth)+52)
set the layer of last img to vLayer
clone img FloorPNG.png
put true into vWall
break
case "B"
clone img BlanchePNG.png
put true into vWall
break
case "N"
clone img NoirPNG.png
set the loc of last img to ((i*spritewidth)+52),((j*spritewidth)+52)
put false into vWall
break
case "C"
clone img StartPNG.png
put true into vWall
break
case "S"
set the loc of img PersonPNG.png to ((i*spritewidth)+52),((j*spritewidth)+52)
clone img FloorPNG.png
put true into vWall
put i into iPerson
put j into jPerson
break
case "E"
clone img WaterGIF.gif
break
case "F"
clone img FPNG.png
set the name of last img to "fdummy" & n
if FirstF = true then
put false into FirstF
put n into FList
else
put FList &","&n into FList
end if
set the loc of last img to ((i*spritewidth)+52),((j*spritewidth)+52)
set the layer of last img to vLayer
clone img FloorPNG.png
put true into vWall
break
default
clone img FloorPNG.png
put true into vWall
break
end switch
set the name of last img to "dummy" & n
if vWall = true then
set the loc of last img to ((i*spritewidth)+52),((j*spritewidth)+52)
set the layer of last img to 0
else
set the layer of last img to vLayer
put vLayer - 1 into vLayer
end if
end repeat
end repeat
set the layer of img PersonPNG.png to top
end mapgen