
-----------------------------------
TrAnCeIn4LiFe
Fri Jun 18, 2004 8:46 pm

image function?
-----------------------------------
how could u make an image to be a function?

-----------------------------------
SuperGenius
Fri Jun 18, 2004 9:25 pm


-----------------------------------
what goal are you trying to accompish?

-----------------------------------
TrAnCeIn4LiFe
Fri Jun 18, 2004 9:29 pm


-----------------------------------
ah make an image be returned inside a function like attack ability but in function statment not process.

-----------------------------------
Tony
Fri Jun 18, 2004 9:45 pm


-----------------------------------
then you return the integer pointer to the picture.


var pic1 : int := Pic.FileNew ("whatever")
var pic2 : int := Pic.FileNew ("whateverelse")

function whatPicture () : int

    if Rand.Int (0, 1) = 1 then
        result pic1
    else
        result pic2
    end if

end whatPicture

Pic.Draw (whatPicture (), x, y, picCopy)

