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

Username:   Password: 
 RegisterRegister   
 Pictures in a program?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skatelhs




PostPosted: Thu May 29, 2003 12:44 pm   Post subject: Pictures in a program?

hi, im making a game. I want to have a picture show by my crosshair when you click, but I dont know how to put one in and I dont want to use 100 different drawline commands to make it. Im talking about one of those spark-lookin things that comes out of the end of your gun when you shoot. heres the code if you want to see what ive got so far
code:

View.Set ("offscreenonly")
var x, y, button, bulletsleft : int := 0

bulletsleft := 8

loop
    %Bullets Left- Shown at the Top
    locate (1, 1)
    put "There are ", bulletsleft, " bullets left in the Clip"
    %Crosshair
    drawfillbox (x - 15, y - 1, x + 15, y + 1, white)
    drawfillbox (x - 1, y - 15, x + 1, y + 15, white)
    Mouse.Where (x, y, button)
    if button = 1 and bulletsleft > 0 then
        bulletsleft := bulletsleft - 1
        Music.PlayFile ("gunshot.wav")
    else
        %notshooting
        drawfillbox (x - 15, y - 1, x + 15, y + 1, brightblue)
        drawfillbox (x - 1, y - 15, x + 1, y + 15, brightblue)
        View.Update
        delay (10)

    end if
    if bulletsleft <= 0 then
        bulletsleft := 0
    end if
end loop

so please let me know how to do that, thanks.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu May 29, 2003 4:41 pm   Post subject: (No subject)

I'm preaty sure we already have a tutorial on how to load picture in your program... a short summary would be
code:

var pidID:int := Pic.FileNew("c:\picture.jpg")
Pic.Draw(picID,x,y,picCopy)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: