Jump to content

  • Log In with Google      Sign In   
  • Create Account


return to breakout


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
27 replies to this topic

#21 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 11 January 2013 - 04:21 PM

sorry beer

Sponsor:

#22 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 11 January 2013 - 04:23 PM

don't give up on me yet

#23 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 11 January 2013 - 04:29 PM

well I am using the code that sam gave to me.

#24 stitchs   Crossbones+   -  Reputation: 1281

Like
0Likes
Like

Posted 11 January 2013 - 05:35 PM

well here it is

if(	g_bBlock[4].m_bActive_three==true)	
	{
	if(x>=3.0f && x<=5.0f && y>=3.5f && y<=4.0f)
	{
	ystep = -ystep;
	bricks[2][4]=true;
	g_bBlock[4].m_bActive_three=false;	
	}
	}

 

So I want to chime in on this, maybe a modification of your code into something that resembles the naming conventions of BeerNutts (will remove magic numbers/ambiguity) might help you to understand:

 

// Start a loop to loop through all the block
for(unsigned int i = 0; i < MAX_BLOCKS; i++)
{
    // We check to see if blocks are active
    if(g_bBlock[i].isActive)
    {
        // If there is a collision with one of these blocks
        if(ball.x <= g_bBlock[i].width
          || ball.width >= g_bBlock[i].x
          || ball.y <= g_bBlock[i].height
          || ball.height <= g_bBlock[i].y)
        {
            // Then switch the block to inactive
            g_bBlock[i].isActive = false;
            // I assume yStep is the speed the ball is going?
            // If so it is reversed and the ball move backwards.
            yStep *= -1;
        }
    }
}

 

I have commented each step to assist in understanding. See if you understand this and get back to us, tell us what is going on. Try not to code with so many magic numbers, it makes it nearly impossible to understand later, when attempting to convert to use variables.

 

Regards,

 

Stitchs.



#25 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 11 January 2013 - 05:48 PM

actually the code I am using works just fine all I need to do is get the scoring to work

#26 L. Spiro   Crossbones+   -  Reputation: 12949

Like
4Likes
Like

Posted 11 January 2013 - 07:19 PM

Man, I really hate to be a dick
Then let me be one for you. Everyone knows my reputation right?

phil67rpg, stop programming.
I said last time that I would not go so far as to say that until next time. Now it’s next time.

It is known that I have a tendency to be direct, and the fact is I have been a bit soft/indirect with you to this point.
But it’s obvious now that others are feeling the same frustration I have felt with you.  In fact I have only been so “kind” because I thought you were perhaps 10 years old and just trying to get a start on things.
 
 
Now you are sitting here saying you have a degree?
Enough.
 
 
Some people are meant for certain things.  I am sure you have your calling, but it is not related to programming.  I can promise you that.
Stop wasting your time on programming and start trying to find out what it was that you were meant to do.  Knowing now that you are twice as old as I thought you were I literally have no choice but to say this for your own good.  I used to think you were wasting our time.  Now I realize you are wasting your own time.
 
You are too old to be chasing this dream of programming.  You need to find your calling and start generating income.
 
 
Anyone who knows your reputation will agree, but I am probably the only one willing to actually say it.
You can’t program and you will never be able to do so.
Just stop trying.  Move on and find your calling.  Which I guarantee is the opposite of programming, whatever that is.
 
 
L. Spiro

Edited by L. Spiro, 11 January 2013 - 07:26 PM.

It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#27 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 11 January 2013 - 07:26 PM

well then what should I do spiro, I was thinking about persuing art.

#28 L. Spiro   Crossbones+   -  Reputation: 12949

Like
1Likes
Like

Posted 11 January 2013 - 07:36 PM

GameDev.net is not the appropriate place to ask what you should do with your life.
It is also not where you should find out what not to do with your life, but you should consider yourself lucky that it happened.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS