|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T n
Length: 3552 (0xde0) Types: TextFile Names: »notify.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/Sun/Tetris/notify.c«
#include "defs.h" Notify_value drop_block(me, which) Notify_client me; int which; { if (block_can_drop(shape_no, xpos, ypos, rot)) print_shape(shape_no, xpos, ypos++, rot, WHITE); else { if (ypos < 0) end_game(); else { score += shape[shape_no].pointv[rot]; store_shape(shape_no, xpos, ypos, rot); remove_full_lines(ypos); create_shape(); show_score(); show_next(); } } print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); draw_shadow(shape_no, xpos, ypos, rot, shape[shape_no].color); return (NOTIFY_DONE); } show_score() { char buf[BUFSIZ], buf1[BUFSIZ], buf2[BUFSIZ]; sprintf(buf, "Score: %d", score); panel_set(score_item, PANEL_LABEL_STRING, buf, 0); sprintf(buf1, "Level: %d", rows / 10); panel_set(level_item, PANEL_LABEL_STRING, buf1, 0); sprintf(buf2, "Rows : %d", rows); panel_set(rows_item, PANEL_LABEL_STRING, buf2, 0); } void quit_proc() { clear_events(); stop_timer(); window_destroy(frame); } end_game() { end_of_game = 1; clear_events(); stop_timer(); panel_set(game_over, PANEL_SHOW_ITEM, TRUE, 0); update_highscore_table(); print_high_scores(); } void restart_proc() { clear_events(); stop_timer(); init_all(); } void start_proc() { if (end_of_game) return; set_events(); start_timer(); } void pause_proc() { clear_events(); stop_timer(); } left_proc() { if (block_can_left(shape_no, xpos, ypos, rot)) { print_shape(shape_no, xpos, ypos, rot, WHITE); xpos--; print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); draw_shadow(shape_no, xpos, ypos, rot, shape[shape_no].color); } } right_proc() { if (block_can_right(shape_no, xpos, ypos, rot)) { print_shape(shape_no, xpos, ypos, rot, WHITE); xpos++; print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); draw_shadow(shape_no, xpos, ypos, rot, shape[shape_no].color); } } anti_proc() { int newrot; newrot = (rot + 3) % 4; if (check_rot(shape_no, xpos, ypos, newrot)) { print_shape(shape_no, xpos, ypos, rot, WHITE); rot = newrot; print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); draw_shadow(shape_no, xpos, ypos, rot, shape[shape_no].color); } } clock_proc() { int newrot; newrot = (rot + 1) % 4; if (check_rot(shape_no, xpos, ypos, newrot)) { print_shape(shape_no, xpos, ypos, rot, WHITE); rot = newrot; print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); draw_shadow(shape_no, xpos, ypos, rot, shape[shape_no].color); } } fast_proc() { while (block_can_drop(shape_no, xpos, ypos, rot)) { print_shape(shape_no, xpos, ypos, rot, WHITE); ypos++; print_shape(shape_no, xpos, ypos, rot, shape[shape_no].color); } } void done_proc() { window_set(score_frame, WIN_SHOW, FALSE, 0); }