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

2015/11/3

Hello, I have been trying to change the color of the body when it bounces off the edge in Newton's Lab 3. Here is the current code:

1
2
Mack Mack

2015/11/6

#
I actually got the code from a classmate. You were correct by saying it's not complete. Would you be able to provide me with a code that gets the solution I'm looking for?
danpost danpost

2015/11/6

#
Well, you would not put that code in the 'atWorldEdge' method. You would, however, probably put it inside a block of code governed by the conditional:
if (atWorldEdge)
The block would then be set up as follows
// set random value for 'rc'
// code snippet
You may already -- wait -- you do already have that conditional block in your act method. Replace lines 77 through 81 with the needed code.
Mack Mack

2015/11/6

#
that's what I need help with, what code do I need in place so the colors change when the bodies bounces off the edge.
DragoMail DragoMail

2015/11/8

#
Were you able to figure it out? if so, please pst your code
You need to login to post a reply.
1
2