
-----------------------------------
Codi
Mon May 15, 2006 8:52 am

A Car Movie
-----------------------------------

View.Set (" nocursor, graphics: 600; 400")

proc car (x, y, length, height, clr : int)
    Draw.FillBox (x, y, x + length, y + height, yellow) % body of car
    Draw.FillOval (x + length div 4, y, height div 5, height div 5, black) % wheels
    Draw.FillOval (x + 3 * length div 4, y, height div 5, height div 5, black)
    Draw.Arc (x + length div 2, y + height, length div 4, length div 6, 0, 180, clr) %roof  of car
end car
proc carErase (x, y, length, height, clr : int)
    Draw.FillBox (x, y, x + length, y + height, clr) % body of car
    Draw.FillOval (x + length div 4, y, height div 5, height div 5, black) % wheels
    Draw.FillOval (x + 3 * length div 4, y, height div 5, height div 5, black)
    Draw.Arc (x + length div 2, y + height, length div 4, length div 6, 0, 180, clr) %roof  of car
end carErase

proc house (x, y, size : int)
    Draw.FillBox (x, y, x + size, y + size, red) % main house
    Draw.Line (x, y + size, x + size div 2, y + 3 * size div 2, red) % roof
    Draw.Line (x + size div 2, y + 3 * size div 2, x + size, y + size, red)
    Draw.Fill (x + size div 2, y + size + 1, red, red) % fill in roof
end house

proc scene (x, y : int)
    Draw.FillBox (x, y + maxy div 2, maxx, maxy, blue) % sky
    Draw.FillBox (x, y, maxx, maxy div 2, green) % green
end scene

proc animation1 % car moves across screene
    var speed : int := 5
    scene (0, 0)
    house (250, 120, 75)
    house (350, 120, 75)
    house (450, 120, 75)
    for x : 0 .. maxx by speed
        car (x, 60, 100, 40, brightred) % draw carin new spot
        delay (50)
        carErase (x, 60, 100, 40, green)
    end for
end animation1

proc animation2
    var x : int := 0
    var speed : int := 5
    scene (0, 0)
    loop
        car (maxx div 2 - 100, maxy div 4, 100, 40, brightred)
        delay (75)
        scene (0, 0)
        house (x + maxx, 120, 75)
        house (x + maxx, -100, 75)
        house (x + maxx, -200, 75)
        x := x - speed
        if x < -maxx then
            x := 0
            
        end if
        speed:= speed+ 10
    end loop
end animation2
% mainline
animation1
cls
animation2


-----------------------------------
sylvester-27
Tue May 16, 2006 11:49 am


-----------------------------------
you might want to clean up the animation with some View.Update

-----------------------------------
Voltage128
Sat Dec 02, 2006 10:58 pm


-----------------------------------
Yes, i agree with sylvester-27. This movie could look a lot better if you used View.Update. Also it is a little weak on the detail. You could make it better by taking some time and touching up the houses and car. Also adding simple things such as moving clouds in the backround would make it more appealing.

-----------------------------------
ericfourfour
Sun Dec 03, 2006 12:43 am


-----------------------------------
This topic's going on 6 months Voltage128. Try not to bring up old topics unless it is important.

-----------------------------------
Voltage128
Sun Dec 03, 2006 1:12 am


-----------------------------------
sorry man, didnt even read dates. wont happen again. I was just looking through programs.
