@@ -104,13 +104,16 @@ bool circular_motion::draw(const dxle::Graph2D::Texture2D& img) const {
104
104
dxle::pointd circular_motion::get_pos () const NOEXCEPT {
105
105
return this ->m_current_ ;
106
106
}
107
- static void extruded (size_t & fall_frame, dxle::pointi& move_target, const dxle::pointi& move_cause , const dxle::pointi& target_img_size , const int first_y) {
107
+ static void extruded (size_t & fall_frame, dxle::pointi& move_target, dxle::Graph2D::Screen& scr , const dxle::pointi& move_cause, DxGHandle& imgarr , const int first_y) {
108
108
constexpr double g = 9.80665 ;
109
- if (move_target.x + target_img_size .x < WINDOW_WIDTH / 4 ) {
109
+ if (move_target.x + scr. GetGraphSize () .x < WINDOW_WIDTH / 4 ) {
110
110
++fall_frame;
111
- move_target.y = first_y + static_cast <int >(g / 2 * fall_frame);
111
+ move_target.y = first_y + static_cast <int >(12.5 * g / 2 * fall_frame);// 自由落下
112
+ if (1 == fall_frame) {
113
+ scr.DrawnOn ([&imgarr]() {imgarr.DrawExtendGraph ({}, { imgarr.GetGraphSize ().x / 3 , imgarr.GetGraphSize ().y / 3 }, true ); });
114
+ }
112
115
}
113
- if (move_cause.x < move_target.x + target_img_size. x ) move_target.x = move_cause.x - target_img_size .x ;
116
+ if (move_cause.x < move_target.x + scr. GetGraphSize (). x ) move_target.x = move_cause.x - scr. GetGraphSize () .x ;
114
117
}
115
118
Status game_c::helicopter_event () {
116
119
this ->m_state_ .fllush ();
@@ -120,7 +123,6 @@ Status game_c::helicopter_event() {
120
123
constexpr int fadeout_time_frame = 200 ;
121
124
// fade out
122
125
for (int i = 0 ; i < fadeout_time_frame && (is_normal_state = normal_con_f ()) && m_state_.update () && !m_state_.esc (); ++i) {
123
- // this->m_img_["Presentation1"].DrawGraph({}, false);
124
126
this ->m_back_img_ .DrawGraph ({}, false );
125
127
SetDrawBlendMode (DX_BLENDMODE_ALPHA, static_cast <int >((fadeout_time_frame - i) * 256.0 / fadeout_time_frame));
126
128
this ->m_img_ [" back_str" ].DrawGraph ({}, true );
@@ -139,16 +141,13 @@ Status game_c::helicopter_event() {
139
141
const int first_yB = m_p_.y ;
140
142
while ((is_normal_state = normal_con_f ()) && m_state_.update () && !m_state_[KEY_INPUT_Z] && !m_state_.esc () && helicopter.update ()) {
141
143
this ->m_back_img_ .DrawGraph ({}, false );
142
- SetDrawBlendMode (DX_BLENDMODE_ALPHA, 128 );
143
- this ->m_img_ [" Presentation1" ].DrawGraph ({}, false );
144
- SetDrawBlendMode (DX_BLENDMODE_NOBLEND, 0 );
145
- extruded (fall_frameB, m_p_, static_cast <dxle::pointi>(helicopter.get_pos ()), this ->m_bouninngennB_ .GetGraphSize (), first_yB);
146
- extruded (fall_frameA, ningenA, m_p_, this ->m_bouninngennA_ .GetGraphSize (), first_yA);
144
+ extruded (fall_frameB, m_p_, this ->m_bouninngennB_ , static_cast <dxle::pointi>(helicopter.get_pos ()), this ->m_img_ [" bouninngennB_fall" ], first_yB);
145
+ extruded (fall_frameA, ningenA, this ->m_bouninngennA_ , m_p_, this ->m_img_ [" bouninngennA_fall" ], first_yA);
147
146
this ->m_bouninngennA_ .DrawGraph (ningenA, true );
148
147
this ->m_bouninngennB_ .DrawGraph (this ->m_p_ , true );
149
- // helicopter_img.DrawGraph({ m_window_s_.x * 23 / 26, m_window_s_.y * 1 / 82}, true);
150
148
helicopter.draw (helicopter_img);
151
- WaitKey ();
149
+ // WaitKey();
150
+ if (WINDOW_HEIGHT < ningenA.y && WINDOW_HEIGHT < this ->m_p_ .y ) break ;// ふたりとも落ちたらゲーム終わり
152
151
}
153
152
if (!is_normal_state) throw std::runtime_error (" ProcessMessage() return -1." );
154
153
if (m_state_.esc ()) throw normal_exit ();
0 commit comments