コード例 #1
0
ファイル: seg000.c プロジェクト: diddledan/SDLPoP
// seg000:0EA8
// returns 1 if level is restarted, 0 otherwise
int __pascal far play_kid_frame() {
	loadkid_and_opp();
	load_fram_det_col();
	check_killed_shadow();
	play_kid();
	if (upside_down && Char.alive >= 0) {
		upside_down = 0;
		need_redraw_because_flipped = 1;
	}
	if (is_restart_level) {
		return 1;
	}
	if (Char.room != 0) {
		play_seq();
		fall_accel();
		fall_speed();
		load_frame_to_obj();
		load_fram_det_col();
		set_char_collision();
		bump_into_opponent();
		check_collisions();
		check_bumped();
		check_gate_push();
		check_action();
		check_press();
		check_spike_below();
		if (resurrect_time == 0) {
			check_spiked();
			check_chomped_kid();
		}
		check_knock();
	}
	savekid();
	return 0;
}
コード例 #2
0
ファイル: seg000.c プロジェクト: diddledan/SDLPoP
// seg000:0F48
void __pascal far play_guard_frame() {
	if (Guard.direction != dir_56_none) {
		loadshad_and_opp();
		load_fram_det_col();
		check_killed_shadow();
		play_guard();
		if (Char.room == drawn_room) {
			play_seq();
			if (Char.x >= 44 && Char.x < 211) {
				fall_accel();
				fall_speed();
				load_frame_to_obj();
				load_fram_det_col();
				set_char_collision();
				check_guard_bumped();
				check_action();
				check_press();
				check_spike_below();
				check_spiked();
				check_chomped_guard();
			}
		}
		saveshad();
	}
}
コード例 #3
0
ファイル: tetclone.cpp プロジェクト: bigsleep/tetclone
 void tetclone::step()
 {
     if(!m_gameover){
         ++m_level_count;
         bool bottom = !move_falling_tetromino(point2i{{0, m_fall_speed}});
         if(bottom) on_down_bottom();
         if(m_level_count >= m_level_step){
             if(m_level < 10)
                 ++m_level;
             m_fall_speed = fall_speed(m_level);
             m_level_count = 0;
         }
     }
 }
コード例 #4
0
ファイル: tetclone.cpp プロジェクト: bigsleep/tetclone
 void tetclone::restart()
 {
     m_gameover = false;
     std::array<color_t, width> row;
     std::fill(row.begin(), row.end(), color_t::non);
     std::fill(m_stockpile.begin(), m_stockpile.end(), row);
     
     m_current.tetromino = m_rand();
     m_current.angle = angle_t::Zero;
     m_current.pos = point2i{{0, 0}};
     m_next = m_rand();
     m_score = 0;
     m_level = 0;
     m_fall_speed = fall_speed(m_level);
 }
コード例 #5
0
ファイル: tetclone.cpp プロジェクト: bigsleep/tetclone
 tetclone::tetclone()
     :
     m_stockpile(),
     m_current(),
     m_next(),
     m_gameover(false),
     m_level(),
     m_level_count(),
     m_level_step(level_step),
     m_fall_count(),
     m_fall_speed(fall_speed(m_level)),
     m_score(),
     m_gen(std::time(0))
 {
     std::array<color_t, width> row;
     std::fill(row.begin(), row.end(), color_t::non);
     std::fill(m_stockpile.begin(), m_stockpile.end(), row);
     
     m_current.tetromino = m_rand();
     m_current.angle = angle_t::Zero;
     m_current.pos = point2i{{0, 0}};
     m_next = m_rand();
 }