
-----------------------------------
dani190
Fri Dec 16, 2005 5:17 pm

need help with smoke have code [b]please help[/b]
-----------------------------------

setscreen ("graphics:max,max,offscreenonly")



colorback (black)
var row, column : int
var x : int
x := 1
cls





var v : int
var u : int
var c : int
var count : int
var g : int
var k : int


loop


    %-------------------------------------------------------------------------HOUSE
    g := 1300
    k := 600

    Draw.FillBox (150, 50, 400, 250, brightred)     %Main house box
    Draw.FillBox (401, 50, 620, 160, brightgreen)   %Garage
    Draw.FillBox (420, 50, 601, 140, brightblue)    %Garage Door

    Draw.FillBox (350, 140, 300, 170, grey)         %Main house window Right side
    Draw.FillBox (200, 140, 250, 170, grey)         %Main house window Left side
    Draw.FillBox (1800, 1, 1, 50, green)            % Road in front
    Draw.FillBox (250, 110, 200, 50, grey)          %Door
    drawfillbox (205, 250, 250, 450, red)           %Chiminy



    delay (1)
    %--------------------------------------------------------------------------^^^^^HOUSE END
    %--------------------------------------------------------------------------ROOF
    var h : array 1 .. 4 of int := init (150, 400, 270, 10)
    var d : array 1 .. 4 of int := init (250, 250, 400, 10)
    Draw.FillPolygon (h, d, 3, 1)
    %---------------------------------------------------------------------------ROOF END
    loop
        %---------------------------------------------------------------------------STARS
        delay (100)
        randint (row, 1, 20)
        randint (column, 1, 158)
        locate (row, column)
        color (white)
        put "*"



        %----------------------------------------------------------------------------STARS END
        %----------------------------------------------------------------------------moon start
        g := g - 25
        k := k + 5



        Draw.FillOval (g, k, 30, 30, white)
        View.Update
        Draw.FillOval (g, k, 30, 30, black)






        %-----------------------------------------------------------------------------moon end
        %-----------------------------------------------------------------------------smoke start

        var counter := 1

        var Pic1 : int
        var Pic2 : int
        var y:int
        x:= 50
        y:=20
        loop
            Pic1 := Pic.FileNew ("smoke1.bmp")
            Pic2 := Pic.FileNew ("smoke2.bmp")

            counter := (counter + 1) mod 2
            if counter = 1 then
                Pic.Draw (Pic1, x, y, picMerge)
            else
                Pic.Draw (Pic2, x, y, picMerge)
            end if
        end loop

    end loop
end loop

ok thats my coding i just need the pic part but i dont know how to get it to show up on the screen and locate it ontop of the smoke stack
could somebody please help me with this

-----------------------------------
Tony
Fri Dec 16, 2005 6:01 pm


-----------------------------------
When you draw your picture

                Pic.Draw (Pic1, x, y, picMerge) 

the x,y is the location of picture's bottom left corner.

Since you draw your chiminy at

drawfillbox (205, 250, 250, 450, red)           %Chiminy 

Then

        x:= 205
        y:= 450

Would place you in a general location you're looking for.. at that point you can adjust those values +/- as you need to make a better fit

-----------------------------------
dani190
Fri Dec 16, 2005 6:13 pm


-----------------------------------
thanks a lot will help a lot

-----------------------------------
dani190
Fri Dec 16, 2005 6:15 pm


-----------------------------------
how do i create the smoke (in paint?)

-----------------------------------
Geminias
Fri Dec 16, 2005 6:36 pm


-----------------------------------
use the spray can, get some white and grey and pretend your a kindergarden again  :lol: 

dani, the point of code is so that it's understandable to humans.  Code = understandable, binary = machine code.  

if you use variable names that do not describe themselves you mine as well write binary.  Get the point?

-----------------------------------
dani190
Fri Dec 16, 2005 6:45 pm


-----------------------------------
well yes but iv already used those variables i cant use em again

-----------------------------------
dani190
Fri Dec 16, 2005 9:08 pm


-----------------------------------
i cant get this smoke to work like it is either to straight or looks so bad, also it always says that it was not sucessfully created and ends right when my moon comes out. could somebody plz look at my code and help me out here?

-----------------------------------
dani190
Sat Dec 17, 2005 10:11 am


-----------------------------------
guys im very sorry for all of the spamming i will try this more my self, if anyone can help me it would be great 
Thanks
