Sign in to follow this  
Infinite_Daremo

Objective C: Comparison Operators?

Recommended Posts

Just realised i posted this in game instead of general.... oops. Ok, i have the update of an entity as follows:
-(void) doUpdate {
	if(m_bActive)
	{
		if( m_direction == _South )
		{
			m_position.y++;
						
			if( m_position.y >= ( [VIZ m_iScreenHeight] + 32 ) ); // Change to image height
			{
				m_direction = _North;
			}
		}
		else
		{
			m_position.y--;
			
			if( m_position.y <= ( 0 - 32 ) ); // Change to image height
			{
				m_direction = _South;
			}
		}
	}
}

No matter what the value of m_position.y it executes the if statement. Is this simple test somehow different in Object C? Ive found tutorials showing the same usage. Im baffled. Any ideas?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this