%52,42 is starting locations
%Adding 40 as upward movement - 442 is over
%Adding 40 as rightward movement - 652 is over
%Character Last Move Notes -Number- -Dir. Facing-
% 1 Up
% 2 Down
% 3 Left
% 4 Right
process bullet_shoot_up
loop
by_loc := by_loc + 40
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_b_u, bx_loc, by_loc, picMerge)
exit when by_loc = 362
delay (100)
end loop
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
end bullet_shoot_up
process bullet_shoot_down
loop
by_loc := by_loc - 40
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_b_d, bx_loc, by_loc, picMerge)
exit when by_loc = 82
delay (100)
end loop
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
end bullet_shoot_down
process bullet_shoot_left
loop
bx_loc := bx_loc - 40
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_b_l, bx_loc, by_loc, picMerge)
exit when by_loc = 92
delay (100)
end loop
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
end bullet_shoot_left
process bullet_shoot_right
loop
bx_loc := bx_loc + 40
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_b_r, bx_loc, by_loc, picMerge)
exit when by_loc = 572
delay (100)
end loop
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
end bullet_shoot_right
process char_movement
x_loc := 52
y_loc := 42
loop
getch (char_move)
if char_move = "w" then %-------------------------------Move Up-----------------------------------------------------
if y_loc = 402 then %Stops character from moving off the screen on the top
% Checks to see if new coordinates are 'landmarks' and cannot be moved on
elsif y_loc = 82 and x_loc = 92 then
elsif y_loc = 82 and x_loc = 132 then
elsif y_loc = 202 and x_loc = 252 then
elsif y_loc = 202 and x_loc = 292 then
elsif y_loc = 202 and x_loc = 332 then
elsif y_loc = 202 and x_loc = 372 then
elsif y_loc = 202 and x_loc = 412 then
elsif y_loc = 202 and x_loc = 452 then
elsif y_loc = 322 and x_loc = 52 then
elsif y_loc = 362 and x_loc = 92 then
elsif y_loc = 362 and x_loc = 532 then
elsif y_loc = 362 and x_loc = 572 then
elsif y_loc = 362 and x_loc = 612 then
elsif y_loc = 42 and x_loc = 532 then
elsif y_loc = 82 and x_loc = 572 then
elsif y_loc = 122 and x_loc = 612 then
else
y_loc := y_loc + 40 %Allows the character to move
end if
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_u, x_loc, y_loc, picMerge)
char_last_move := 1
elsif char_move = "s" then %----------------------------Move Down--------------------------------------------------
if y_loc = 42 then %Stops character from moving off the screen on the bottom
% Checks to see if new coordinates are 'landmarks' and cannot be moved on
elsif y_loc = 82 and x_loc = 92 then
elsif y_loc = 82 and x_loc = 132 then
elsif y_loc = 282 and x_loc = 252 then
elsif y_loc = 282 and x_loc = 292 then
elsif y_loc = 282 and x_loc = 332 then
elsif y_loc = 282 and x_loc = 372 then
elsif y_loc = 282 and x_loc = 412 then
elsif y_loc = 282 and x_loc = 452 then
elsif y_loc = 322 and x_loc = 572 then
elsif y_loc = 242 and x_loc = 612 then
elsif y_loc = 162 and x_loc = 532 then
elsif y_loc = 122 and x_loc = 492 then
elsif y_loc = 82 and x_loc = 452 then
elsif y_loc = 282 and x_loc = 92 then
elsif y_loc = 282 and x_loc = 132 then
else
y_loc := y_loc - 40 %Allows the character to move
end if
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_d, x_loc, y_loc, picMerge)
char_last_move := 2
elsif char_move = "a" then %-----------------------------Move Left---------------------------------------------------
if x_loc = 52 then %Stops character from moving off the screen on the left
% Checks to see if new coordinates are 'landmarks' and cannot be moved on
elsif x_loc = 172 and y_loc = 42 then
elsif x_loc = 172 and y_loc = 122 then
elsif x_loc = 172 and y_loc = 162 then
elsif x_loc = 172 and y_loc = 202 then
elsif x_loc = 172 and y_loc = 242 then
elsif x_loc = 492 and y_loc = 242 then
elsif x_loc = 92 and y_loc = 362 then
elsif x_loc = 132 and y_loc = 402 then
elsif x_loc = 612 and y_loc = 282 then
elsif x_loc = 612 and y_loc = 242 then
elsif x_loc = 612 and y_loc = 122 then
elsif x_loc = 572 and y_loc = 82 then
elsif x_loc = 532 and y_loc = 42 then
else
x_loc := x_loc - 40 %Allows the character to move
end if
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_l, x_loc, y_loc, picMerge)
char_last_move := 3
elsif char_move = "d" then %-----------------------------Move Right--------------------------------------------------
if x_loc = 612 then %Stops character from moving off the screen on the right
% Checks to see if new coordinates are 'landmarks' and cannot be moved on
elsif x_loc = 52 and y_loc = 42 then
elsif x_loc = 52 and y_loc = 122 then
elsif x_loc = 52 and y_loc = 162 then
elsif x_loc = 52 and y_loc = 202 then
elsif x_loc = 52 and y_loc = 242 then
elsif x_loc = 212 and y_loc = 242 then
elsif x_loc = 492 and y_loc = 402 then
elsif x_loc = 532 and y_loc = 282 then
elsif x_loc = 532 and y_loc = 242 then
elsif x_loc = 532 and y_loc = 202 then
elsif x_loc = 532 and y_loc = 162 then
elsif x_loc = 492 and y_loc = 122 then
elsif x_loc = 452 and y_loc = 82 then
elsif x_loc = 412 and y_loc = 42 then
else
x_loc := x_loc + 40 %Allows the character to move
end if
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy) %Load Background
Pic.Draw (pic_r, x_loc, y_loc, picMerge)
char_last_move := 4
elsif char_move = " " %--------------------------------------Shoot--------------------------------------------------
then
if char_last_move = 1 then
by_loc := y_loc
bx_loc := x_loc
fork bullet_shoot_up
elsif char_last_move = 2 then
by_loc := y_loc
bx_loc := x_loc
fork bullet_shoot_down
elsif char_last_move = 3 then
by_loc := y_loc
bx_loc := x_loc
fork bullet_shoot_left
elsif char_last_move = 4 then
by_loc := y_loc
bx_loc := x_loc
fork bullet_shoot_right
else
end if
elsif char_move = "t" then %--------------------------------Teleport------------------------------------------------
if x_loc = 612 and y_loc = 242 then %Checks to see if character is on the teleporter coordinates
Pic.ScreenLoad ("tele_flash.bmp", 612, 242, picMerge)
delay (500)
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
Pic.ScreenLoad ("tele_flash.bmp", 532, 42, picMerge)
delay (500)
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
Pic.ScreenLoad ("top_r.bmp", 532, 42, picMerge)
x_loc := 532
y_loc := 42
char_last_move := 4
elsif x_loc = 532 and y_loc = 42 then
Pic.ScreenLoad ("tele_flash.bmp", 532, 42, picMerge)
delay (500)
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
Pic.ScreenLoad ("tele_flash.bmp", 612, 242, picMerge)
delay (500)
Pic.ScreenLoad ("m2.bmp", 50, 40, picCopy)
Pic.ScreenLoad ("top_u.bmp", 612, 242, picMerge)
x_loc := 612
y_loc := 242
char_last_move := 1
else
end if
elsif char_move = "e" then %-------------------------------Exit Level-----------------------------------------------
if x_loc = 612 and y_loc = 122 then %Checks to see if the character is on the exit level coordinates
delay (1000)
drawfillbox (33, 33, maxx - 33, maxy - 53, black)
Font.Draw ("Level 1 Complete", 230, 300, FontID3, blue)
delay (1000)
Font.Draw ("Good Job", 290, 270, FontID3, blue)
exit
else
end if
else
end if
end loop
end char_movement |