Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualUnderGrowthFiler

Posted 18 January 2012 - 04:00 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{ //if hitbox exists
if(HitBoxRect)
{
  
//do a loop that checks for value equality
for(count; count < 1; count++)
{
//they collide
if(HitBoxRect.x  && ImageRect.x = 100)
{
//move image downwards by 1
ImageRect.x -= 1;
}  
}
}
		



is this correct or somewhere near correct I want the simplest method  : )

#13UnderGrowthFiler

Posted 18 January 2012 - 04:00 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{ //if hitbox exists
if(HitBoxRect)
{
  
//do a loop that checks for value equality
for(count; count < 1; count++)
{
//they collide
if(HitBoxRect.x  && ImageRect.x = 100)
{
//move image downwards by 1
ImageRect.x -= 1;




}  
}
}
		



is this correct or somewhere near correct I want the simplest method  : )

#12UnderGrowthFiler

Posted 18 January 2012 - 04:00 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{ //if hitbox exists
if(HitBoxRect)
{
  
//do a loop that checks for value equality
for(count; count < 1; count++)
{
//they collide
if(HitBoxRect.x  && ImageRect.x = 100)
{
//move image downwards by 1
ImageRect.x -= 1;
}   

 
}
 }
		



is this correct or somewhere near correct I want the simplest method  : )

#11UnderGrowthFiler

Posted 18 January 2012 - 03:59 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{ //if hitbox exists
if(HitBoxRect)
{
  
//do a loop that checks for value equality
for(count; count < 1; count++)
{
//they collide
if(HitBoxRect.x  && ImageRect.x = 100)
{
//move image downwards by 1
ImageRect.x -= 1;
}	
}
}
		



is this correct or somewhere near correct I want the simplest method  : )

#10UnderGrowthFiler

Posted 18 January 2012 - 03:59 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{ //if hitbox exists
if(HitBoxRect)
{
  
//do a loop that checks for value equality
for(count; count < 1; count++)
{
 //they collide
 if(HitBoxRect.x  && ImageRect.x = 100)
{
 //move image downwards by 1
ImageRect.x -= 1;
}	
  

  }
	  }
		



is this correct or somewhere near correct I want the simplest method  : )

#9UnderGrowthFiler

Posted 18 January 2012 - 03:59 PM

Thanks for all the help guys but I'm still not getting the bigger picture here If I draw a rectangle on a piece of paper and then mark out each section of that rectangle like so

Posted Image|

how would I get it so that my program knows how to intersect and also how to intersect

I had a thought if I could make a big massive picture and basically make a mask of that image like so

Unmasked image
Posted Image


Masked Image
Posted Image



That I could then Code it exactly like this probably going to be wrong here but its a guess

int Intersects(SDL_Rect HitBoxRect SDL_Rect ImageRect)
{
   //if hitbox exists
  if(HitBoxRect)
  {
   
   //do a loop that checks for value equality
	for(count; count < 1; count++)
 {
	   //they collide
		 if(HitBoxRect.x  && ImageRect.x = 100)
{
	  //move image downwards by 1
		 ImageRect.x -= 1;
 }	
  

  }
	  }
		



is this correct or somewhere near correct I want the simplest method  : )

PARTNERS