Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aenopix

I added to a ball the key: facing, with a value: right. Now how i can tell the ball to move to the right?

Like:
if (key: facing == value: right)
{
        moveToTheRight
}

1 decade ago by drailing

i think it's like
if ( this.facing == "right" ){
  this.moveRight();
}

1 decade ago by LaserBeam

If the value can be only right or wrong, then I would suggest to use a Boolean:
face: true,
Then in the if statement:
if(this.face){...}
If you want to check if it is false then:
if(this.face == false){...}

1 decade ago by Aenopix

Thanks it worked :)
Page 1 of 1
« first « previous next › last »