Difference between revisions of "Modules/game pawn/Settings"

From MSX Game Library

< Modules‎ | game pawn

(Created page with "Library configuration (<tt>msxgl_config.h</tt>): <syntaxhighlight lang="c"> #define GAMEPAWN_ID_PER_LAYER FALSE // Set sprite ID for each layer (otherwise set per pawn) #defi...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
Library configuration (<tt>msxgl_config.h</tt>):
 
Library configuration (<tt>msxgl_config.h</tt>):
<syntaxhighlight lang="c">
+
<syntaxhighlight lang="c">// GamePawn setting
#define GAMEPAWN_ID_PER_LAYER FALSE // Set sprite ID for each layer (otherwise set per pawn)
+
#define GAMEPAWN_ID_PER_LAYER TRUE // Set sprite ID for each layer (otherwise set per pawn)
 
#define GAMEPAWN_USE_PHYSICS TRUE // Add physics and collision features
 
#define GAMEPAWN_USE_PHYSICS TRUE // Add physics and collision features
 
// Pawn's bound (can be fixed for all pawn, or setable for each one)
 
// Pawn's bound (can be fixed for all pawn, or setable for each one)
#define GAMEPAWN_BOUND_X GAMEPAWN_BOUND_CUSTOM
+
#define GAMEPAWN_BOUND_X 16
#define GAMEPAWN_BOUND_Y GAMEPAWN_BOUND_CUSTOM
+
#define GAMEPAWN_BOUND_Y 16
 
// Collision position options for each pawn's side
 
// Collision position options for each pawn's side
 
// - GAMEPAWN_COL_0
 
// - GAMEPAWN_COL_0
Line 22: Line 22:
 
// - GAMEPAWN_BORDER_RIGHT
 
// - GAMEPAWN_BORDER_RIGHT
 
// - GAMEPAWN_BORDER_LEFT
 
// - GAMEPAWN_BORDER_LEFT
#define GAMEPAWN_BORDER_EVENT (GAMEPAWN_BORDER_DOWN|GAMEPAWN_BORDER_RIGHT)
+
#define GAMEPAWN_BORDER_EVENT (GAMEPAWN_BORDER_DOWN|GAMEPAWN_BORDER_LEFT|GAMEPAWN_BORDER_RIGHT)
#define GAMEPAWN_BORDER_BLOCK (GAMEPAWN_BORDER_UP|GAMEPAWN_BORDER_LEFT)
+
#define GAMEPAWN_BORDER_BLOCK (GAMEPAWN_BORDER_UP|GAMEPAWN_BORDER_DOWN|GAMEPAWN_BORDER_LEFT|GAMEPAWN_BORDER_RIGHT)
 
// Top/bottom border position (in pixel)
 
// Top/bottom border position (in pixel)
 
#define GAMEPAWN_BORDER_MIN_Y 0 // High border Y coordinade
 
#define GAMEPAWN_BORDER_MIN_Y 0 // High border Y coordinade
#define GAMEPAWN_BORDER_MAX_Y 191 // Low border Y coordinate
+
#define GAMEPAWN_BORDER_MAX_Y 184 // Low border Y coordinate
 
#define GAMEPAWN_FORCE_SM1 FALSE // Force the use sprite mode 1 (for MSX2)  
 
#define GAMEPAWN_FORCE_SM1 FALSE // Force the use sprite mode 1 (for MSX2)  
 
#define GAMEPAWN_USE_VRAM_COL TRUE // Use VRAM to chech tile collision (use RAM buffer instead)
 
#define GAMEPAWN_USE_VRAM_COL TRUE // Use VRAM to chech tile collision (use RAM buffer instead)
 
#define GAMEPAWN_TILEMAP_WIDTH 32 // Width of the tiles map
 
#define GAMEPAWN_TILEMAP_WIDTH 32 // Width of the tiles map
#define GAMEPAWN_TILEMAP_HEIGHT 24 // Height of the tiles map
+
#define GAMEPAWN_TILEMAP_HEIGHT 24 // Height of the tiles map</syntaxhighlight>
</syntaxhighlight>
 
  
 
<html><img style="width:512px;" src="https://raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/pawn.jpg" /></html>
 
<html><img style="width:512px;" src="https://raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/pawn.jpg" /></html>

Latest revision as of 00:09, 19 April 2024

Library configuration (msxgl_config.h):

// GamePawn setting
#define GAMEPAWN_ID_PER_LAYER		TRUE	// Set sprite ID for each layer (otherwise set per pawn)
#define GAMEPAWN_USE_PHYSICS		TRUE	// Add physics and collision features
// Pawn's bound (can be fixed for all pawn, or setable for each one)
#define GAMEPAWN_BOUND_X			16
#define GAMEPAWN_BOUND_Y			16
// Collision position options for each pawn's side
// - GAMEPAWN_COL_0
// - GAMEPAWN_COL_25
// - GAMEPAWN_COL_50
// - GAMEPAWN_COL_75
// - GAMEPAWN_COL_100
#define GAMEPAWN_COL_DOWN			(GAMEPAWN_COL_25|GAMEPAWN_COL_75)
#define GAMEPAWN_COL_UP				GAMEPAWN_COL_50
#define GAMEPAWN_COL_RIGHT			GAMEPAWN_COL_50
#define GAMEPAWN_COL_LEFT			GAMEPAWN_COL_50
// Options to determine which border collide or trigger events
// - GAMEPAWN_BORDER_NONE
// - GAMEPAWN_BORDER_DOWN
// - GAMEPAWN_BORDER_UP
// - GAMEPAWN_BORDER_RIGHT
// - GAMEPAWN_BORDER_LEFT
#define GAMEPAWN_BORDER_EVENT		(GAMEPAWN_BORDER_DOWN|GAMEPAWN_BORDER_LEFT|GAMEPAWN_BORDER_RIGHT)
#define GAMEPAWN_BORDER_BLOCK		(GAMEPAWN_BORDER_UP|GAMEPAWN_BORDER_DOWN|GAMEPAWN_BORDER_LEFT|GAMEPAWN_BORDER_RIGHT)
// Top/bottom border position (in pixel)
#define GAMEPAWN_BORDER_MIN_Y		0		// High border Y coordinade
#define GAMEPAWN_BORDER_MAX_Y		184		// Low border Y coordinate
#define GAMEPAWN_FORCE_SM1			FALSE	// Force the use sprite mode 1 (for MSX2) 
#define GAMEPAWN_USE_VRAM_COL		TRUE	// Use VRAM to chech tile collision (use RAM buffer instead)
#define GAMEPAWN_TILEMAP_WIDTH		32		// Width of the tiles map
#define GAMEPAWN_TILEMAP_HEIGHT		24		// Height of the tiles map