
-----------------------------------
msimard8
Mon Nov 29, 2004 8:26 pm

animating with background
-----------------------------------
I know this background does not cover the whole window by Why doesn't this background show up


proc firelevel
    drawfillbox (1, 133, 679, 479, red)

    color (red)
    locate (23, 67)
    put "Firey Cavern"

    %....................................................central level
    drawfilloval (330, 280, 90, 90, 137)

    %....................................................boss platform
    drawfilloval (600, 420, 60, 70, 137)

    colourback (red)
    locate (9, 75)
    color (white)
    put "Boss"


    %....................................................extends pathways
    for c : 1 .. 50
        %................................................pathways
        drawline (0, 100 + c, 679, 429 + c, 137)     %.......left to right
        drawline (650, 130 + c, 0, 479 + c, 137)
    end for

end firelevel


setscreen ("offscreenonly")
proc manstill (x, y : int)

    %....................................................back attenna
    drawline (35 + x, 111 + y, 28 + x, 131 + y, black)
    drawline (28 + x, 131 + y, 39 + x, 131 + y, black)
    %....................................................head
    drawfilloval (40 + x, 103 + y, 16, 18, green)

    %....................................................eyes
    drawfilloval (45 + x, 110 + y, 3, 3, white)
    drawoval (45 + x, 110 + y, 3, 3, black)
    drawdot (45 + x, 110 + y, black)

    %....................................................nose
    drawfilloval (55 + x, 106 + y, 6, 6, green)

    %....................................................mouth
    drawoval (46 + x, 98 + y, 10, 3, black)
    drawfillbox (36 + x, 98 + y, 56 + x, 101 + y, green)

    %....................................................front attenna
    drawline (31 + x, 111 + y, 24 + x, 131 + y, black)
    drawline (24 + x, 131 + y, 35 + x, 131 + y, black)
    drawoval (38 + x, 129 + y, 3, 3, black)

    %...................................................legs
    drawfillbox (35 + x, 23 + y, 45 + x, 10 + y, blue) %..................right
    drawbox (35 + x, 23 + y, 45 + x, 10 + y, black)
    drawfilloval (45 + x, 8 + y, 20, 5, brown)
    drawoval (45 + x, 8 + y, 20, 5, black)

    drawfillbox (30 + x, 23 + y, 40 + x, 10 + y, blue) %..................left
    drawbox (30 + x, 23 + y, 40 + x, 10 + y, black)
    drawfilloval (45 + x, 5 + y, 20, 5, brown)
    drawoval (45 + x, 5 + y, 20, 5, black)

    %....................................................body
    drawfilloval (40 + x, 50 + y, 20, 28, purple)

    %....................................................neck
    drawfilloval (40 + x, 67 + y, 10, 20, purple)

    %....................................................side arm
    drawfilloval (40 + x, 50 + y, 7, 18, purple)
    drawoval (40 + x, 50 + y, 7, 18, black)
    drawfilloval (40 + x, 30 + y, 8, 5, 90) %.....................hand

end manstill

%mainline

firelevel

for i : 50 .. 200
    cls
    manstill (i, i)
    View.Update
    delay (10)
end for

thanks

-----------------------------------
AsianSensation
Mon Nov 29, 2004 8:35 pm


-----------------------------------
make sure you draw the background in the loop, so when you cls it, it gets redrawn.

so something like this:

for i : 50 .. 200
    cls
    firelevel
    manstill (i, i)
    View.Update
    delay (10)
end for

moving your firelevel proc inside the for loop.

-----------------------------------
bill_ion_boi
Thu Dec 02, 2004 10:45 pm


-----------------------------------
im having a problem similar to this, as a pictures location changes it leaves the exess prepositioned pictures behind. Cls ing a loop will really slow the program down...is their another way?
