-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Currently in Game/LeafMan.cpp in the update function:
void LeafMan::Update(){
std::weak_ptr<GameObject> playerGoPtr = Game::GetInstance().GetCurrentState().GetObjectByComponent("Player");
std::shared_ptr<GameObject> playerGo = playerGoPtr.lock();
//Move enemies towards player
if (parent.box.x < playerGo->box.x) {
spriteSheet->SetCurrentAnimation("walkdown");
parent.SetPos(parent.box.x + speed,parent.box.y);
}
if (parent.box.x> playerGo->box.x) {
spriteSheet->SetCurrentAnimation("walkup");
parent.SetPos(parent.box.x - speed,parent.box.y);
}
if (parent.box.y < playerGo->box.y) {
spriteSheet->SetCurrentAnimation("walkright");
parent.SetPos(parent.box.x,parent.box.y+speed);
}
if (parent.box.y > playerGo->box.y) {
spriteSheet->SetCurrentAnimation("walkleft");
parent.SetPos(parent.box.x,parent.box.y-speed);
}
}Only the left and right walk animations are being played. If this is a bug in LeafMan.cpp it should be notated as such and closed. If this is a bug in the SpriteSheet it should be fixed.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working