BIT_LEFT EQU 0 BIT_RIGHT EQU 1 BIT_UP EQU 2 BIT_DOWN EQU 3 PLAYER_UP EQU 4 PLAYER_DOWN EQU 8 PLAYER_LEFT EQU 1 PLAYER_RIGHT EQU 2 PLAYER_UP_LEFT EQU 5 PLAYER_UP_RIGHT EQU 6 PLAYER_DOWN_LEFT EQU 9 PLAYER_DOWN_RIGHT EQU 10 NUMBER_PLAYER_FRAMES EQU 6 MAN_WALK_FRAME_SPEED EQU 4 MAN_RUN_SPEED EQU 3 PLAYER_HEIGHT EQU 32 ATTACH EQU 7 PLAYER_INCREMENT EQU 64+64 PLAYER_SCALE EQU 6 ;for asl BOX_LEFT EQU 130 BOX_RIGHT EQU 288-130 BOX_UP EQU 110 BOX_DOWN EQU 240-130 **************************************** **** CONTROL METHOD 2 ***** **************************************** Control_Method_2 *player can walk and shoot move.w player_current_frame,d1 moveq #0,d0 move.b man_direction,d0 beq.s player_stopped move.w d0,last_direction player_stopped tst last_x_direc bne.s pnot_zero tst last_y_direc bne.s pnot_zero bra.s player_not_changed_direction pnot_zero subq.w #1,man_frame_count bne.s dont_update_frame move.w #MAN_WALK_FRAME_SPEED,man_frame_count update_frame addq.w #1,d1 cmp.w #NUMBER_PLAYER_FRAMES,d1 blt.s dont_update_frame move.w #0,d1 bra.s dont_update_frame player_not_changed_direction move.w last_direction,d0 clr.w player_current_frame ;player has stopped moving move.w #MAN_WALK_FRAME_SPEED,man_frame_count dont_update_frame move.w d1,player_current_frame rts **************************************** **** CONTROL METHOD 1 ***** **************************************** Control_Method_1 *player cannot walk and shoot move.w player_current_frame,d1 moveq #0,d0 move.b man_direction,d0 beq.s player_stopped2 move.w d0,last_direction tst.w fire beq.s player_stopped2 clr.w last_x_direc clr.w last_y_direc clr.b man_direction clr.w d1 ;player has stopped moving bra.s player_not_changed_direction2 player_stopped2 tst last_x_direc bne.s pnot_zero2 tst last_y_direc bne.s pnot_zero2 bra.s player_not_changed_direction2 pnot_zero2 subq.w #1,man_frame_count bne.s dont_update_frame2 move.w #MAN_WALK_FRAME_SPEED,man_frame_count update_frame2 addq.w #1,d1 cmp.w #NUMBER_PLAYER_FRAMES,d1 blt.s dont_update_frame2 move.w #0,d1 bra.s dont_update_frame2 player_not_changed_direction2 move.w last_direction,d0 move.w #MAN_WALK_FRAME_SPEED,man_frame_count dont_update_frame2 move.w d1,player_current_frame rts **************************************** **** CONTROL METHOD 3 ***** **************************************** Control_Method_3 *player will walk and shoot unless shooting began before *player moving move.w player_current_frame,d1 moveq #0,d0 move.b man_direction,d0 beq.s player_has_stopped move.w d0,last_direction tst.w stop_flag beq.s player_stopped3 player_has_stopped tst.w fire beq.s player_stopped3 move.w #1,stop_flag clr.w last_x_direc clr.w last_y_direc clr.b man_direction clr.w d1 bra.s player_not_changed_direction3 player_stopped3 clr.w stop_flag tst last_x_direc bne.s pnot_zero3 tst last_y_direc bne.s pnot_zero3 bra.s player_not_changed_direction3 pnot_zero3 subq.w #1,man_frame_count bne.s dont_update_frame3 move.w #MAN_WALK_FRAME_SPEED,man_frame_count update_frame3 addq.w #1,d1 cmp.w #NUMBER_PLAYER_FRAMES,d1 blt.s dont_update_frame3 move.w #0,d1 bra.s dont_update_frame3 player_not_changed_direction3 move.w last_direction,d0 move.w #MAN_WALK_FRAME_SPEED,man_frame_count dont_update_frame3 move.w d1,player_current_frame rts stop_flag dc.w 0 current_control_method dc.l Control_Method_1 **************************************** **** MOVE PLAYER ***** **************************************** move_player tst player_start_moving_count beq.s player_moving_now subq.w #1,player_start_moving_count player_moving_now move.l current_control_method,a0 jsr (a0) move.w player_x_position,d0 move.w player_y_position,d1 moveq #0,d7 move.b man_direction,d7 move.l #man_increments,a5 asl #2,d7 bne.s man_still_moving tst player_start_moving_count beq.s player_on_the_move move.w #32,d6 bra.s slow_down_p player_on_the_move move.w #8,d6 slow_down_p tst last_x_direc bpl.s x_red add.w d6,last_x_direc ble.s do_y_direc clr.w last_x_direc bra.s do_y_direc x_red sub.w d6,last_x_direc bge.s do_y_direc clr.w last_x_direc do_y_direc tst last_y_direc bpl.s y_red add.w d6,last_y_direc ble.s done_direc clr.w last_y_direc bra.s done_direc y_red sub.w d6,last_y_direc bge.s done_direc clr.w last_y_direc done_direc tst last_x_direc bne.s apply_direc tst last_y_direc bne.s apply_direc move.w #PLAYER_WAIT_COUNT,player_start_moving_count bra.s apply_direc man_still_moving move.w (a5,d7),last_x_direc move.w 2(a5,d7),last_y_direc apply_direc moveq #0,d7 add.w last_x_direc,d0 tst.w last_x_direc bne.s dont_add_y_shift add.w player_move_x,d0 clr.w player_move_x dont_add_y_shift move.w d0,d5 asr.w #PLAYER_SCALE,d0 asr.w #PLAYER_SCALE,d1 add.w scroll_x_position,d0 add.w scroll_y_position,d1 bsr do_player_x_collision tst.w x_collision(a3) beq.s no_collision_on_x move.w x_position(a3),d5 move.w d5,d0 sub.w scroll_x_position,d5 asl.w #PLAYER_SCALE,d5 move.w d5,player_x_position *Do shift analysis - if pushing correct way tst.w last_x_direc beq.s now_test_y tst.w x_block_sign(a3) beq.s x_up_hit x_down_hit tst.b x_block_up(a3) bne.s now_test_y move.w #-1<