/********************************************************************************
					-------------------------
				 	 Ultra 64 MARIO Brothers
					-------------------------

					File		: pathbar.s
					Description	: 
					Date		: 1995.10.26
					Author		: H.yajima

 ********************************************************************************/


/*################*/
#ifdef ASSEMBLER
/*################*/


/*------------------------------------------------------*/
/*		ball & bar										*/
/*------------------------------------------------------*/
e_ballbar:
	p_initialize(player_friend)
	p_setbit(flag,stf_moveON )
	p_setd(objname,OBJNAME_BAR)
	p_sethitbox(80,2100)
	p_save_nowpos
	p_hitON
	p_while
		p_program(s_ballbar)
	p_loop

/*------------------------------------------------------*/
/*		bar entry										*/
/*------------------------------------------------------*/
e_bar:
	p_initialize(player_friend)
e_bar_program_common:
	p_setbit(flag,stf_moveON )
	p_setd(objname,OBJNAME_BAR)
	p_sethitbox(80,1500)
	p_program(s_barhit)
	p_hitON
	p_while
		p_program(s_tree)
	p_loop

/*################*/
#else
/*################*/


/********************************************************************************
			----------------
			 barhit program
			----------------
 ********************************************************************************/

extern void s_barhit(void)
{
	int	code = (( execstp->s[stw_actorcode].d ) >> 16) & 0xff;
	execstp->myobj_height	=	code * 10;
}


/********************************************************************************
			-----------------
			 ballbar program
			-----------------
 ********************************************************************************/
extern void s_ballbar(void)
{

	StrategyRecord *stp;
	if ( obj_timer == 0 ){
	 	stp = s_makeobj_nowpos(execstp,S_yellowball,e_softsprite_stop);
		stp->s[stw_worldY].f += (execstp->myobj_height)+50;
	}

	s_tree();

}



/*################*/
#endif
/*################*/
/*===============================================================================
		end end end end end end end end 
===============================================================================*/

