type menu :
record
picture : int
item : int
end record
var pic : array 1 .. 133 of int
var console : array 1 .. 7 of int
var playerpics : array 1 .. 27 of int
var positioning : array 1 .. 6, 1 .. 2 of menu
var watercounter, flowercounter, movementcounter, tempa, tempb, player, weaponmovementcounter, health, healthtotal, shieldmove : int
var swinging : array 1 .. 16 of int
shieldmove := 0
health := 6
healthtotal := 3
for x : 1 .. 6
for y : 1 .. 2
positioning (x, y).item := 0
positioning (x, y).picture := Pic.FileNew ("Pictures/Console/Start Menu/Empty1.bmp")
end for
end for
positioning (1, 1).picture := Pic.FileNew ("Pictures/Console/Start Menu/Shield1.bmp")
positioning (1, 1).item := 1
positioning (1, 2).item := 2
positioning (1, 2).picture := Pic.FileNew ("Pictures/Console/Start Menu/Sword.bmp")
swinging (1) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down1.bmp")
swinging (2) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down2.bmp")
swinging (3) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down3.bmp")
swinging (4) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down4.bmp")
swinging (5) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right1.bmp")
swinging (6) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right2.bmp")
swinging (7) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right3.bmp")
swinging (8) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right4.bmp")
swinging (9) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up1.bmp")
swinging (10) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up2.bmp")
swinging (11) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up3.bmp")
swinging (12) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up4.bmp")
swinging (13) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left1.bmp")
swinging (14) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left2.bmp")
swinging (15) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left3.bmp")
swinging (16) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left4.bmp")
playerpics (1) := Pic.FileNew ("Pictures/Player/With Shield/Down1.bmp")
playerpics (2) := Pic.FileNew ("Pictures/Player/With Shield/Right1.bmp")
playerpics (3) := Pic.FileNew ("Pictures/Player/With Shield/Up1.bmp")
playerpics (4) := Pic.FileNew ("Pictures/Player/With Shield/Left1.bmp")
playerpics (5) := Pic.FileNew ("Pictures/Player/With Shield/Down2.bmp")
playerpics (6) := Pic.FileNew ("Pictures/Player/With Shield/Right2.bmp")
playerpics (7) := Pic.FileNew ("Pictures/Player/With Shield/Up2.bmp")
playerpics (8) := Pic.FileNew ("Pictures/Player/With Shield/Left2.bmp")
playerpics (9) := Pic.FileNew ("Pictures/Player/With Shield/SDown1.bmp")
playerpics (10) := Pic.FileNew ("Pictures/Player/With Shield/SRight1.bmp")
playerpics (11) := Pic.FileNew ("Pictures/Player/With Shield/SUp1.bmp")
playerpics (12) := Pic.FileNew ("Pictures/Player/With Shield/SLeft1.bmp")
playerpics (13) := Pic.FileNew ("Pictures/Player/Moveables/Falling1.bmp")
playerpics (14) := Pic.FileNew ("Pictures/Player/Moveables/Falling2.bmp")
playerpics (15) := Pic.FileNew ("Pictures/Player/Moveables/Falling3.bmp")
playerpics (16) := Pic.FileNew ("Pictures/Player/With Shield/Hurt1.bmp")
playerpics (17) := Pic.FileNew ("Pictures/Player/With Shield/Hurt2.bmp")
playerpics (18) := Pic.FileNew ("Pictures/Player/With Shield/Hurt3.bmp")
playerpics (19) := Pic.FileNew ("Pictures/Player/With Shield/Hurt4.bmp")
playerpics (20) := Pic.FileNew ("Pictures/Player/With Shield/Death.bmp")
playerpics (21) := Pic.FileNew ("Pictures/Player/Flipping/FlipD1.bmp")
playerpics (22) := Pic.FileNew ("Pictures/Player/Flipping/FlipD2.bmp")
playerpics (23) := Pic.FileNew ("Pictures/Player/Flipping/FlipD3.bmp")
playerpics (24) := Pic.FileNew ("Pictures/Player/With Shield/SRight2.bmp")
playerpics (25) := Pic.FileNew ("Pictures/Player/With Shield/SDown2.bmp")
playerpics (26) := Pic.FileNew ("Pictures/Player/With Shield/SLeft2.bmp")
playerpics (27) := Pic.FileNew ("Pictures/Player/With Shield/SUp2.bmp")
console (1) := Pic.FileNew ("Pictures/Console/console.bmp")
console (2) := Pic.FileNew ("Pictures/Console/Start Menu/Selector.bmp")
console (3) := Pic.FileNew ("Pictures/Console/Start Menu/MainBack.bmp")
console (4) := Pic.FileNew ("Pictures/Console/Start Menu/MainBack.bmp")
console (5) := Pic.FileNew ("Pictures/Console/Heart0.bmp")
console (6) := Pic.FileNew ("Pictures/Console/Heart1.bmp")
console (7) := Pic.FileNew ("Pictures/Console/Heart2.bmp")
pic (1) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass1.bmp")
pic (2) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass2.bmp")
pic (3) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass3.bmp")
pic (4) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass4.bmp")
pic (5) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass5.bmp")
pic (6) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass1.bmp")
pic (7) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass2.bmp")
pic (8) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass3.bmp")
pic (9) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass4.bmp")
pic (10) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SgrassV.bmp")
pic (11) := Pic.FileNew ("Pictures/GroundTypes/Pathway1.bmp")
pic (12) := Pic.FileNew ("Pictures/Interaction/Ground/Grass1.bmp")
pic (13) := Pic.FileNew ("Pictures/GroundTypes/Fence1.bmp")
pic (14) := Pic.FileNew ("Pictures/Interaction/Ground/Bush1.bmp")
pic (15) := Pic.FileNew ("Pictures/Buildings/House1.bmp")
pic (16) := Pic.FileNew ("Pictures/Buildings/Door1.bmp")
pic (17) := Pic.FileNew ("Pictures/Buildings/Roof1.bmp")
pic (18) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft1.bmp")
pic (19) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft1.bmp")
pic (20) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright1.bmp")
pic (21) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright1.bmp")
pic (22) := Pic.FileNew ("Pictures/Buildings/House2.bmp")
pic (23) := Pic.FileNew ("Pictures/Buildings/Door2.bmp")
pic (24) := Pic.FileNew ("Pictures/Buildings/Shop1.bmp")
pic (25) := Pic.FileNew ("Pictures/Buildings/Shop2.bmp")
pic (26) := Pic.FileNew ("Pictures/Buildings/Shop3.bmp")
pic (27) := Pic.FileNew ("Pictures/Buildings/Shop4.bmp")
pic (28) := Pic.FileNew ("Pictures/Buildings/Shop5.bmp")
pic (29) := Pic.FileNew ("Pictures/Buildings/Shop6.bmp")
pic (30) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall1.bmp")
pic (31) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall2.bmp")
pic (32) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall3.bmp")
pic (33) := Pic.FileNew ("Pictures/GroundTypes/Stairs1.bmp")
pic (34) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SgrassH.bmp")
pic (35) := Pic.FileNew ("Pictures/GroundTypes/Tiles1.bmp")
pic (36) := Pic.FileNew ("Pictures/GroundTypes/Flowers1.bmp")
pic (37) := Pic.FileNew ("Pictures/Specials/RStatueB.bmp")
pic (38) := Pic.FileNew ("Pictures/Specials/RStatueT.bmp")
pic (39) := Pic.FileNew ("Pictures/GroundTypes/Tiles2.bmp")
pic (40) := Pic.FileNew ("Pictures/Buildings/Door3.bmp")
pic (41) := Pic.FileNew ("Pictures/Buildings/Roof2.bmp")
pic (42) := Pic.FileNew ("Pictures/Specials/BowWowPost.bmp")
pic (43) := Pic.FileNew ("Pictures/Buildings/Roof3.bmp")
pic (44) := Pic.FileNew ("Pictures/Buildings/BowwowR1.bmp")
pic (45) := Pic.FileNew ("Pictures/Buildings/BowwowR2.bmp")
pic (46) := Pic.FileNew ("Pictures/Buildings/BowwowR3.bmp")
pic (47) := Pic.FileNew ("Pictures/Buildings/BowwowR4.bmp")
pic (48) := Pic.FileNew ("Pictures/Buildings/BowwowR5.bmp")
pic (49) := Pic.FileNew ("Pictures/Buildings/BowwowR6.bmp")
pic (50) := Pic.FileNew ("Pictures/GroundTypes/Grass2.bmp")
pic (51) := Pic.FileNew ("Pictures/GroundTypes/Stones1.bmp")
pic (52) := Pic.FileNew ("Pictures/GroundTypes/Stones2.bmp")
pic (53) := Pic.FileNew ("Pictures/Buildings/HouseR1.bmp")
pic (54) := Pic.FileNew ("Pictures/Buildings/HouseR2.bmp")
pic (55) := Pic.FileNew ("Pictures/Buildings/HouseR3.bmp")
pic (56) := Pic.FileNew ("Pictures/Buildings/HouseR4.bmp")
pic (57) := Pic.FileNew ("Pictures/Buildings/HouseR5.bmp")
pic (58) := Pic.FileNew ("Pictures/Buildings/HouseR6.bmp")
pic (59) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft2.bmp")
pic (60) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright2.bmp")
pic (61) := Pic.FileNew ("Pictures/Interaction/Ground/Rock1.bmp")
pic (62) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT1.bmp")
pic (63) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT2.bmp")
pic (64) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT3.bmp")
pic (65) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT4.bmp")
pic (66) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT5.bmp")
pic (67) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT6.bmp")
pic (68) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT7.bmp")
pic (69) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT8.bmp")
pic (70) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT9.bmp")
pic (71) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT10.bmp")
pic (72) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT11.bmp")
pic (73) := Pic.FileNew ("Pictures/Buildings/HouseR7.bmp")
pic (74) := Pic.FileNew ("Pictures/Interaction/Ground/Sign1.bmp")
pic (75) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall4.bmp")
pic (76) := Pic.FileNew ("Pictures/Buildings/Door4.bmp")
pic (77) := Pic.FileNew ("Pictures/GroundTypes/Water/Water1.bmp")
pic (78) := Pic.FileNew ("Pictures/GroundTypes/Water/Water2.bmp")
pic (79) := Pic.FileNew ("Pictures/GroundTypes/Water/Water3.bmp")
pic (80) := Pic.FileNew ("Pictures/Buildings/ShopR1.bmp")
pic (81) := Pic.FileNew ("Pictures/Buildings/ShopR2.bmp")
pic (82) := Pic.FileNew ("Pictures/Buildings/ShopR3.bmp")
pic (83) := Pic.FileNew ("Pictures/Buildings/ShopR4.bmp")
pic (84) := Pic.FileNew ("Pictures/Buildings/ShopR5.bmp")
pic (85) := Pic.FileNew ("Pictures/Buildings/ShopR6.bmp")
pic (86) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT12.bmp")
pic (87) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT13.bmp")
pic (88) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT14.bmp")
pic (89) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT15.bmp")
pic (90) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT16.bmp")
pic (91) := Pic.FileNew ("Pictures/Buildings/Roof4.bmp")
pic (92) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT17.bmp")
pic (93) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT18.bmp")
pic (94) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT19.bmp")
pic (95) := Pic.FileNew ("Pictures/Interaction/Ground/Hole1.bmp")
pic (96) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT20.bmp")
pic (97) := Pic.FileNew ("Pictures/GroundTypes/Tiles3.bmp")
pic (98) := Pic.FileNew ("Pictures/GroundTypes/Bars1.bmp")
pic (99) := Pic.FileNew ("Pictures/Buildings/Scorp1.bmp")
pic (100) := Pic.FileNew ("Pictures/Buildings/Scorp2.bmp")
pic (101) := Pic.FileNew ("Pictures/Buildings/Scorp3.bmp")
pic (102) := Pic.FileNew ("Pictures/GroundTypes/Flowers2.bmp")
pic (103) := Pic.FileNew ("Pictures/GroundTypes/Flowers3.bmp")
pic (104) := Pic.FileNew ("Pictures/Interaction/Ground/Bush2.bmp")
pic (105) := Pic.FileNew ("Pictures/GroundTypes/Sand1.bmp")
pic (106) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft3.bmp")
pic (107) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft3.bmp")
pic (108) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright3.bmp")
pic (109) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright3.bmp")
pic (110) := Pic.FileNew ("Pictures/GroundTypes/Sand2.bmp")
pic (111) := Pic.FileNew ("Pictures/GroundTypes/Sand3.bmp")
pic (112) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft4.bmp")
pic (113) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft4.bmp")
pic (114) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright4.bmp")
pic (115) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright4.bmp")
pic (116) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater1.bmp")
pic (117) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater2.bmp")
pic (118) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater3.bmp")
pic (119) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater2.bmp")
pic (120) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater1.bmp")
pic (121) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater2.bmp")
pic (122) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater3.bmp")
pic (123) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater2.bmp")
pic (124) := Pic.FileNew ("Pictures/GroundTypes/Sand4.bmp")
pic (125) := Pic.FileNew ("Pictures/GroundTypes/Sand5.bmp")
pic (126) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall6.bmp")
pic (127) := Pic.FileNew ("Pictures/Interaction/Doors/Rock1.bmp")
pic (128) := Pic.FileNew ("Pictures/GroundTypes/Flowers2.bmp")
pic (129) := Pic.FileNew ("Pictures/Interaction/Ground/Chest1.bmp")
pic (130) := Pic.FileNew ("Pictures/Interaction/Ground/BushA1.bmp")
pic (131) := Pic.FileNew ("Pictures/Interaction/Ground/BushA2.bmp")
pic (132) := Pic.FileNew ("Pictures/Interaction/Ground/BushA4.bmp")
pic (133) := Pic.FileNew ("Pictures/Interaction/Ground/BushA5.bmp")
watercounter := 0
flowercounter := 0
movementcounter := 0
procedure movement (var current, num1, num2 : int)
if current ~= num1 and current ~= num2 then
current := num1
lastpicture := num1
end if
if movementcounter > 10 then
if current = num1 then
current := num2
lastpicture := num2
elsif player = num2 then
current := num1
lastpicture := num1
end if
end if
if movementcounter > 10 then
movementcounter := 0
end if
end movement
procedure drawbackground
Draw.FillBox (0, 0, 500, 500, white)
j := 256
for x : 1 .. 8
i := 0
for y : 1 .. 10
if watercounter > 30 then
if background (x, y) = 77 then
background (x, y) := 78
elsif background (x, y) = 78 then
background (x, y) := 79
elsif background (x, y) = 79 then
background (x, y) := 77
end if
if background (x, y) = 116 then
background (x, y) := 117
elsif background (x, y) = 117 then
background (x, y) := 118
elsif background (x, y) = 118 then
background (x, y) := 119
elsif background (x, y) = 119 then
background (x, y) := 116
end if
if background (x, y) = 120 then
background (x, y) := 121
elsif background (x, y) = 121 then
background (x, y) := 122
elsif background (x, y) = 122 then
background (x, y) := 123
elsif background (x, y) = 123 then
background (x, y) := 120
end if
end if
if flowercounter > 20 then
if background (x, y) = 36 then
background (x, y) := 102
elsif background (x, y) = 102 then
background (x, y) := 103
elsif background (x, y) = 103 then
background (x, y) := 128
elsif background (x, y) = 128 then
background (x, y) := 36
end if
end if
Pic.Draw (pic (background (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
if watercounter > 30 then
watercounter := 0
else
watercounter += 1
end if
if flowercounter > 20 then
flowercounter := 0
else
flowercounter += 1
end if
end drawbackground
procedure barrier
j := 256
for x : 1 .. 8
i := 0
for y : 1 .. 10
if background (x, y) = 13 or background (x, y) = 14 or background (x, y) = 30 or background (x, y) = 31 or background (x, y) = 32 or background (x, y) = 51 or
background (x, y) = 52 or background (x, y) = 61 or background (x, y) = 62 or background (x, y) = 63 or background (x, y) = 64 or background (x, y) = 65 or
background (x, y) = 66 or background (x, y) = 67 or background (x, y) = 68 or background (x, y) = 69 or background (x, y) = 70 or background (x, y) = 71
or background (x, y) = 74 or background (x, y) = 75 or background (x, y) = 15 or background (x, y) = 16 or background (x, y) = 17 or background (x, y) = 106
or background (x, y) = 22 or background (x, y) = 23 or background (x, y) = 24 or background (x, y) = 25 or background (x, y) = 26 or background (x, y) = 27
or background (x, y) = 28 or background (x, y) = 29 or background (x, y) = 37 or background (x, y) = 38 or background (x, y) = 40 or background (x, y) = 41
or background (x, y) = 43 or background (x, y) = 44 or background (x, y) = 45 or background (x, y) = 46 or background (x, y) = 47 or background (x, y) = 48
or background (x, y) = 49 or background (x, y) = 53 or background (x, y) = 54 or background (x, y) = 55 or background (x, y) = 56 or background (x, y) = 57
or background (x, y) = 58 or background (x, y) = 73 or background (x, y) = 76 or background (x, y) = 18 or background (x, y) = 19 or background (x, y) = 20
or background (x, y) = 21 or background (x, y) = 59 or background (x, y) = 60 or background (x, y) = 80 or background (x, y) = 81 or background (x, y) = 82
or background (x, y) = 83 or background (x, y) = 84 or background (x, y) = 85 or background (x, y) = 86 or background (x, y) = 87 or background (x, y) = 88
or background (x, y) = 89 or background (x, y) = 90 or background (x, y) = 91 or background (x, y) = 92 or background (x, y) = 94 or background (x, y) = 108
or background (x, y) = 96 or background (x, y) = 96 or background (x, y) = 99 or background (x, y) = 100 or background (x, y) = 101 or background (x, y) = 107
or background (x, y) = 98 or background (x, y) = 109 or background (x, y) = 104 or background (x, y) = 114 or background (x, y) = 115 or background (x, y) = 113
or background (x, y) = 112 or background (x, y) = 120 or background (x, y) = 121 or background (x, y) = 122 or background (x, y) = 123 or background (x, y) = 124
or background (x, y) = 127 then
Draw.FillBox (i, j, i + 32, j + 32, 245)
end if
if background (x, y) = 14 or background (x, y) = 104 then
Draw.FillBox (i, j, i + 32, j + 32, 230)
end if
if background (x, y) = 42 then
Draw.FillBox (i + 16, j, i + 32, j + 32, 245)
end if
if background (x, y) = 72 or background (x, y) = 93 then
Draw.FillBox (i, j, i + 32, j + 16, 240)
end if
if background (x, y) = 95 then
if y ~= 10 then
if background (x, y + 1) = 95 then
Draw.FillBox (i + 8, j + 8, i + 32, j + 24, 235)
end if
else
Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
end if
if y ~= 1 then
if background (x, y - 1) = 95 then
Draw.FillBox (i, j + 8, i + 32, j + 24, 235)
else
Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
end if
end if
end if
i += 32
end for
j -= 32
end for
end barrier
procedure receivebackgroundinfo
file := "Levels/" + intstr (choice) + ".dat"
open : input, file, get
for x : 1 .. 8
for y : 1 .. 10
get : input, background (x, y)
end for
end for
end receivebackgroundinfo
procedure recievesecondaryinfo
file := "Levels/" + intstr (choice) + ".dat"
open : input, file, get
for x : 1 .. 8
for y : 1 .. 10
get : input, secondary (x, y)
end for
end for
close (input)
end recievesecondaryinfo
procedure drawconsole
var displayfull, outputx : int
Pic.Draw (console (1), 0, 0, picCopy)
Pic.Draw (positioning (1, 1).picture, 16, 4, picMerge)
Pic.Draw (positioning (1, 2).picture, 96, 4, picMerge)
displayfull := health div 2
outputx := 210
for b : 1 .. healthtotal
if b <= displayfull then
Pic.Draw (console (7), outputx, 20, picMerge)
elsif health mod 2 = 1 and b = displayfull + 1 then
Pic.Draw (console (6), outputx, 20, picMerge)
else
Pic.Draw (console (5), outputx, 20, picMerge)
end if
outputx += 15
end for
end drawconsole
procedure switch
end switch
procedure switchright
for m : 1 .. 40
j := 256
for x : 1 .. 8
i := 0 - (8 * m)
for y : 1 .. 10
Pic.Draw (pic (background (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
j := 256
for x : 1 .. 8
i := 320 - (8 * m)
for y : 1 .. 10
Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
drawconsole
View.Update
delay (12)
end for
end switchright
procedure switchleft
for m : 1 .. 40
j := 256
for x : 1 .. 8
i := 0 + (8 * m)
for y : 1 .. 10
Pic.Draw (pic (background (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
j := 256
for x : 1 .. 8
i := -320 + (8 * m)
for y : 1 .. 10
Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
drawconsole
View.Update
delay (12)
end for
end switchleft
procedure switchup
for m : 1 .. 32
j := 256 - (8 * m)
for x : 1 .. 8
i := 0
for y : 1 .. 10
Pic.Draw (pic (background (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
j := 508 - (8 * m)
for x : 1 .. 8
i := 0
for y : 1 .. 10
Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
drawconsole
View.Update
delay (12)
end for
end switchup
procedure switchdown
for m : 1 .. 32
j := 256 + (8 * m)
for x : 1 .. 8
i := 0
for y : 1 .. 10
Pic.Draw (pic (background (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
j := 6 + (8 * m)
for x : 1 .. 8
i := 0
for y : 1 .. 10
Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
i += 32
end for
j -= 32
end for
drawconsole
View.Update
delay (12)
end for
end switchdown
procedure secondarytoback
for x : 1 .. 8
for y : 1 .. 10
background (x, y) := secondary (x, y)
end for
end for
end secondarytoback
procedure ledgefalling
var flippingpics : int := 0
if whatdotcolour (playerx + 40, playery + 30) = 240 then
player := 21
loop
barrier
playery -= 3
if playery >= 228 then
choice := choice + 16
recievesecondaryinfo
switchup
playery := 2
secondarytoback
barrier
end if
if playery <= 2 then
choice := choice - 16
recievesecondaryinfo
switchdown
playery := 228
secondarytoback
barrier
end if
exit when whatdotcolour (playerx + 40, playery + 30) ~= 240 and whatdotcolour (playerx + 40, playery + 60) ~= 245 and whatdotcolour (playerx + 40, playery + 35) ~= 240 and
whatdotcolour (playerx + 40, playery + 30) ~= 245
if flippingpics > 10 then
if player = 21 then
player := 22
elsif player = 22 then
player := 23
else
player := 1
end if
end if
if flippingpics > 10 then
flippingpics := 0
else
flippingpics += 1
end if
drawbackground
Pic.Draw (playerpics (player), playerx, playery, picMerge)
View.Update
delay (7)
end loop
end if
end ledgefalling
procedure beinghurt
health -= 1
if health <= 0 then
player := 1
for x : 1 .. 14
cls
Pic.Draw (playerpics (player), playerx, playery, picMerge)
delay (200)
View.Update
if player = 4 then
player := 1
else
player += 1
end if
end for
cls
Pic.Draw (playerpics (20), playerx, playery, picMerge)
View.Update
delay (700)
choice := deathchoice
playerx := savepointx
playery := savepointy
health := 6
recievesecondaryinfo
secondarytoback
temp := choice
else
if player = 1 or player = 5 then
player := 1
for x : 1 .. 10
drawbackground
drawconsole
Pic.Draw (playerpics (player), playerx, playery, picMerge)
View.Update
if player = 1 then
player := 16
else
player := 1
end if
delay (40)
end for
player := 1
elsif player = 2 or player = 6 then
player := 2
for x : 1 .. 10
drawbackground
drawconsole
Pic.Draw (playerpics (player), playerx, playery, picMerge)
View.Update
if player = 2 then
player := 17
else
player := 2
end if
delay (40)
end for
player := 2
elsif player = 3 or player = 7 then
player := 3
for x : 1 .. 10
drawbackground
drawconsole
Pic.Draw (playerpics (player), playerx, playery, picMerge)
View.Update
if player = 3 then
player := 18
else
player := 3
end if
delay (40)
end for
player := 3
elsif player = 4 or player = 8 then
player := 4
for x : 1 .. 10
drawbackground
drawconsole
Pic.Draw (playerpics (player), playerx, playery, picMerge)
View.Update
if player = 4 then
player := 19
else
player := 4
end if
delay (40)
end for
player := 4
end if
end if
end beinghurt
procedure holefall
if whatdotcolour (playerx + 45, playery + 40) = 235 then
for l : 13 .. 15
drawbackground
drawconsole
Pic.Draw (playerpics (l), playerx, playery, picMerge)
View.Update
delay (200)
end for
if health > 1 then
playerx := deathpointx
playery := deathpointy
end if
beinghurt
end if
end holefall
procedure startmenu
var choosex, choosey, currentarray1, currentarray2, x1, y1, temp : int
choosex := 12
choosey := 210
drawbackground
currentarray1 := 2
currentarray2 := 1
for x : 1 .. 256 by 3
drawbackground
Pic.Draw (console (4), 0, -256 + x, picCopy)
View.Update
end for
delay (20)
cls
loop
Input.KeyDown (press)
Draw.FillBox (0, 0, 500, 500, white)
Pic.Draw (console (3), 0, 0, picCopy)
Pic.Draw (console (2), choosex, choosey, picMerge)
Pic.Draw (positioning (1, 1).picture, 16, 256, picMerge)
Pic.Draw (positioning (1, 2).picture, 96, 256, picMerge)
if press (KEY_UP_ARROW) then
if currentarray1 > 2 then
choosey := choosey + 50
currentarray1 := currentarray1 - 1
end if
end if
if press (KEY_DOWN_ARROW) then
if currentarray1 < 6 then
choosey := choosey - 50
currentarray1 := currentarray1 + 1
end if
end if
if press (KEY_RIGHT_ARROW) then
if currentarray2 = 1 then
choosex := choosex + 63
currentarray2 := currentarray2 + 1
end if
end if
if press (KEY_LEFT_ARROW) then
if currentarray2 = 2 then
choosex := choosex - 63
currentarray2 := currentarray2 - 1
end if
end if
if press (KEY_CTRL) then
temp := positioning (currentarray1, currentarray2).picture
positioning (currentarray1, currentarray2).picture := positioning (1, 1).picture
positioning (1, 1).picture := temp
temp := positioning (currentarray1, currentarray2).item
positioning (currentarray1, currentarray2).item := positioning (1, 1).item
positioning (1, 1).item := temp
delay (100)
end if
if press (KEY_ALT) then
temp := positioning (currentarray1, currentarray2).picture
positioning (currentarray1, currentarray2).picture := positioning (1, 2).picture
positioning (1, 2).picture := temp
temp := positioning (currentarray1, currentarray2).item
positioning (currentarray1, currentarray2).item := positioning (1, 2).item
positioning (1, 2).item := temp
delay (100)
end if
exit when press (KEY_ENTER)
x1 := 12
y1 := 260
for i : 2 .. 6
y1 -= 50
x1 := 12
for j : 1 .. 2
Pic.Draw (positioning (i, j).picture, x1, y1, picMerge)
x1 += 63
end for
end for
View.Update
delay (80)
end loop
for x : 1 .. 256 by 3
drawbackground
Pic.Draw (console (4), 0, 0 - x, picCopy)
Pic.Draw (positioning (1, 1).picture, 12, 258 - x, picMerge)
Pic.Draw (positioning (1, 2).picture, 92, 258 - x, picMerge)
View.Update
end for
end startmenu
weaponmovementcounter := 0
procedure buttonpresses (var current, whichbutton : int)
var number1, number2, bushslash, changepicx, changepicy : int
if positioning (1, whichbutton).item = 1 then
shieldmove := 1
elsif positioning (1, whichbutton).item = 2 then
barrier
if current = 1 or current = 5 then
number1 := 1
number2 := 4
if whatdotcolor (playerx + 53, playery + 12) = 230 then
bushslash := 1
else
bushslash := 0
end if
if whatdotcolor (playerx + 53, playery + 12) = 230 or whatdotcolor (playerx + 53, playery + 17) = 230 or whatdotcolor (playerx + 53, playery + 23) = 230 then
bushslash := 1
j := 256
for y : 1 .. 8
i := 0
for x : 1 .. 10
if playerx + 53 >= i and playerx + 53 <= i + 32 and ((playery + 12 >= j - 32 and playery + 12 <= j) or (playery + 17 >= j - 32 and playery + 17 <= j) or (playery + 23 >= j -
32 and playery + 23 <= j)) then
changepicx := y + 1
changepicy := x
end if
i += 32
end for
j -= 32
end for
else
bushslash := 0
end if
end if
if current = 2 or current = 6 then
number1 := 5
number2 := 8
if whatdotcolor (playerx + 75, playery + 37) = 230 or whatdotcolor (playerx + 70, playery + 37) = 230 or whatdotcolor (playerx + 65, playery + 37) = 230 then
bushslash := 1
j := 256
for y : 1 .. 8
i := 0
for x : 1 .. 10
if ((playerx + 75 >= i and playerx + 75 <= i + 32) or (playerx + 70 >= i and playerx + 70 <= i + 32) or (playerx + 65 >= i and playerx + 65 <= i + 32)) and playery + 37 >= j -
32 and playery + 37 <= j then
changepicx := y + 1
changepicy := x
end if
i += 32
end for
j -= 32
end for
else
bushslash := 0
end if
end if
if current = 3 or current = 7 then
number1 := 9
number2 := 12
if whatdotcolor (playerx + 36, playery + 80) = 230 or whatdotcolor (playerx + 36, playery + 75) = 230 or whatdotcolor (playerx + 36, playery + 70) = 230 then
bushslash := 1
j := 256
for y : 1 .. 8
i := 0
for x : 1 .. 10
if playerx + 36 >= i and playerx + 36 <= i + 32 and ((playery + 80 >= j - 32 and playery + 80 <= j) or (playery + 75 >= j - 32 and playery + 75 <= j) or (playery + 70 >= j -
32 and playery + 70 <= j)) then
changepicx := y + 1
changepicy := x
end if
i += 32
end for
j -= 32
end for
else
bushslash := 0
end if
end if
if current = 4 or current = 8 then
number1 := 13
number2 := 16
if whatdotcolor (playerx + 10, playery + 37) = 230 or whatdotcolor (playerx + 15, playery + 37) = 230 or whatdotcolor (playerx + 20, playery + 37) = 230 then
bushslash := 1
j := 256
for y : 1 .. 8
i := 0
for x : 1 .. 10
if ((playerx + 10 >= i and playerx + 10 <= i + 32) or (playerx + 15 >= i and playerx + 15 <= i + 32) or (playerx + 20 >= i and playerx + 20 <= i + 32)) and playery + 37 >= j -
32 and playery + 37 <= j then
changepicx := y + 1
changepicy := x
end if
i += 32
end for
j -= 32
end for
else
bushslash := 0
end if
end if
if bushslash = 1 and background (changepicx, changepicy) = 14 then
background (changepicx, changepicy) := 50
secondary (changepicx, changepicy) := 50
elsif bushslash = 1 and background (changepicx, changepicy) = 104 then
background (changepicx, changepicy) := 105
secondary (changepicx, changepicy) := 105
end if
for l : number1 .. number2
drawbackground
drawconsole
if bushslash = 1 then
if l = number1 then
Pic.Draw (pic (130), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
elsif l = number1 + 1 then
Pic.Draw (pic (131), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
elsif l = number1 + 2 then
Pic.Draw (pic (132), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
elsif l = number1 + 3 then
Pic.Draw (pic (133), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
end if
end if
Pic.Draw (swinging (l), playerx, playery, picMerge)
View.Update
delay (40)
end for
end if
end buttonpresses
|