
-----------------------------------
metachief
Mon Feb 04, 2008 4:59 pm

sprites help
-----------------------------------
proc game

    Window.Hide (main_win)
    campaign_win := Window.Open ("position:centre,centre,graphics:850,610,title:CAMPAIGN")

    var left, right : boolean := false
    const grav := 1
    const jump_s := 1.2
    var run_s : real
    var x, y : real
    var vel_y : real
    var jump : boolean
    var key : array char of boolean

    run_s := 13
    x := 400
    y := 8
    jump := false

    View.Set ("offscreenonly")

    loop

        Input.KeyDown (key)
        
        if key ('a') then

            loop
                right := false
                left := true

                Pic.Draw (pic1l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic2l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic3l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic4l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic5l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic6l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic7l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic8l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic9l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic10l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls
                exit
            end loop
        end if

        if key ('d') then
            loop
                left := false
                right := true
                Pic.Draw (pic1r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls


                Pic.Draw (pic2r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic3r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls


                Pic.Draw (pic4r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic5r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic6r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic7r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic8r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls


                Pic.Draw (pic9r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic10r, round (x), round (y), picMerge)
                x := x + run_s
                delay (60)
                View.Update
                cls
                exit
            end loop
        end if

        if key ('w') and jump = false then
            jump := true
            vel_y := jump_s
            Pic.Draw (pic11r, round (x), round (y), picMerge)
            View.Update
            cls
        end if

        if jump = true then
            if y < 200 then
                jump := false
            end if
            y := y + vel_y
            vel_y := vel_y - grav
        end if

    end loop
    
    Window.Close (campaign_win)
    Window.Show (main_win)
    Window.SetActive (main_win)

end game

-----------------------------------
StealthArcher
Mon Feb 04, 2008 5:17 pm

RE:sprites help
-----------------------------------
What do you even want?

And, USE CODE TAGS.
