|
|
#1 |
|
Beta Member
Join Date: Jan 2010
Posts: 4
|
This is my current code:
If pongBall.Bounds.Right >= paddleRight.Bounds.Left And pongBall.Bounds.Right < (paddleRight.Bounds.Left + 20) And pongBall.Bounds.Bottom > paddleRight.Bounds.Top And pongBall.Bounds.Top < paddleRight.Bounds.Bottom Then End if is there a better way to do it... this is so long and painful to repeat... does anyone know a better / shorter way to code it? |
|
|
|
|
|
#2 |
|
Site Team
Join Date: Jul 2009
Posts: 2,627
|
Whether there's a shorter way of doing it or not, you shouldn't be repeating that line of code at all - you should farm it out into a separate function, then just call that each time you need it.
|
|
|
|
|
|
#3 |
|
Beta Member
Join Date: Jan 2010
Posts: 4
|
i have to repeat it for each moving object that i want to include... so that means copy and paste and then changing the variables to new object... i was wonder how to shorten it or make all of the moving objects follow the same code
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|