diff options
| author | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-09-28 22:36:58 +0300 |
|---|---|---|
| committer | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-09-28 22:36:58 +0300 |
| commit | 1cf5a427a829b22abea7027b18a130a01da3ed6a (patch) | |
| tree | 9076e816e052bb35e52890a13562844090312be5 /src/CircularDisplay.cpp | |
| parent | 685fe05def77b039221edf06c74af74915d536c5 (diff) | |
| download | prism-1cf5a427a829b22abea7027b18a130a01da3ed6a.tar.gz prism-1cf5a427a829b22abea7027b18a130a01da3ed6a.zip | |
Rename commit
Renamed some files according the project name
Added base directory structure for resources
Changed more fitting parallax scrolled background to menus
- added 3 new layers as resources
Changed more cheerful buttons to menus
Added base classes to build HUD later on
Added one new test level that is size of 800*480 with tilesize of 32*32
Diffstat (limited to 'src/CircularDisplay.cpp')
| -rw-r--r-- | src/CircularDisplay.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/CircularDisplay.cpp b/src/CircularDisplay.cpp new file mode 100644 index 0000000..a1a16f3 --- /dev/null +++ b/src/CircularDisplay.cpp @@ -0,0 +1,73 @@ +#include "CircularDisplay.h" + +CircularDisplay::CircularDisplay(QGraphicsItem* parent) : + QGraphicsItem(parent) +{ + m_partCount = 5; + m_maxValue = 50; + m_consumeSpeed = 5; + m_value = 10; + m_activated = false; + + /* TODO: + initialize this item with some kind of rounds graphics + that supports partitioning + */ +} + +CircularDisplay::~CircularDisplay() +{ +} + +void CircularDisplay::advance(int phase) +{ + if (phase == 0) + return; + + // TODO: consuming logic if color is activated + if (phase == 1) + { + if (m_activated) + ; + else + return; + } +} + +void CircularDisplay::setDisplayColor(QColor col) +{ + m_displayColor = col; +} + +void CircularDisplay::collected(int amount) +{ + m_value += amount; + if (m_value > m_maxValue) + m_value = m_maxValue; + + updateDisplay(); +} + +void CircularDisplay::activate() +{ + m_activated = true; +} + +void CircularDisplay::unactivate() +{ + m_activated = false; +} + +void CircularDisplay::updateDisplay() +{ + // TODO: update graphics so user knows collecting stuff does help +} + +QRectF CircularDisplay::boundingRect() const +{ + return QRectF(); +} + +void CircularDisplay::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ +} |
