
-----------------------------------
RENThead
Mon Jun 18, 2007 10:05 am

Sprite help
-----------------------------------
ok i'm trying to find a way to load sprites into my game but i'm really having a hard time with this sprite command, can anyone help clear it up for me or give me an example? thanks!

-----------------------------------
Albrecd
Mon Jun 18, 2007 10:32 am

Re: Sprite help
-----------------------------------
Check out [url=http://compsci.ca/v3/viewtopic.php?t=4598]Paul's Tutorial on the subject.

-----------------------------------
RENThead
Mon Jun 18, 2007 11:10 am

Re: Sprite help
-----------------------------------
i tried it but turns out sprite commands don't work in 4. anything, is there any other way to do it?

-----------------------------------
DifinityRJ
Mon Jun 18, 2007 11:13 am

Re: Sprite help
-----------------------------------
Yes with counters. I would explain , but i am short on time. Someone please add to this.

-----------------------------------
RENThead
Mon Jun 18, 2007 7:25 pm

Re: Sprite help
-----------------------------------
well when you have time could you help me? i'd rele appricate it :)

-----------------------------------
RENThead
Tue Jun 19, 2007 8:02 am

Re: Sprite help
-----------------------------------
Ah Ha! so i've figured out a way to do it this is what i've got and it works


proc jackrun
    var pics : array 0 .. 10 of int
    var sprite : int
    for i : 1 .. 11
        pics (i - 1) := Pic.FileNew ("G:/game/Jack" + intstr (i) + ".bmp")
        if Error.Last not= 0 then
            put "Error loading image: ", Error.LastMsg
            return
        end if
    end for
    sprite := Sprite.New (pics (0))
    Sprite.SetPosition (sprite, 0, 100, false)
    Sprite.Show (sprite)
    loop
        Input.KeyDown (chars)
        if chars (KEY_RIGHT_ARROW) then
            x := x + 1
            Sprite.Animate (sprite, pics ((x div 2) mod 11), x, 100, false)
            delay (100)
        end if
    end loop
end jackrun


now if i wanted to make him go a different way would i just put an elsif and just copy what i have and add a few variables, or...?
