
-----------------------------------
goroyoshi
Mon May 09, 2011 8:20 pm

my attempt at shooting
-----------------------------------
Here is what I have done to recreate shooting(not done this is just an image of shooting, I will make a game)


setscreen ("offscreenonly")
var bullet : flexible array 1 .. 0 of int
var direction : string := "up"
var pastx, pasty : int
var recoil : boolean := false
var chars : array char of boolean
var x1, y1 : int := 100
process fire
    if recoil = false then
        pastx := x1
        pasty := y1
        recoil := true
        if direction = "up" then
            for i : y1 .. upper (bullet)
                drawfilloval (pastx, i, 1, 1, 2)
                delay (3)
            end for
        elsif direction = "right" then
            for i : x1 .. upper (bullet)
                drawfilloval (i, pasty, 1, 1, 2)
                delay (3)
            end for
        elsif direction = "left" then
            for decreasing i : x1 .. upper (bullet)
                drawfilloval (i, pasty, 1, 1, 2)
                delay (3)
            end for
        elsif direction = "down" then
            for decreasing i : y1 .. upper (bullet)
                drawfilloval (pastx, i, 1, 1, 2)
                delay (3)
            end for
        end if
        recoil := false
    end if
end fire
loop
    drawbox (0, 0, maxx, maxy, 1)
    Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) then
        direction := "up"
        y1 += 1
    elsif chars (KEY_RIGHT_ARROW) then
        direction := "right"
        x1 += 1
    elsif chars (KEY_LEFT_ARROW) then
        direction := "left"
        x1 -= 1
    elsif chars (KEY_DOWN_ARROW) then
        direction := "down"
        y1 -= 1
    end if
    if y1 + 6 >= maxy then
        y1 -= 1
    end if
    if y1 - 6 = maxx then
        x1 -= 1
    end if
    if x1 - 6 