If/Then statement and DrawBorder
Posted: Mon Mar 04, 2019 9:29 pm
Hello!
Just started writing script in this program in a pinball machine scene, and I'm having some trouble with an if/then statement working like it's supposed to. I have a set of 5 targets that I want to change states with DrawBorder and Restitution when the ball hits them. here's my code:
I've got this in the onCollide line of each of the targets, but it doesn't seem to want to do anything. The points line is a separate way I use to keep track of the player's points, and I've tried taking it out, still doesn't work. Any help y'all can give would be greatly appreciated. Thanks!
Just started writing script in this program in a pinball machine scene, and I'm having some trouble with an if/then statement working like it's supposed to. I have a set of 5 targets that I want to change states with DrawBorder and Restitution when the ball hits them. here's my code:
- Code: Select all
(e)=>{
drawBorder == false ? {
drawBorder = true;
restitution = 3
} : {
drawBorder = false;
restitution = 1
};
points = points + 150
}
I've got this in the onCollide line of each of the targets, but it doesn't seem to want to do anything. The points line is a separate way I use to keep track of the player's points, and I've tried taking it out, still doesn't work. Any help y'all can give would be greatly appreciated. Thanks!