DIRECTORY RobotDefs USING [RobotIndex, RobotPic], Rope USING [ROPE], ViewerOps USING [CreateViewer], ViewerClasses USING [Viewer, ViewerRec]; RobotArena: CEDAR DEFINITIONS IMPORTS ViewerOps ~ { OPEN V: ViewerClasses; RobotIndex: TYPE ~ RobotDefs.RobotIndex; --The number of robots on the screen at a time... RobotPic: TYPE ~ RobotDefs.RobotPic; Arena: TYPE = V.Viewer; --Arenas are just viewers that are suited for robot battle. arenaWidth, arenaHeight: INT ~ 100; RobotImage: TYPE ~ RECORD [ x, y: REAL _ (arenaWidth)/2, --Position of the robot hit: BOOLEAN _ FALSE, --TRUE => show robot under fire fire: BOOLEAN _ FALSE, --Is he firing right now? fireAngle: INT _ 0 --Angle if so. ]; Create: PROC [info: V.ViewerRec _ [], paint: BOOL _ TRUE] RETURNS [arena: Arena] = INLINE {RETURN[ViewerOps.CreateViewer[$Arena, info, paint]]}; SetRobot: PROC [self: V.Viewer, i: RobotIndex, image: RobotImage]; GetRobot: PROC [self: V.Viewer, i: RobotIndex] RETURNS [image: RobotImage]; SetRobotLocation: PROC [self: Arena, num: RobotIndex, x, y: REAL]; SetRobotPicture: PROC [self: Arena, num: RobotIndex, picture: RobotPic]; SetRobotColor: PROC [index: RobotIndex, color: Rope.ROPE]; }. <RobotArena.mesa Edited by Nickell on July 9, 1985 5:32:42 pm PDT Creates a new, empty arena. Set all the information about a robot. Get all the information about a robot. Set the position of the specified robot within the arena... Change the picture of the specified robot Change the default robot color Κχ– "Mesa" style˜šœ Οc™Jš0™0—J™šΟk ˜ Jšœ žœ˜'Icodešœžœžœ˜Jšœ žœ˜Jšœžœ˜(J˜—šœ ž˜Jšžœ ˜Jšœ˜Jšžœžœ˜—J˜Jšœ žœ1˜[šœ žœ˜$J˜—Jšœžœžœ=˜TJ˜Jšœžœ˜#šœ žœžœ˜Kšœžœ˜5Kšœžœžœ˜7Kšœžœ˜2Kšœ žœ˜#J˜J˜—š Οnœžœžœžœžœžœ˜RJšžœžœ/˜=Jš™J˜—šŸœžœžœ+˜BIdefault™&L™—šŸœžœžœžœ˜KL™&L™—šŸœžœ&žœ˜BL™;L™—šŸœžœ3˜HL™)L™—šŸ œžœ!žœ˜:K™—J˜J˜Jšœ˜J˜J˜—…—¬ί