20 #include <Engine/Logic.h>
21 #include <Engine/audio/SoundEffectInstance.h>
90 Q_INVOKABLE
void reset();
95 virtual void init()
override;
117 void onPickupContacted(
Body* otherBody,
QPointF normal);
120 int mPickupValue = 1;
121 bool mAllowNonPlayerPickup =
false;
124 bool mPickedUp =
false;
128 #endif // PICKUPLOGIC_H
Q_INVOKABLE void reset()
Makes actor collectable again.
void setPickupValue(int value)
Sets pickupValue.
void pickupSoundChanged()
Emitted when pickupSound changes.
Defines a behavior that, when added to an Actor, makes it "collectable".
Definition: PickupLogic.h:38
An instance of a sound effect.
Definition: SoundEffectInstance.h:36
A QObject container for a Box2D b2Body.
Definition: Body.h:57
void setPickupSound(const QString &value)
Sets pickupSound.
virtual void init() override
Checks that the PickupLogic has an actor with a Body.
bool allowsNonPlayerPickup() const
Returns allowNonPlayerPickup.
Definition: PickupLogic.h:69
int pickupValue
Number of points awarded to Actor::PlayerActor's for collection.
Definition: PickupLogic.h:43
void allowNonPlayerPickupChanged()
Emitted when allowNonPlayerPickup changes.
void setAllowNonPlayerPickup(bool value)
Sets allowNonPlayerPickup.
int getPickupValue() const
Returns pickupValue.
Definition: PickupLogic.h:60
Non-visual entities in the QML item tree that define behavior for their parent Actor.
Definition: Logic.h:31
void pickupValueChanged()
Emitted when pickupValue changes.
const QString & getPickupSound() const
Returns pickupSound.
Definition: PickupLogic.h:78
void collected(Actor *otherActor)
Emitted when actor is collected.
bool allowNonPlayerPickup
true if non-sensor Bodys whose parent Actor is not a Actor::PlayerActor can collect actor...
Definition: PickupLogic.h:49
QString pickupSound
Name of sound asset to play once upon collection.
Definition: PickupLogic.h:54
Representation of an entity within the Game scene.
Definition: Actor.h:40