Example #1
0
 /** Mark the main information for a bond
     \param idx The unique bond index for this bond (inside an OBMol)
     \param begin The 'beginning' atom for the bond
     \param end The 'end' atom for the bond
     \param order The bond order (i.e., 1 = single, 2 = double... 5 = aromatic)
     \param flags Any initial property flags
  **/
 void OBBond::Set(int idx,OBAtom *begin,OBAtom *end,int order,int flags)
 {
   SetIdx(idx);
   SetBegin(begin);
   SetEnd(end);
   SetBondOrder(order);
   SetFlag(flags);
 }
Example #2
0
int		CPreRabbit::Play(void*)
{
		if(m_bHide) return 0;
		if(Key_Down)
		{
				m_pBmp=&DownWaitBmp;
				SetFlip(0);
				m_Direct=0;
		}
		if(Key_Up)
		{
				m_pBmp=&UpWaitBmp;
				SetFlip(0);
				m_Direct=1;
		}
		if(Key_Left) 
		{
			m_pBmp=&LeftRabbitBmp;
			AddXY(-m_v,0);
			SetIdx(g_I);
			SetFlip(0);
			m_Wait=0;
			m_Direct=3;

		}
		if(Key_Right)
		{
			m_pBmp=&LeftRabbitBmp;
			AddXY(m_v,0);
			SetIdx(g_I);
			SetFlip(1);
			m_Wait=0;
			m_Direct=2;

		}

		if(m_Wait>10)
		{
			switch(m_Direct)
			{
				case 0://向下
				m_pBmp=&DownWaitBmp;
				SetFlip(0);
				break;
			case 1://向下
				m_pBmp=&UpWaitBmp;
				SetFlip(0);
				break;
			case 2://向右
				m_pBmp=&LeftWaitBmp;
				SetFlip(1);
				break;
			case 3://向左
				m_pBmp=&LeftWaitBmp;
				SetFlip(0);
				break;
			}
			if(g_I%10==0)	SetIdx((g_I/10));
		}
		m_Wait++;
		if(m_x<15) 
		{
			g_MazeWidth=16;
			g_MazeHeight=14;
			return 1;
		}
		if(m_x>625-64) 
		{
			g_MazeWidth=80;
			g_MazeHeight=70;
			return 1;
		}
	return 0;
}