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

Username:   Password: 
 RegisterRegister   
 help with pictures
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
syphon4




PostPosted: Sun Jun 05, 2005 7:31 pm   Post subject: help with pictures

i have two pictures and i want to load the first then clear then load second help....tell me what is wrong

code:
View.Set ("graphics;maxx;maxy,offscreenonly")

var mypic, mypic2 : int
var x, x2, y2, i2 : int
var y, i : int
var Contin : string

i := 0
i2 := 0

mypic := Pic.FileNew ("C:\\luigi.jpg") %Importing picture into turing

x := 400
y := 1

loop
    drawfillbox (0, 0, maxx, maxy, 7) %Drawing pitch black background
    Pic.Draw (mypic, x + i, y, picCopy)
    View.Update
    i := i - 2
    exit when i = -350
    delay (15)
    View.Update
end loop

put "Press y to conyinue : " ..
get Contin

if Contin = "y" then
    cls

    mypic2 := Pic.FileNew ("C:\\luigiside.bmp") %Importing picture into turing

    x2 := 200
    y2 := 200

    loop
        Pic.Draw (mypic2, x2 + i, y2, picCopy)
        View.Update
        i2 := i2 - 2
        exit when i2 = -350
        delay (15)
        View.Update
    end loop
end if
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun Jun 05, 2005 9:06 pm   Post subject: (No subject)

In the second part, shouldn't it be
code:

Pic.Draw (mypic2, x2 + i2, y2, picCopy)

instead of
code:
Pic.Draw (mypic2, x2 + i, y2, picCopy)

I don't see why you would be using a counter though. Just change the x or y values themselves. Unless you need to remember where they started. But in that case, just make a startX and startY variable, then adjust the standard x and y variables. It's a lot less confusing that way. Smile
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  [ 2 Posts ]
Jump to:   


Style:  
Search: