#1
|
|||
|
|||
how do I put two exits in a maze?
I have designed a Vizard maze with an 'exit' that when you move into this area of the maze you hear a 'yipee' sound and the programme closes. I now need to be able to have the option to have two separate exits (so that the maze can be solved in two ways) but I cannot seem to do this as when I put another 'E' into my text file ('E' = END) then the programme opens but doesn't run properly. Any thoughts!???
This bit of my script looks like this: def allTimers(event): if (event == LOG_POSITION): logPosition() if (event == JOYSTICK_MOVE): doMove() if (event == CHECK_KEYBOARD): checkKeyboard() if (event == CHECK_END): checkIfAtEnd() if (event == STOP): viz.quit() def checkIfAtEnd(): ''' Checks if the current position is in the end square of the maze. ''' global endPos pos = viz.MainView.getPosition() euler = viz.MainView.getEuler() lowEndX = endPos[0]*mazeExptParams.XSCALE highEndX = (endPos[0]+1)*mazeExptParams.XSCALE lowEndY = endPos[1]*mazeExptParams.YSCALE highEndY = (endPos[1]+1)*mazeExptParams.YSCALE x = pos[0] y = pos[2] if (x >= lowEndX and x <= highEndX) and (y >= lowEndY and y <= highEndY): viz.playsound('yipee.wav') viz.killtimer(CHECK_END) viz.starttimer(STOP, 2) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
building a maze | GoldenSun | Vizard | 3 | 06-04-2008 10:27 AM |