AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.entityshapes.ps.Umbrella Class Reference
Inheritance diagram for game2dai.entityshapes.ps.Umbrella:

Public Member Functions

 Umbrella (PApplet papp, double size)
 
 Umbrella (PApplet papp, double size, int[] colList)
 
void setFill (int[] colList)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float etime)
 
- Public Member Functions inherited from game2dai.entityshapes.ps.PicturePS
 PicturePS ()
 
 PicturePS (PApplet papp)
 
void setApplet (PApplet app)
 
- Public Member Functions inherited from game2dai.entityshapes.Picture
 Picture ()
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float elapsedTime)
 
void showHints (int hints)
 
void addHints (int hints)
 
void removeHints (int hints)
 
void removeAllHints ()
 
int getHints ()
 

Package Attributes

float radius = 0
 

Private Member Functions

void fillTriangle (int p1, int p2, int col)
 

Private Attributes

int nbrParts = 0
 
float[] x = null
 
float[] y = null
 
int[] colors = null
 
float rot = 0
 

Additional Inherited Members

- Protected Attributes inherited from game2dai.entityshapes.ps.PicturePS
PApplet app = null
 
- Protected Attributes inherited from game2dai.entityshapes.Picture
int hints = 0
 

Detailed Description

Creates a circular picture that looks like an umbrella from above.

Author
Peter Lager

Constructor & Destructor Documentation

◆ Umbrella() [1/2]

game2dai.entityshapes.ps.Umbrella.Umbrella ( PApplet  papp,
double  size 
)

Create a simple 8 piece black and white umbrella

Parameters
papp
size(should equal the collision radius)

◆ Umbrella() [2/2]

game2dai.entityshapes.ps.Umbrella.Umbrella ( PApplet  papp,
double  size,
int[]  colList 
)

Create an umbrella with at least 8 sections using the colour list.

Parameters
papp
sizethe radius of the umbrella (should equal the collision radius)
colListan array of colour values

Member Function Documentation

◆ draw()

void game2dai.entityshapes.ps.Umbrella.draw ( BaseEntity  owner,
float  posX,
float  posY,
float  velX,
float  velY,
float  headX,
float  headY,
float  etime 
)

Draw the entity.

Parameters
ownerthe entity that owns this renderer.
posXreal world position (x)
posYreal world position (x)
velXmagnitude of the velocity vector in the x direction
velYmagnitude of the velocity vector in the y direction
headXmagnitude of the heading vector in the x direction
headYmagnitude of the heading vector in the y direction
etimethe elapsed time in seconds since last update

Reimplemented from game2dai.entityshapes.Picture.

◆ fillTriangle()

void game2dai.entityshapes.ps.Umbrella.fillTriangle ( int  p1,
int  p2,
int  col 
)
private

Used to fill a triangle shape.

Parameters
p1
p2
col

◆ setFill()

void game2dai.entityshapes.ps.Umbrella.setFill ( int[]  colList)

Set the colours to be used by the brolly.


The documentation for this class was generated from the following file: