Computer Science Canada

Game problem help quickly please!

Author:  surfed [ Mon May 30, 2005 4:29 pm ]
Post subject:  Game problem help quickly please!

code:

process gameMenu
    var butGame : int := GUI.CreateButton (250, 120, 150, "New Game", newGame)
    var butOption : int := GUI.CreateButton (250, 90, 150, "Options", options)
    var butScore : int := GUI.CreateButton (250, 60, 150, "High Scores", highScore)

    loop
        exit when GUI.ProcessEvent
    end loop
end gameMenu   

loop
        var title : int := Pic.FileNew ("title.jpg")
        var titleG : int := Pic.FileNew ("titleG.jpg")
        var titleB : int := Pic.FileNew ("titleB.jpg")

        Pic.SetTransparentColor (title, brightred)
        Pic.Draw (title, 180, maxy div 1.5, picMerge)

        delay (150)

        Pic.SetTransparentColor (titleG, brightred)
        Pic.Draw (titleG, 190, maxy div 1.5, picMerge)

        delay (150)

        Pic.SetTransparentColor (titleB, brightred)
        Pic.Draw (titleB, 190, maxy div 1.5, picMerge)

        delay (150)
    end loop

fork gameMenu


how do i make it so when i press a button, the loop stops ( the loop with the pictures and the delays). when i put cls, the intro still still executes. Should i actually use the process? when i just put it as normal code, the picture stops at the part :
code:
    loop
        exit when GUI.ProcessEvent
    end loop

Author:  MysticVegeta [ Mon May 30, 2005 5:10 pm ]
Post subject: 

Thats the worst use of processes i have ever seen except there was this post but nevermind.

1) Dont use processes for this
2) Look up procedures and GUI help index
3) go here -> http://www.compsci.ca/v2/viewtopic.php?t=9012

There is a post by me, someone asking for the same problem. Look at the bottom-most post.

Author:  surfed [ Mon May 30, 2005 9:06 pm ]
Post subject: 

i read that thread, but i still cant figure out how to do it.. Should i just use procedures? maybe you can give me an example?

thanks


: