
-----------------------------------
Homer_simpson
Tue Dec 02, 2003 12:30 am

Turing worms... Worth a shot?
-----------------------------------
here's some shit i made up in 1 hour when i was bored and angry... the idea is like worms... to have different gadgets(bombs,missiles,...) and stuffs... right now it's got a simple projectile as grenade...nothing fancy with graphics... NO WHATDOTCOLOR collision detection involved what so ever  :lol: ...
but w/e if u guys like it and wanna help me make some nice graphics for the came i could finish it and send u the code to give yer teacher for yer isu... :P

-----------------------------------
Homer_simpson
Tue Dec 02, 2003 1:24 am


-----------------------------------
here's this one with a little bit improvement in projectile movement...

-----------------------------------
Tony
Tue Dec 02, 2003 10:06 am


-----------------------------------
error on line 61 - picture was not successfuly created :? (picID = 0)

-----------------------------------
Homer_simpson
Tue Dec 02, 2003 6:41 pm


-----------------------------------
well cuz u gotto download the pictures that are in the first file first  :roll:

-----------------------------------
Homer_simpson
Wed Dec 03, 2003 9:12 pm


-----------------------------------
well... since no one's interested...
here's the code:
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 