You can put them wherever. You can define then, or use enums. Enums are actually a bit easier to manage. I mean, heck, if you wanted you could just use numbers for everything and keep it in your head. Defines and Enums make no difference to the compiled code. They're only for making your code easier to read. When they get compiled, the compiler will basically just do a find/replace with the defined or enumerated value. They both have their place. Defines are great for one-off values. Enums are great if you're defining a bunch of sequential values, like flags.
You could put enums in a seperate .sh file and include that in game.sh (although if you do that, the tooltip may not properly show up in SCICompanion when you hover over it).
I'll show you the more complicated example, and let you pare down as necessary. So if you have 160 flags to play with (as in the template game default), you can make those flags be whatever you want. Let's say your game has 40 rooms, and you want to know if ego has visited any room before. Then you have another 120 flags for game states or puzzle points. You can break those up into multiple enums for easier readability.
in Game.sh:
;;; Sierra Script 1.0 - (do not remove this comment)
;put the Sierra Script comment at the top, so we can use sierra script in the header file
(include gameEnumVisited.sh)
create a new file called gameEnumVisited.sh:
;;; Sierra Script 1.0 - (do not remove this comment)
(enum ;the default starting point is 0, although you can specify another)
FLAG_VISITED_ROOM1 ;this is given a value of 0
fVisitedRoom2 ;this is given a value of 1
VISITED_RM3 ;this is given a value of 2
;... continue for as many as needed
;NOTE, flags can be called whatever you want, but being consistent with your naming will make your code easier to read.
)
(define FLAG_ROOM4 3) ;we've explicitly given this a value of 3. We could have also made this the next line in the enum
;game states are called out here
(enum 40 ;we're starting this enum at 40, for the game state flags.
fEgoIsJumping ; has a value of 40. For when ego's jumping off a massive cliff.
FLAG_BABAFROG ; has a value of 41. For when ego has turned Baba Yaga into a frog.
)
;puzzle points are defined here, so the user doesn't double-dip on points.
(enum 120
POINTS_JUMPED ;120. User jumped. Yay. Give yourself 5 points.
)
Then in each room's script, in the dispose code you would add the following
(method (dispose)
(Bset FLAG_VISITED_ROOM1) ; sets flag#0 to 1 (i.e. turns it on, or sets as TRUE)
;we'll also give the user some points, because the had to jump to leave the room
(AddToScore POINTS_JUMPED 5) ;the AddToScore procedure will only add points if the POINTS_JUMPED flag is 0.
;So no other checking is required. The user will only get 5 points once.
(super dispose:)
)
Keep in mind that you can still use Btst to check if points have been awarded. It's still just a flag.