wassup99
03-15-2008, 10:27 AM
Hi,
i'm a 2nd year computer science student with some knowledge in programming and have been tasked by a module to do something using Alice
i've worked on what i have for quite a few days now, basically i play a movie, then i move into a over-the-shoulder view of a game where i can move around with the arrow keys and what not, and the motive in this section is to complete quest which allows me to go to the next scene
now my knowledge of alice is very basic and sadly there aren't many examples i could follow from, so basically what i have done for my fps section is this -
world.main calls world.scene1start
scene1start consists of a
While(true)
Do Together
{
alot of while true loops, each one with a if statement indicating a situation that might happen during the game
e.g. i have a "i am walking" flag that will move me forward if the flag is set, and i have a "i am hit" flag that calls a damage() method that decrements my hp by 1, i have several "clicked" flags that calls the respective npcs talk() method, and within here i have a loop(infinity) that plays a background music etc. etc.
}
technically when the game progressed such that i want to transition to scene 2, i was hoping i can 'forcefully' end scene1start so that it'll return to the main method, and continue from there running scene2start, however i have found no way of doing this - if Alice had a break statement i could simply insert a
While(true)
If (scene1running)
Do Together
(All the while trues)
Else
break
all i need to do is set the scene1running flag to false for scene1running to break from the while true loop and return - alternatively if there was a return statement i could do the same thing but apparently this two functions are missing
i can't call scene2start directly within scene1start (or rather, i can but i don't want to) because there's just too many while true loops from scene1start and scene2start and doing this will cause them to overlap and i don't want that to happen
any ideas how to forcibly end my while(true) loop to return to main, or is my programming logic for alice off?
i'm a 2nd year computer science student with some knowledge in programming and have been tasked by a module to do something using Alice
i've worked on what i have for quite a few days now, basically i play a movie, then i move into a over-the-shoulder view of a game where i can move around with the arrow keys and what not, and the motive in this section is to complete quest which allows me to go to the next scene
now my knowledge of alice is very basic and sadly there aren't many examples i could follow from, so basically what i have done for my fps section is this -
world.main calls world.scene1start
scene1start consists of a
While(true)
Do Together
{
alot of while true loops, each one with a if statement indicating a situation that might happen during the game
e.g. i have a "i am walking" flag that will move me forward if the flag is set, and i have a "i am hit" flag that calls a damage() method that decrements my hp by 1, i have several "clicked" flags that calls the respective npcs talk() method, and within here i have a loop(infinity) that plays a background music etc. etc.
}
technically when the game progressed such that i want to transition to scene 2, i was hoping i can 'forcefully' end scene1start so that it'll return to the main method, and continue from there running scene2start, however i have found no way of doing this - if Alice had a break statement i could simply insert a
While(true)
If (scene1running)
Do Together
(All the while trues)
Else
break
all i need to do is set the scene1running flag to false for scene1running to break from the while true loop and return - alternatively if there was a return statement i could do the same thing but apparently this two functions are missing
i can't call scene2start directly within scene1start (or rather, i can but i don't want to) because there's just too many while true loops from scene1start and scene2start and doing this will cause them to overlap and i don't want that to happen
any ideas how to forcibly end my while(true) loop to return to main, or is my programming logic for alice off?