// 前回キャラが接地していたなら、今回もキャラを地面に接地させる
if (prev_stat_.acc.y == 0)
{
- jump_wait_ = false;
// 前回接地していた
// std::cout << " previous on the ground" << std::endl;
{
// 地面に到達した
// std::cout << " current on the ground" << std::endl;
- additional_motion_.handle_ = motion.end_jmp_;
- additional_motion_.isloop_ = false;
- additional_motion_.nextanim_handle_ = motion.stand_;
- additional_motion_.flag_ = true;
current_stat_.pos = foot_floor_exists.second;
current_stat_.acc.y = 0;
current_stat_.vel.y = 0;
- jump_wait_ = false;
}
}
else
current_stat_.roty_speed = 0;
}
- if (!jump_wait_ &&
- (input.GetKeyCount(InputManager::KEYBIND_JUMP) > 0 ||
+ if (current_stat_.acc.y == 0 &&
+ (input.GetKeyCount(InputManager::KEYBIND_JUMP) > 0 ||
input.GetGamepadCount(InputManager::PADBIND_JUMP) > 0))
{
- jump_wait_ = true;
- additional_motion_.handle_ = motion.pre_jmp_;
- additional_motion_.isloop_ = false;
- additional_motion_.flag_ = true;
- additional_motion_.nextanim_handle_ = motion.jmp_;
- additional_motion_.loopcheck_ = true;
- }
-
- if (current_stat_.acc.y == 0 && jump_wait_)
- {
- if(motion_player_->GetPlayEnd())
- {
any_move_ = true;
current_stat_.acc.y = -9.8 * stage_->map_scale();
current_stat_.vel += VGet(0, jump_height_ * stage_->map_scale(), 0);
- }
}
}
map_scale_(map_handle_.property().get<float>("scale", 20.0)),
min_height_(map_handle_.property().get<float>("min_height", -200.0)),
host_change_flag_(false)
-{
+ {
MV1SetScale(map_handle_.handle(), VGet(map_scale_, map_scale_, map_scale_));
MV1SetupCollInfo(map_handle_.handle(), -1, 128, 64, 128);// 元の数値は256,256,256
if (warp_points_.empty()) {
warp_points_.push_back(VGet(0,0,0));
}
+ auto warpobj_name = map_handle_.property().get<std::string>("stage.warpobj_name", unicode::ToString(_T("warpobj:デフォルトワープオブジェクト")));
+ warpobj_handle_ = ResourceManager::LoadModelFromName(unicode::ToTString(warpobj_name));
+
+ float warpobj_scale = warpobj_handle_.property().get<float>("scale",12.5f);
+ if(warpobj_scale != 1.0f)MV1SetScale(warpobj_handle_.handle(), VGet(warpobj_scale, warpobj_scale, warpobj_scale));
+ auto warpobj_push_it = warp_points_.begin();
+ while(!warpobj_handle_.CheckLoaded());
+ for( warpobj_push_it; warpobj_push_it != warp_points_.end(); ++warpobj_push_it)
+ {
+ auto tmp = ResourceManager::LoadModelFromName(unicode::ToTString(warpobj_name));
+ MV1SetPosition(tmp,*warpobj_push_it);
+ warpobj_array_.push_back(tmp);
+ }
auto skymap_name = map_handle_.property().get<std::string>("stage.skydome", unicode::ToString(_T("skydome:入道雲のある風景")));
skymap_handle_ = ResourceManager::LoadModelFromName(unicode::ToTString(skymap_name));
MV1DrawModel(skymap_handle_.handle());
MV1DrawModel(map_handle_.handle());
+ BOOST_FOREACH(auto warp_handle,warpobj_array_)
+ {
+ MV1DrawModel(warp_handle.handle());
+ }
}
float Stage::GetFloorY(const VECTOR& v1, const VECTOR& v2) const
#include <DxLib.h>
#include "dx_vector.hpp"
#include "../ResourceManager.hpp"
+#include "../ui/InputBox.hpp"
class Stage {
public:
float map_scale_;
float min_height_;
ModelHandle skymap_handle_;
+ ModelHandle warpobj_handle_;
+ std::vector<ModelHandle> warpobj_array_;
std::vector<VECTOR> start_points_;
std::vector<VECTOR> warp_points_;