SimpleBox

box object with AABB collision

Constructors

this
this(SDL_Rect pbox, SDL_Color colour)

initialises with a box and a colour image

this
this(SDL_Rect pbox, SDL_Texture* texture)

initialises with a box and a texture

Members

Functions

CollidesWith
bool CollidesWith(SimpleBox other)

uses AABB to check if it collides with another box

MoveDown
bool MoveDown(Scene scene, int pixels)

move the box down while checking collision returns whether it did move

MoveLeft
bool MoveLeft(Scene scene, int pixels)

move the box left while checking collision returns whether it did move

MoveRight
bool MoveRight(Scene scene, int pixels)

move the box right while checking collision returns whether it did move

MoveUp
bool MoveUp(Scene scene, int pixels)

move the box up while checking collision returns whether it did move

Render
void Render(Project parent)

renders the object should not be called by user

SetRenderColour
void SetRenderColour(SDL_Color colour)

makes the object render as a coloured box

SetRenderTexture
void SetRenderTexture(SDL_Texture* texture)

makes the object render as a texture

Update
void Update(Project parent)

updates the object (physics etc)

Variables

box
SDL_Rect box;
Undocumented in source.
physics
Physics physics;
Undocumented in source.
physicsOn
bool physicsOn;
Undocumented in source.
render
RenderValue render;
Undocumented in source.
renderType
RenderType renderType;
Undocumented in source.

Meta