PINTBasic Reference



Room:
The container of both the visual elements and the interactions (events) that can occur on a single screen.

Backdrop:
Image (80 x 80 Bitmap) that represents the area on the screen where the player (Ego) can explore.
The PAGE interpreter uses the color black to indicate a border (an area that the Ego cannot move through).

Pic (Picture):
An image (8 x 16 Bitmap) that can represent an item (or character) in the game.
PINTBasic accepts a 8 x 16 bitmap image, where the color black is the "transparent" color.

Ego:
This represents the interactive player character that can interact with elements in the room. The Pics that make up the ego are defined on the 'application' level (and not in the room).

Hotspot:
A Hotspot is a non-visible screen location that can either trigger an event, or can return whether or not the Ego is within the hotspot boundaries.

Inventory:
The inventory contains items that the ego has collected, and can be used in interacting with the other game elements (such as "GIVE"ing to someone, or "USE"ing on/with something).



* Note on the PINTBasic Palette:
When a bitmap is being converted in the format used by the PAGE interpreter, the colors mapped to the Propeller palette are based on the first 16 colors that were the default palette in applications such as "Paint" in Windows 2000/XP/Vista. If you are using another application/OS, you can match the palette to the "palette.bmp" in this directory.

* Why Are the Graphics Distorted (Streched Horizontally) When it Runs on the PAGE Interpreter?
This has to do with the rendering of the display. The 80 x 96 image is being streched across a 192 x 96 display. This is a 2.4:1 distortion. Is this done to make it look more retro? Well, not really. It is to conserve resources, since there is only 32K to work with on the Propeller. Looking retro is a nice side effect. If you play some of the early Sierra Online games, you will see a similar sort of distortion on their early CGA/EGA games (first editions of Kings Quest I, Space Quest I, etc.).
In order to get an idea of what the room will look like when it runs under the PAGE interpreter on the Propeller, you can use the PINTRoomViewer.exe application (found in the /tools/bin sub-directory).



Variables and Scope
The PINT interpreter supports 8 "global" variables, and 8 "local" (room) variables. All the variables used in the PINT interpreter are bytes. There are some that are pre-defined, and some that can be user defined.

- The global/application variables will retain their values between rooms.
- The room variables only exist while the ego is in a particular room.
- Any of the variables will persist if a LOAD/SAVE action is used in a particular room.

The following global variables are pre-defined for use in the PINT interpreter:
     global 0 = max score
     global 1 = current score
     global 2 = last room 
     global 3 = last item selected 

These are defined as follows in the "global.bi"
     -----------------
      Dim g_varMaxScore As Byte
      Dim g_varCurrentScore As Byte
      Dim g_varLastRoom As Byte
      Dim g_varLastItem As Byte



Object Reference
Room Object:
Events:
  On_Load
	Triggered when the Room resource is loaded in the PAGE interpreter.
	
  On_Use
	Triggered when the user initiates the "USE" action on the menu.
	
  On_Take
	Triggered when the user initiates the "TAKE" action on the menu.
	
  On_Look
	Triggered when the user initiates the "LOOK" action on the menu.
	
  On_Talk
	Triggered when the user initiates the "TALK" action on the menu.
	
  On_Give
	Triggered when the user initiates the "GIVE" action on the menu.
	
  On_Hotspot1
	Triggered when the Ego enters the boundaries defined for Hotspot #1
	
  On_Hotspot2
	Triggered when the Ego enters the boundaries defined for Hotspot #2
	
  On_Hotspot3
	Triggered when the Ego enters the boundaries defined for Hotspot #3
	
  On_Hotspot4
	Triggered when the Ego enters the boundaries defined for Hotspot #4
  
Methods:
  Load ([room_no])
	[room_no] = Room number, as defined in the Room declaration of the room being loaded.
	
----
	
Backdrop Object:
  Constructor:
	Backdrop([backdrop_filename])
		[backdrop_filename] = Filename of the Backdrop resource.  The Backdrop image must be an 80x80 bitmap

----
			
Pic Object:
  Constructor:
	Pic ([pic_filename])
		[pic_filename] = Filename of the Pic resource.  The Pic image must be an 8x16 bitmap
	
  Methods:
	Load ([x], [y])
		[x] = x position (0-80) to load the Pic
		[y] = y position (0-80) to load the Pic	
		
	Hide()
	
----
	  
Ego Object:
  Methods:
	Load ([x], [y], [facing])
		[x] = x position (0-80) to load the Ego
		[y] = y position (0-80) to load the Ego
		[facing] = direction facing (0-3)
			NORTH = 0
			SOUTH = 1
			EAST  = 2
			WEST  = 3
			
----
				
Inventory Object:
  Methods:
	Add ([item_ref])
		[item_ref] = Item reference (instance of Item object)
		
	Remove ([item_ref])
		[item_ref] = Item reference (instance of Item object)
		
	Contains ([item_ref])
		[item_ref] = Item reference (instance of Item object)
----
			
Item Object:
	Constructor:
		Item([item_name])
			[item_name] = Item name (short 4 character name of the item)

----
				
Hotspot Object:
	Constructor:
		Hotspot ([x], [y], [width], [height])
		
	Methods:
		ContainsEgo()

----
			
Music Object:
	Constructor:
		Music ([midi_filename])
		- Must be MIDI 0 music.
		
	Methods:
		Play([music_id])