Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F623914
DungeonMapEntity.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
DungeonMapEntity.h
View Options
#ifndef DUNGEONMAPENTITY_H
#define DUNGEONMAPENTITY_H
#include
"sfml_game/GameEntity.h"
#include
"sfml_game/TileMapEntity.h"
struct
displayEntityStruct
{
bool
moving
;
int
frame
;
float
x
;
float
y
;
Vector2D
velocity
;
float
scale
;
};
class
DungeonMapEntity
:
public
GameEntity
{
public
:
DungeonMapEntity
();
virtual
void
animate
(
float
delay
);
virtual
void
render
(
sf
::
RenderTarget
*
app
);
void
renderPost
(
sf
::
RenderTarget
*
app
);
void
refreshMap
();
/*!
* \brief Generates blood particle
*
* \param x : x position of the blood
* \param y : y position of the blood
* \param bloodColor : color of the blood (red; green, ...)
*/
void
generateBlood
(
float
x
,
float
y
,
BaseCreatureEntity
::
enumBloodColor
bloodColor
);
void
addBlood
(
float
x
,
float
y
,
int
frame
,
float
scale
);
void
addCorpse
(
float
x
,
float
y
,
int
frame
);
std
::
vector
<
displayEntityStruct
>
getBlood
();
std
::
vector
<
displayEntityStruct
>
getCorpses
();
protected
:
private
:
sf
::
VertexArray
vertices
;
bool
hasChanged
;
sf
::
VertexArray
bloodVertices
;
sf
::
VertexArray
corpsesVertices
;
sf
::
VertexArray
corpsesLargeVertices
;
bool
getChanged
();
void
computeVertices
();
void
computeBloodVertices
();
void
computeCorpsesVertices
();
void
animateParticle
(
displayEntityStruct
&
particle
,
float
delay
);
void
displayBlood
(
sf
::
RenderTarget
*
app
);
void
displayCorpses
(
sf
::
RenderTarget
*
app
);
std
::
vector
<
displayEntityStruct
>
blood
;
std
::
vector
<
displayEntityStruct
>
corpses
;
std
::
vector
<
displayEntityStruct
>
corpsesLarge
;
};
class
DungeonMapEntityPost
:
public
GameEntity
{
public
:
DungeonMapEntityPost
(
DungeonMapEntity
*
parent
);
virtual
void
animate
(
float
delay
);
virtual
void
render
(
sf
::
RenderTarget
*
app
);
private
:
DungeonMapEntity
*
parent
;
};
#endif
// DUNGEONMAPENTITY_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 9:45 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140918
Default Alt Text
DungeonMapEntity.h (1 KB)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline