Esempio n. 1
0
void cMovingSprite :: Set_Image( cGL_Surface *new_image, bool new_start_image /* = 0 */, bool del_img /* = 0 */ )
{
	// get a possible collision point change
	GL_point col_pos_change = GL_point();

	if( m_image && new_image )
	{
		col_pos_change = new_image->m_col_pos - m_image->m_col_pos;
	}

	cSprite::Set_Image( new_image, new_start_image, del_img );

	// handle collision point change
	if( col_pos_change.m_x != 0.0f || col_pos_change.m_y != 0.0f )
	{
		Move( -col_pos_change.m_x, -col_pos_change.m_y, 1 );
	}

	// check onground
	Check_on_Ground();
}
Esempio n. 2
0
 // - operator
 inline GL_point operator - (const GL_point& p) const
 {
     return GL_point(m_x - p.m_x, m_y - p.m_y);
 }
Esempio n. 3
0
 // + operator
 inline GL_point operator + (const GL_point& p) const
 {
     return GL_point(m_x + p.m_x, m_y + p.m_y);
 }