# Not equal more than two things

• Novice
• Posts: 23

3+ Months Ago

Can I have a equation equal more than one number? How do I do it!

Example:
Code: [ Select ]
if ( dir == "up" && _parent.myMap[upY][centerX] != 1) {
_y -= speed;
}
1.     if ( dir == "up" && _parent.myMap[upY][centerX] != 1) {
2.         _y -= speed;
3.     }

Can I have that equal not 1 and 2? I tried 1 && 2 and 1|2 and 1||2...can't figure it out. And I dont want two if statements. Appreicate it thanks.

*EDIT*

I just figured out:
Code: [ Select ]
if ( dir == "up" && _parent.myMap[upY][centerX] != 1 && dir == "up" && _parent.myMap[upY][centerX] != 2) {
_y -= speed;
1.     if ( dir == "up" && _parent.myMap[upY][centerX] != 1 && dir == "up" && _parent.myMap[upY][centerX] != 2) {
2.         _y -= speed;

But if there's a better way I'd appreciate you posting it thanks.
• Novice
• Posts: 32
• Loc: Australia

3+ Months Ago

Hey,

You don't need the second dir == "up". It has already been tested.

## Post Information

• Total Posts in this topic: 2 posts
• Users browsing this forum: No registered users and 5 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum