Magic_Game/core/actions/JumpTo.cpp

20 lines
386 B
C++
Raw Normal View History

2018-05-10 14:03:54 +08:00
#include "..\e2daction.h"
2018-09-06 23:26:32 +08:00
#include "..\e2dobject.h"
2018-05-10 14:03:54 +08:00
2018-07-28 20:06:27 +08:00
e2d::JumpTo::JumpTo(float duration, const Point & pos, float height, int jumps)
2018-05-10 14:03:54 +08:00
: JumpBy(duration, Point(), height, jumps)
2018-09-04 22:42:34 +08:00
, end_pos_(pos)
2018-05-10 14:03:54 +08:00
{
}
2018-09-04 22:42:34 +08:00
e2d::JumpTo * e2d::JumpTo::Clone() const
2018-05-10 14:03:54 +08:00
{
2018-09-07 00:28:54 +08:00
return new JumpTo(duration_, end_pos_, height_, jumps_);
2018-05-10 14:03:54 +08:00
}
2018-09-04 22:42:34 +08:00
void e2d::JumpTo::Init()
2018-05-10 14:03:54 +08:00
{
2018-09-04 22:42:34 +08:00
JumpBy::Init();
delta_pos_ = end_pos_ - start_pos_;
2018-05-10 14:03:54 +08:00
}