• Create Account

### #ActualKhatharr

Posted 20 January 2013 - 07:55 AM

Why can you not modify the point?

The code you posted in the OP was trying to replace the point, which could be no good for any number of reasons depending on the class. Can't you just

if(target.Position.Y < 0) {
target.Position.Y = 0;
target.Velocity.Y = -target.Velocity.Y;
}

### #5Khatharr

Posted 20 January 2013 - 07:54 AM

Why can you not modify the point?

The code you posted in the OP was trying to replace the point, which could be no good for any number of reasons depending on the class. Can't you just

if(target.Position.Y < 0) {
target.Velocity.Y = -target.Velocity.Y;
}

### #4Khatharr

Posted 20 January 2013 - 07:54 AM

Why can you not modify the point?

The code you posted in the OP was trying to replace the point, which could be no good for any number of reasons depending on the class. Can't you just

if(target.Position.Y < 0) {
target.Position.Y = 0;
target.Velocity.Y = -target.Velocity.Y;
}

### #3Khatharr

Posted 20 January 2013 - 07:52 AM

Why can you not modify the point?

### #2Khatharr

Posted 20 January 2013 - 07:51 AM

That code (in the OP) isn't trying to modify the values of point. It's trying to replace the point object.

I'm not up on XNA, but I'd think you could just do this:
if(target.Position.Y < 0) {  target.Position.Y = 0;  target.Velocity.Y *= -1;}

### #1Khatharr

Posted 20 January 2013 - 07:51 AM

That code isn't trying to modify the values of point. It's trying to replace the point object.

I'm not up on XNA, but I'd think you could just do this:

if(target.Position.Y < 0) {
target.Position.Y = 0;
target.Velocity.Y *= -1;
}

PARTNERS