Skip to content

Commit

Permalink
One UP mushroom
Browse files Browse the repository at this point in the history
  • Loading branch information
feresr committed May 24, 2020
1 parent f7e76bf commit 15444f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Binary file modified assets/tileset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions src/systems/PlayerSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,19 @@ void PlayerSystem::tick(World* world) {
}

void PlayerSystem::eatMushroom(World* world, bool oneup) {
if (oneup) {
world->create()->assign<SoundComponent>(Sound::Id::ONE_UP);
} else {
world->create()->assign<SoundComponent>(Sound::Id::MUSHROOM_EAT);
}
world->create()->assign<FloatingPointsComponent>("1000",
player->get<TransformComponent>()->getCenterX(),
player->get<TransformComponent>()->y
);
world->create()->assign<AddScoreComponent>(1000);

if (oneup) {
world->create()->assign<SoundComponent>(Sound::Id::ONE_UP);
return;
} else {
world->create()->assign<SoundComponent>(Sound::Id::MUSHROOM_EAT);
}

if (player->has<SuperMarioComponent>()) return;
player->assign<SuperMarioComponent>();
player->assign<AnimationComponent>(
Expand Down

0 comments on commit 15444f9

Please sign in to comment.