
-----------------------------------
SeeknDestroy
Sat Jan 10, 2004 10:55 am

Randomizing Procedures help
-----------------------------------
well im making this shooter game and in it i made a bg picture a process, and made 3 procedures, in the procedures, the bg process is forked and a picture of an enemy appears and i used the mousewhere function to have the picture disappear after u click on it or a delay for when u dont click it. after the procedure codes, i put in a loop, in the loop i have a randint funtion, and it randomly picks a number between 1-3, and when a number is chosen, it corresponding procedure is ran. but when i run my program, the different enemy pictures just appears randomly for a second and disappears again. can n e one plz help me? here's the code if it helps. plz keep in mind i am a noob to turing. thnx a lot

var x, y, button, number, enemies, btn, updown : int
var win, win1 := 0
var winID : int
winID := Window.Open ("position:top;center,graphics:640;480")

randomize
process music %Shoot the enemies
    Music.PlayFile ("AFI - Sacrifice Theory.wav") % 300 and x < 556 and y > 345 and y < 480 and button = 1 then
        win := win + 1
        win1 := win1 + 1
    end if
    delay (800)
    win := win - 1
    win1 := win1 + 1
end enemy1

procedure enemy2
    fork bg1 % The level background
    mousewhere (x, y, button)
    Pic.ScreenLoad ("level1enemy2.bmp", 0, 280, picCopy)
    win1 := win1 + 1
    if x > 0 and x < 196 and y > 280 and y < 415 and button = 1 then
        win := win + 1
        win1 := win1 + 1
    end if
    delay (800)
    win := win - 1
    win1 := win1 + 1
end enemy2

procedure enemy3
    fork bg1 % The background
    mousewhere (x, y, button)
    Pic.ScreenLoad ("level1enemy3.bmp", 150, 100, picCopy) %The third enemy
    win1 := win1 + 1
    if x > 150 and x < 346 and y > 100 and y < 235 and button = 1 then
        win := win + 1
        win1 := win1 + 1
    end if
    delay (800)
    win := win - 1
    win1 := win1 + 1
end enemy3

Pic.ScreenLoad ("level1.bmp", 0, 0, picCopy)
Pic.ScreenLoad ("beginbutton.bmp", 220, 205, picCopy)
buttonwait ("down", x, y, btn, updown)
if (220 