%Variables Dictionary
%declare variable by name and type
var picID : int %.......................................sets aside memory and names it for gamepiece
var picIDback : int %...................................sets aside memory and names it for background
var chars : array char of boolean %.....................sets up keystroke decisions true or false
var key : string (1)
var y : int := 0
var x : int := 0
%*********************************
%
%
%*********************************
%Procedures/Subprograms/Subroutines
%do each seperatly in a block
%><><><><><><><><><><><><><><><><>ORBITAL CANNON GAMEPIECE MADE WITHM OSTLY DRAWFILL BOX'S AND LINES
proc gamepiece (x : int, y : int)
drawfillbox (82, 60, 120, 100, grey) %...........main box
drawbox (82, 60, 120, 100, black)
drawfillbox (98, 100, 104, 133, yellow) %........yellow cannon shaft
drawbox (98, 100, 104, 133, black)
drawline (96, 102, 106, 102, red)
drawline (96, 102 + 2, 106, 102 + 2, red)
drawline (96, 102 + 4, 106, 102 + 4, red)
drawline (96, 102 + 6, 106, 102 + 6, red)
drawline (96, 102 + 8, 106, 102 + 8, red)
drawline (96, 102 + 10, 106, 102 + 10, red) %....red conductors on cannon shaft
drawline (96, 102 + 12, 106, 102 + 12, red)
drawline (96, 102 + 14, 106, 102 + 14, red)
drawline (96, 102 + 16, 106, 102 + 16, red)
drawline (96, 102 + 18, 106, 102 + 18, red)
drawline (96, 102 + 20, 106, 102 + 20, red)
drawline (96, 102 + 22, 106, 102 + 22, red)
drawline (96, 102 + 24, 106, 102 + 24, red)
drawline (96, 102 + 26, 106, 102 + 26, red)
drawline (96, 102 + 28, 106, 102 + 28, red)
drawline (95, 133, 107, 133, black) %...........tip of laser
drawline (95, 133, 99, 143, black)
drawline (107, 133, 103, 143, black)
drawline (99, 143, 103, 143, black)
drawoval (101, 80, 5, 5, black) %...............mainbody detail
drawoval (101, 80, 8, 12, black)
drawfilloval (101, 80, 2, 2, red)
drawline (85, 63, 85, 97, red)
drawline (117, 63, 117, 97, red)
drawline (88, 66, 88, 94, red)
drawline (114, 66, 114, 94, red)
drawline (82, 78, 74, 76, black) %..............left thruster
drawline (74, 76, 74, 86, black)
drawline (74, 86, 82, 84, black)
drawline (120, 78, 128, 76, black) %............right thruster
drawline (128, 76, 128, 86, black)
drawline (128, 86, 120, 84, black)
drawfill (124, 80, grey, black) %...............Fills right thruster with colour
drawfill (77, 80, grey, black) %................Fills left thruster with colour
drawfill (101, 138, grey, black) %..............Fills left thruster with colour
drawfillbox (92, 55, 110, 60, grey) %...........Lil box on the bottom of body
drawbox (91, 55, 110, 60, black)
end gamepiece
%<><><><><><><><><><><><><><><><><><><><><><><><><><>STARS
proc dots
drawfilloval (150, 50, 1, 1, 92)
end dots
%><><><><><><><><><><><><><><><><><><><><><><><><><><SPACE BACKROUND
proc background
drawfillbox (0, 0, 639, 479, 17)
%dots
end background
%><><><><><><><><><><><><><><><><><><><><><><><><><><INTRODUCTION
proc instructions
for c : 1 .. 20 by 5
drawbox (0 + c, 0 + c, 639 - c, 479 - c, c)
end for
locate (8, 22)
put "Revenge of the Kuley Clones!" ..
locate (9, 31)
put "INSTRUCTIONS" ..
locate (11, 12)
put "Destroy as many Kuley clones as possible to Increase your score" ..
locate (13, 28)
put "RIGHT ARROW - MOVE RIGHT" ..
locate (15, 28)
put "LEFT ARROW - MOVE LEFT" ..
locate (16, 28)
put "SPACE - SHOOT" ..
locate (25, 25)
put "touch anykey to continue" ..
View.Update
getch (key)
end instructions
%*********************************
%
%
%*********************************
%Mainline
%step by step enter the program
instructions
gamepiece (0, 0)
drawbox (68, 48, 135, 145, black)
picID := Pic.New (48, 48, 152, 152) %..............Screencapture for gamepiece
Pic.Draw (picID, 100, 100, picMerge)
background
picIDback := Pic.New (0, 0, 639, 479) %............Screencapture for background
Pic.Draw (picIDback, 0, 0, picCopy)
View.Update
put picID
put picIDback
setscreen ("offscreenonly")
loop %.............................................Repeats for keystroke action
Input.KeyDown (chars)
locate (1, 1)
if chars (KEY_RIGHT_ARROW) then %..............checks for right arrow key
x := x + 5
end if
if chars (KEY_LEFT_ARROW) then %.................checks for left arrow key
x := x - 5
end if
if chars (' ') then%..........................................where i will insert shooting action
end if
%..............................................prevents gamepiece from going left offscreen
if x < 0 then
x := x + 5
end if
%..............................................prevents gamepiece from going right offscreen
if x > 540 then
x := x - 5
end if
locate (20, 20) %...............................location of coords below
put x : 5 .. %..................................shows coords
Pic.Draw (picID, x, y, picMerge)
View.Update
Pic.Draw (picIDback, x, y, picCopy)
end loop
%*********************************
|