+ float vx = 0;
+ float vy = 0;
+ if (controller->hold(Controller::LEFT)) vx -= MAX_RUN_XM;
+ if (controller->hold(Controller::RIGHT)) vx += MAX_RUN_XM;
+ if ((controller->hold(Controller::UP)) || (controller->hold(Controller::JUMP))) vy += MAX_RUN_XM;
+ if (controller->hold(Controller::DOWN)) vy -= MAX_RUN_XM;
+ if (controller->hold(Controller::ACTION)) set_ghost_mode(false);
+ physic.set_velocity(vx, vy);
+ physic.set_acceleration(0, 0);
+}
+
+void
+Player::add_coins(int count)
+{
+ player_status->add_coins(count);
+}
+
+void
+Player::add_bonus(const std::string& bonustype)
+{
+ if(bonustype == "grow") {
+ add_bonus(GROWUP_BONUS);
+ } else if(bonustype == "fireflower") {
+ add_bonus(FIRE_BONUS);
+ } else if(bonustype == "iceflower") {
+ add_bonus(ICE_BONUS);
+ } else if(bonustype == "none") {
+ add_bonus(NO_BONUS);
+ } else {
+ std::ostringstream msg;
+ msg << "Unknown bonus type " << bonustype;
+ throw std::runtime_error(msg.str());
+ }
+}
+
+void
+Player::add_bonus(BonusType type, bool animate)
+{
+ // always ignore NO_BONUS
+ if (type == NO_BONUS) {