
-----------------------------------
adrian123
Tue Jan 17, 2012 7:01 pm

Help with repeating
-----------------------------------
What is it you are trying to achieve?
Have blocks (bullet bill images) continually travel from right to left


What is the problem you are having?
When I run the program, the image only "shoots" to the other side once, and never repeats it. Can anyone tell me how to make it so that I can make a bulletbill object continually look like it is being launched from one side to another?


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




setscreen ("graphics: 900;600, nocursor, offscreenonly, nobuttonbar")
var counter : int := 0
var font1 : int
font1 := Font.New ("Calibri:30")
var w1, w2, button : int
var y : int := 650 div 2
var blockx, blocky : int
var newblock : boolean := true
var highscore : int := 0
var bulletbill, marioup, mariodown : int
bulletbill := Pic.FileNew ("bulletbill.bmp")
marioup := Pic.FileNew ("mariouptest.gif")
mariodown := Pic.FileNew ("mariodown.gif")
var bulletbillx : int := 900
var bulletbilly := Rand.Int (120, 400)


put "CLICK TO START! GAME BY ADRIAN LAU"
put skip, "Press any key to continue!"
Input.Pause
cls
loop

    Pic.ScreenLoad ("bg.bmp", 0, 0, picCopy)

    
        Pic.Draw (bulletbill, bulletbillx, bulletbilly, picMerge)
        
        bulletbillx := bulletbillx -5
        

    Mouse.Where (w1, w2, button)
    if button = 1 then
        y += 4
        Pic.Draw (marioup, 30, y, picMerge)
        View.Update
    else
        y -= 5
        Pic.Draw (mariodown, 30, y, picMerge)
        View.Update
    end if


    Font.Draw ("Score:", 15, 45, font1, black)
    counter := counter + 1
    Font.Draw (intstr (counter), 120, 45, font1, black)
    View.Update

    if y >= 440 then
        exit
    end if

    if y 