View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,993

Violet CLM has disabled reputation

Nov 14, 2013, 10:27 AM
Violet CLM is offline
Reply With Quote
Some things that come to mind...
  • You're drawing the strings at fixed locations, which may or may not be appropriate for your own personal level layout. Certainly if you change your mind about where either of the doors are, you'll need to change the script as well, and it doesn't support multiple door pairs either. You'd be better off deriving the x and y position of the drawString calls from the x and y position of the player who triggers them.
  • switch () is meaningless and presumably syntactically invalid. Find an article about how switch statements work, just in general, not even specifically in AngelScript. Alternatively just use if, since a three-possibility switch statement feels a little silly, but that's more personal preference speaking.
  • Your values x and y are not defined anywhere in the function and are not used anywhere in the function after being set.
  • Likewise, canvas is never defined. From context it's clear you want it to be of type jjCANVAS@, but you're not using a function that includes one in its parameters. Replace each canvas.drawString with jjDrawString.
__________________