This site requires JavaScript, please enable it in your browser!
Greenfoot back
rkzkIMP
rkzkIMP wrote ...

2012/5/2

Question about Newton's lab

rkzkIMP rkzkIMP

2012/5/2

#
can anybody help with the exercise 6.36 for the Newton's lab? I am trying to change/add codes for obstacle that gets switched on and off by being hit by a body. private void checkToggle() { if (!touched && isTouching()) { touched = true; toggleOn = !toggleOn; if (toggleOn) { setImage ("block-light.png"); Greenfoot.playSound(sound); } else { setImage ("block.png"); } } if (touched && !isTouching()) { touched = false; } }
You need to login to post a reply.