/*A space program rather...You control the ship with your mouse, and there are limits so you cannot go off of
the screen. Till' further notice, this program stays the way it is*/
setscreen ("offscreenonly;graphics:1000;800;position:center;center;nobuttonbar;nocursor;title:Space Game 1.1")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Variables
var shipx, shipy, b : int
var x, y, button, left, middle, right : int
var bulletx, bullety : int
%Variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Background
type stars :
record
starx : int
stary : int
color1 : int
sizex : int
sizey : int
end record
var star : array 1 .. 200 of stars
for i : 1 .. 200
randint (star (i).starx, 1, 1000)
randint (star (i).stary, 1, 1000)
randint (star (i).sizex, 1, 2)
randint (star (i).sizey, 1, 2)
randint (star (i).color1, 1, 255)
end for
%Background
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Background
proc background
colorback (7)
cls
for i : 1 .. 200
drawfilloval (star (i).starx, star (i).stary, star (i).sizex, star (i).sizey, 0)
star (i).stary -= 3
if star (i).stary < 0 then
randint (star (i).starx, 1, 1000)
randint (star (i).stary, 1, 1000)
end if
end for
end background
%Background
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Ship
proc ship
mousewhere (shipx, shipy, b)
drawfillbox (shipx, 0, shipx + 30, 90, yellow)
drawfillbox (shipx + 100, 0, shipx + 68, 90, yellow)
drawfillbox (shipx + 70, 140, shipx + 30, 40, yellow)
drawfillbox (shipx + 60, 120, shipx + 40, 60, 7)
%Boundries
if shipx < 0 then
cls
background
drawfillbox (30, 0, 0, 90, yellow)
drawfillbox (100, 0, 68, 90, yellow)
drawfillbox (70, 140, 30, 40, yellow)
drawfillbox (60, 120, 40, 60, 7)
end if
if shipx > 900 then
cls
background
drawfillbox (970, 0, 1000, 90, yellow)
drawfillbox (900, 0, 930, 90, yellow)
drawfillbox (930, 140, 970, 40, yellow)
drawfillbox (940, 120, 960, 60, 7)
end if
%Boundries
end ship
%Ship
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Shoot
proc shoot1
bullety := 140
bulletx := shipx
loop
bullety += 8
drawfillbox (shipx, bullety, shipx + 35, bullety + 35, 0)
View.Update
background
ship
if bullety > 800 then
if b = 1 then
bullety := 140
end if
end if
end loop
end shoot1
%Shoot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Mouse Shoot
proc mouse_shoot
mousewhere (x, y, b)
color (0)
buttonchoose ("multibutton")
mousewhere (x, y, button)
left := button mod 10
middle := (button - left) mod 100
right := button - middle - left
if left = 1 then
shoot1
if bullety > 800 then
bullety := 140
end if
end if
if right = 100 then
end if
end mouse_shoot
%Mouse Shoot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
loop
background
ship
mouse_shoot
delay (5)
View.Update
end loop
|