235 return (mCompletionThreshold >= 0) ? mCompletionThreshold : mStartingNumPickups;
316 void updateParticleRendererItemZ();
320 std::unique_ptr<b2World> mWorld;
322 int mStartingNumPickups = 0;
323 int mCompletionThreshold = -1;
327 int mParticleLayer = 0;
328 float mParticleAlpha = 1.0f;
329 float mParticleRadius = 0.05f;
330 float mParticleDensity = 1.2f;
331 float mParticleGravityScale = 0.4f;
335 QPointF(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max()),
336 QPointF(std::numeric_limits<float>::max(), std::numeric_limits<float>::max()));
337 bool mFillCamera =
false;
338 Actor* mPortal =
nullptr;
340 static const float PARTICLE_RENDERER_LAYER_ZBIAS;
342 Q_DECLARE_METATYPE(
Level*)
b2World * getWorld() const
Returns the physics world (b2World) owned by this Level.
Definition: Level.h:261
int particleLayer
Z-depth that the particles rendered by ParticleRendererItem should be at.
Definition: Level.h:101
Actor portal
Helper property to find the Portal for this Level.
Definition: Level.h:124
QString fileName
Path to the file that this Level was loaded from.
Definition: Level.h:73
QPointF getGravity() const
Returns gravity.
Definition: Level.h:172
void parallaxOriginChanged()
Emitted when parallaxOrigin changes.
QRectF getCameraBoundary() const
Returns cameraBoundary.
Definition: Level.h:136
void setParticleLayers(const QList< ParticleLayer * > &value)
Sets particleLayers from a QList.
int startingNumPickups
Number of Actors with PickupLogics, representing the total number of objects that can be collected in...
Definition: Level.h:82
QPointF gravity
Strength of gravity.
Definition: Level.h:77
void parallaxStrengthChanged()
Emitted when parallaxStrength changes.
bool fillCamera
true if the Camera should be fixed to the cameraBoundary, and always view the extents of that region...
Definition: Level.h:64
float getParticleAlpha()
Returns particleAlpha.
Definition: Level.h:212
void setCameraBoundary(const QRectF &value)
Sets cameraBoundary.
void setParallaxOrigin(const QPointF &value)
Sets parallaxOrigin.
void setGravity(const QPointF &value)
Sets name.
Graphic which renders LiquidFun particles as blobs with a variety of effects.
Definition: ParticleRendererItem.h:112
void setParticleAlpha(float value)
Sets particleAlpha.
void setParticleLayer(int value)
Sets particleLayer.
QPointF parallaxStrength
Amount of offset Graphics under a ParallaxTransformItem will receive.
Definition: Level.h:94
int getStartingNumPickups() const
Returns startingNumPickups.
Definition: Level.h:181
const QString & getName() const
Returns name.
Definition: Level.h:154
QQmlListProperty< ParticleLayer > getParticleLayerListProperty()
Returns particleLayers as a QML mutable list.
Actor * getPortal() const
Returns portal.
Definition: Level.h:245
void particleLayerChanged()
Emitted when particleLayer changes.
void setCompletionThreshold(int value)
Sets completionThreshold.
QRectF cameraBoundary
Rectangular region in world coordinates outside of which the Camera must not display.
Definition: Level.h:55
QPointF parallaxOrigin
Location of the parallax origin.
Definition: Level.h:88
void gravityChanged()
Emitted when gravity changes.
void setFillCamera(bool value)
Sets fillCamera.
ActorType
Different categories of Actors, used to differentiate among them.
Definition: Actor.h:49
const QString & getFileName() const
Returns fileName.
Definition: Level.h:163
QQmlListProperty< ParticleLayer > particleLayers
QML mutable list of ParticleLayers, each representing a physically independent layer of LiquidFun par...
Definition: Level.h:114
void nameChanged()
Emitted when name changes.
void setName(const QString &value)
Sets name.
Representation of an in-game level.
Definition: Level.h:48
void particleLayersChanged()
Emitted when particleLayers changes.
const QList< ParticleLayer * > & getParticleLayers() const
Returns particleLayers as a QList.
Definition: Level.h:221
void completionThresholdChanged()
Emitted when completionThreshold changes.
QPointF getParallaxOrigin() const
Returns parallaxOrigin.
Definition: Level.h:185
void fillCameraChanged()
Emitted when fillCamera changes.
int completionThreshold
Points threshold for which the level can be considered "complete".
Definition: Level.h:120
virtual void componentComplete() override
Post-initialization of the Level after all child Actors have been created and set.
const QSet< Actor * > & getActors(Actor::ActorType type) const
Returns the set of actors in the level scene graph of the specified type.
void setParallaxStrength(const QPointF &value)
Sets parallaxStrength.
QString name
Name of this Level.
Definition: Level.h:68
Representation of an entity within the Game scene.
Definition: Actor.h:40
void fileNameChanged()
Emitted when fileName changes.
void addActor(Actor *actor)
Dynamically inserts the specified actor into the level-based scene graph, assuming it does not alread...
int getCompletionThreshold() const
Returns completionThreshold.
Definition: Level.h:234
void setFileName(const QString &value)
Sets fileName.
void cameraBoundaryChanged()
Emitted when cameraBoundary changes.
Wrapper around a b2ParticleSystem, which represents an independent layer of particles.
Definition: ParticleLayer.h:32
bool shouldFillCamera() const
Returns fillCamera.
Definition: Level.h:145
float particleAlpha
Overall transparency of the particles rendered by ParticleRendererItem, with 0.0f being completely tr...
Definition: Level.h:107
void particleAlphaChanged()
Emitted when particleAlpha changes.
QPointF getParallaxStrength() const
Returns parallaxStrength.
Definition: Level.h:194
int getParticleLayer() const
Returns particleLayer.
Definition: Level.h:203