MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / update

Method update

Source/GroundLayer.cpp:84–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void GroundLayer::update(float dt)
85{
86 if (auto pl = BaseGameLayer::getInstance())
87 {
88 if (pl->_colorChannels.contains(1001)) _sprite->setColor(pl->_colorChannels.at(1001)._color);
89 }
90
91 this->_sprite->setPositionX(this->_sprite->getPositionX() - dt * this->m_fSpeed);
92
93 if (this->_sprite->getPositionX() <= -128.0f) this->_sprite->setPositionX(0);
94 if (this->_sprite->getPositionX() >= 64.0f) this->_sprite->setPositionX(-64);
95}
96
97GroundLayer* GroundLayer::create(int groundID)
98{

Callers

nothing calls this directly

Calls 1

setColorMethod · 0.45

Tested by

no test coverage detected