Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

thing.h File Reference

"Thing". More...


Compounds

class  CAcme
class  CBalloon
class  CBanana
class  CBoots
class  CBox
class  CCamera
class  CCoke
class  CConveyor
class  CCrawler
class  CDoor
class  CDoorActivator
class  CDoorRelatedType
class  CDynamite
class  CExit
class  CExplosion
class  CFan
class  CFirepower
class  CFlameThrow
class  CFloatingScore
class  CKey
class  CLetter
class  CLift
class  CPickup
class  CRobot
class  CSoftBlock
class  CSpike
class  CSpikeBall
class  CTeleporter
class  CTest
class  CThing
class  CThingFactory
struct  CThingFactory::SDescriptor

Defines

#define CALC_XOFFSET(x, xsmall)   ( 8 * ( (xsmall) - xo_small + 2 + ((( (x) - xo ) << 1))) )
 Convert world X coordinate (level block coordinate) to view (world display buffer) coordinates.

#define CALC_YOFFSET(y)   ( 16 + ((y) - yo) * 16 )
 Convert world Y coordinate (level block coordinate) to view (world display buffer) coordinates.

#define WORLDX2VIEW(x)   ( -(8*xo_small) + ((x) - (16*xo)) + 16 )
 Convert world X coordinate (pixels) to view (world display buffer) coordinates. Theoretically this should probably eventually replace CALC_XOFFSET.

#define WORLDY2VIEW(y)   ( ((y) - (16*yo)) + 16)
 Convert world Y coordinate (pixels) to view (world display buffer) coordinates. Theoretically this should probably eventually replace CALC_YOFFSET.

#define THING_DIE   -1
 This crap should go. Fixme.

#define THING_REMOVE   -2
 Remove, but not delete.

#define REGISTER_THING(ClassName, nTypeID, pPerLevelInitProc)
 Macro that "thing"s can use (in the .cpp file) to register handlers in the thing factory. More...


Typedefs

typedef CThing* (* THING_ALLOCATER )()
 The CThingFactory uses functions that look like this to allocate CThing's.

typedef void (* THING_PERLEVELINIT )()

Enumerations

enum  {
  ACTION_NONE = 0,
  ACTION_EXIT,
  ACTION_TELEPORT
}
 Action "commands" that a CThing returns to the game for "instructions". More...

enum  EdjLayer {
  LAYER_BOTTOM,
  LAYER_2,
  LAYER_MIDDLE,
  LAYER_4,
  LAYER_TOP
}
 Used to indicate the order in which "things" get drawn. Things at higher layers get drawn over things at lower layers. More...


Functions

CThingCreateFloatingScore (int x, int y, int score)
 Create a CFloatingScore at (x,y) with score score.

CThingCreateExplosion (int nX, int nY)
 Create a CExplosion at (nX,nY) (pixel coordinates).


Variables

CThingFactory g_ThingFactory
 Single global "thing" factory.


Detailed Description

"Thing".

Author:
David Joffe


Define Documentation

#define REGISTER_THING( ClassName, nTypeID, pPerLevelInitProc )
 

Value:

    CThing *ALLOCATE##ClassName()               \
    {                       \
        return new ClassName;                   \
    }                               \
    static int UNIQUEID##ClassName = g_ThingFactory.Register(nTypeID, ALLOCATE##ClassName, pPerLevelInitProc);
Macro that "thing"s can use (in the .cpp file) to register handlers in the thing factory.


Enumeration Type Documentation

anonymous enum
 

Action "commands" that a CThing returns to the game for "instructions".

Enumeration values:
ACTION_NONE   No action should be taken.
ACTION_EXIT   Exit the level (i.e. level completed successfully).
ACTION_TELEPORT   Teleport.

enum EdjLayer
 

Used to indicate the order in which "things" get drawn. Things at higher layers get drawn over things at lower layers.

Enumeration values:
LAYER_BOTTOM   Layer 1; Absolute bottommost. Drawn first.
LAYER_2   Layer 2.
LAYER_MIDDLE   Layer 3; Hero gets drawn at this level.
LAYER_4   Layer 4.
LAYER_TOP   Layer 5; Absolute top-most, e.g. score floating letters.


http://www.scorpioncity.com/djgame.html
Copyright (C) David Joffe. Generated: 15 Jul 2001