Decoded: Sopwith (1984) by David L. Clark Source file: SWGAMES.C Beginner friendly, line-by-line code walkthrough by MaiZure SWGAMES.C contains game scenario data used to set up the game level. Includes info like building types, location, plane start locations, and orientations. Original code: http://davidlclark.com/page/sopwith-source-code Original code with line numbers http://www.maizure.org/projects/decoded-sopwith/SWGAMES_linenum.txt 1 COMMENT 2 COMMENT 3 BLANK 4 COMMENT 5 COMMENT 6 COMMENT 7 COMMENT 8 COMMENT 9 COMMENT 10 COMMENT 11 COMMENT 12 COMMENT 13 COMMENT 14 BLANK 15 COMMENT 16 BLANK 17 COMMENT 18 COMMENT 19 COMMENT 20 COMMENT 21 COMMENT 22 Includes the main game header (sw.h) 23 BLANK 24 BLANK 25 BLANK 26 BLANK 27 BLANK Notes: The world x dimension is 3000 pixels. An orientation of 1 means planes/buildings start out flipped (facing left) Building types are: 0 = HQ w/ flag, 1 = Building, 2 = Fuel Tank 3 = Tanks Building owners are determined by game type in SWINIT.C 28 Defines a GAMES struct for our game setup (format declared in SW.H) 29 BLOCK START - The game configuration 30 Start x locations for players. Player 1 is index 0 at 1270 and the first computer player is index 7 at 1720. The other 2 starting computers are index 2 (588) and 6 (2456). The remaining positions are reserved for multiplayer games, which I've never experienced. 31 The orientations for each starting plane. Orientation index matches the positions from the line above. 0 means normal and facing right, 1 means graphic is inverted (facing left) 32 BLANK 33 Game can provide it's own random function. Hardcoded to NULL and no function is provided in the code. 34 Game random seed. Note that this value is explicitly checked in SWINIT.C 35 A space for a user provided function to execute at load time. Right now it's NULL. INIT.C checks and executes a function if it exists, but no example exists in the code right now. 36 The x positions of the first 5 buildings (indicies 0-4) 37 The x positions of the second 5 buildings (indicies 5-9) 38 The x positions of the third 5 buildings (indicies 10-14) 39 The x positions of the final 5 buildings (indicies 15-19) 40 BLANK 41 The type of the first 5 buildings (indicies 0-4) 42 The type of the second 5 buildings (indicies 5-9) 43 The type of the third 5 buildings (indicies 10-14) 44 The type of the final 5 buildings (indicies 15-19) 45 BLANK 46 BLOCK END - The game configuration 47 BLANK 48 End of GAMES struct definition 49 BLANK˙