Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 need help with smoke have code [b]please help[/b]
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dani190




PostPosted: Fri Dec 16, 2005 5:17 pm   Post subject: need help with smoke have code [b]please help[/b]

code:

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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Dec 16, 2005 6:01 pm   Post subject: (No subject)

When you draw your picture
code:

                Pic.Draw (Pic1, x, y, picMerge)

the x,y is the location of picture's bottom left corner.

Since you draw your chiminy at
code:

drawfillbox (205, 250, 250, 450, red)           %Chiminy

Then
code:

        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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
dani190




PostPosted: Fri Dec 16, 2005 6:13 pm   Post subject: (No subject)

thanks a lot will help a lot
dani190




PostPosted: Fri Dec 16, 2005 6:15 pm   Post subject: (No subject)

how do i create the smoke (in paint?)
Geminias




PostPosted: Fri Dec 16, 2005 6:36 pm   Post subject: (No subject)

use the spray can, get some white and grey and pretend your a kindergarden again Laughing

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




PostPosted: Fri Dec 16, 2005 6:45 pm   Post subject: (No subject)

well yes but iv already used those variables i cant use em again
dani190




PostPosted: Fri Dec 16, 2005 9:08 pm   Post subject: (No subject)

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




PostPosted: Sat Dec 17, 2005 10:11 am   Post subject: (No subject)

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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: