Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F625814
MagnetEntity.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
844 B
Referenced Files
None
Subscribers
None
MagnetEntity.cpp
View Options
#include
"MagnetEntity.h"
#include
"Constants.h"
#include
"sfml_game/ImageManager.h"
MagnetEntity
::
MagnetEntity
(
float
x
,
float
y
,
PlayerEntity
*
parentEntity
,
enumItemType
itemType
)
:
SpriteEntity
(
ImageManager
::
getInstance
().
getImage
(
IMAGE_ITEMS
),
x
,
y
,
ITEM_WIDTH
,
ITEM_HEIGHT
)
{
this
->
x
=
x
;
this
->
y
=
y
;
this
->
setLifetime
(
0.7f
);
//itemFadingEntity->setFading(true);
this
->
setShrinking
(
true
);
this
->
setVelocity
(
Vector2D
(
150.0f
-
rand
()
%
300
,
-260.0f
));
this
->
setWeight
(
800.0f
);
this
->
setFrame
(
itemType
);
this
->
parentEntity
=
parentEntity
;
type
=
ENTITY_EFFECT
;
}
void
MagnetEntity
::
animate
(
float
delay
)
{
z
=
y
+
height
;
if
(
age
>
lifetime
*
0.3f
)
{
velocity
.
x
+=
(
parentEntity
->
getX
()
-
x
)
*
delay
*
30.0f
;
velocity
.
y
+=
(
parentEntity
->
getY
()
-
y
)
*
delay
*
30.0f
;
}
SpriteEntity
::
animate
(
delay
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 11:57 PM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
118665
Default Alt Text
MagnetEntity.cpp (844 B)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline