randomize
View.Set ("graphics:300;300,nobuttonbar")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
type projectile_t :
record
sx, sy, x, y, angle, g, vel : real
end record
var screen : array 1 .. 300, 1 .. 300 of boolean
const maprandomn := 40
const mingh := 50
const maxgh := 60
const maxgd := 6
var x, y, x1, x2, ii := 0
var xs, ys : array 1 .. maprandomn of int
var picID : array 1 .. 100 of int
var proj1 : projectile_t
proj1.sx := 0
proj1.sy := 70
proj1.vel := Rand.Int (20, 80)
proj1.angle := 60
proj1.g := Rand.Int (15, 20)
var time1 := 0.0
picID (3) := Pic.FileNew ("flw.bmp")
picID (4) := Pic.FileNew ("finger.bmp")
procedure Projectile (var obj : projectile_t, t : real)
obj.x := (obj.vel * cosd (obj.angle) * t) + obj.sx
obj.y := (obj.vel * sind (obj.angle) * t - obj.g * t ** 2 / 2) + obj.sy
end Projectile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
colorback (black)
cls
xs (1) := 0
xs (maprandomn) := 300
for i : 2 .. maprandomn - 1
xs (i) := Rand.Int (round ((i - .5) * (300 / maprandomn)), round ((i + .5) * (300 / maprandomn)))
end for
ys (1) := Rand.Int (mingh, maxgh)
for i : 2 .. maprandomn
ys (i) := Rand.Int (ys (i - 1) - maxgd, ys (i - 1) + maxgd)
end for
for i : 1 .. maprandomn - 1
drawline (xs (i), ys (i), xs (i + 1), ys (i + 1), 10)
end for
drawfill (10, 0, 10, 10)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Flower%%%%%%%%%%%%%%%
for xxx : 1 .. 300
for yyy : 1 .. 300
if whatdotcolor (xxx, yyy) not= black then
if Rand.Int (1, 900) = 15 then
%drawfilloval (xxx, yyy, 5, 5, Rand.Int (1, 16))
case Rand.Int (1, 2) of
label 1 :
Pic.Draw (picID (3), xxx, yyy, 2)
label 2 :
Pic.Draw (picID (4), xxx, yyy, 2)
end case
end if
end if
end for
end for
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Pic.ScreenSave (1, 1, 299, 299, "sc1.BMP")
locatexy ((maxx - 100) div 2, maxy div 2)
color (white)
put "Loading ..."
for xxx : 1 .. 300
for yyy : 1 .. 300
if whatdotcolor (xxx, yyy) not= black then
screen (xxx, yyy) := true
else
screen (xxx, yyy) := false
end if
end for
end for
for xxx : 1 .. 300
for yyy : 1 .. 300
if screen (xxx, yyy) then
drawdot (xxx, yyy, white)
else
drawdot (xxx, yyy, black)
end if
end for
end for
View.Set ("offscreenonly")
picID (1) := Pic.FileNew ("gren.bmp")
picID (2) := Pic.FileNew ("sc1.bmp")
cls
procedure updatescreen
View.Update
Pic.ScreenSave (1, 1, 299, 299, "sc1.BMP")
picID (2) := Pic.FileNew ("sc1.bmp")
end updatescreen
loop
time1 += .05
Projectile (proj1, time1)
Pic.Draw (picID (2), 1, 1, 0)
Pic.Draw (picID (1), round (proj1.x), round (proj1.y), 2)
locate (1, 1)
%put round (proj1.x), "/", round (proj1.x)
if round (proj1.x) < upper (screen, 1) and round (proj1.y) < upper (screen, 2) and round (proj1.y) > 0 and round (proj1.x) > 0 then
if screen (round (proj1.x), round (proj1.y)) then
proj1.sx := proj1.x
proj1.sy := proj1.y
proj1.vel /= 1.4
proj1.vel -= 2
if proj1.vel <= 0 then
proj1.sx := 0
proj1.sy := 70
proj1.vel := Rand.Int (20, 80)
proj1.angle := 60
proj1.g := Rand.Int (15, 20)
time1 := 0.0
for iii : 1 .. 20
drawfilloval (round (proj1.x), round (proj1.y), iii, iii, 12)
View.Update
delay (5)
end for
drawfilloval (round (proj1.x), round (proj1.y), 20, 20, black)
updatescreen
for xxx : 1 .. 300
for yyy : 1 .. 300
if whatdotcolor (xxx, yyy) not= black then
screen (xxx, yyy) := true
else
screen (xxx, yyy) := false
end if
end for
end for
end if
%proj1.angle -= 1
%proj1.g := Rand.Int (15, 20)
time1 := 0.0
end if
end if
if round (proj1.y) <= 0 then
proj1.sx := 0
proj1.sy := 70
proj1.vel := Rand.Int (20, 80)
proj1.angle := 60
proj1.g := Rand.Int (15, 20)
time1 := 0.0
for iii : 1 .. 20
drawfilloval (round (proj1.x), round (proj1.y), iii, iii, 12)
View.Update
delay (5)
end for
drawfilloval (round (proj1.x), round (proj1.y), 20, 20, black)
updatescreen
for xxx : 1 .. 300
for yyy : 1 .. 300
if whatdotcolor (xxx, yyy) not= black then
screen (xxx, yyy) := true
else
screen (xxx, yyy) := false
end if
end for
end for
end if
if proj1.x >= upper (screen, 1) then
proj1.sx := 300
proj1.sy := proj1.y
proj1.vel := 0 - (proj1.vel - (proj1.vel / 3))
time1 := 0.0
end if
View.Update
%cls
end loop
|