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

2011/8/10

Source code for bouncing ball

1
2
danpost danpost

2011/8/13

#
Replace line 9, which was:
int myMaxY = getWorld().getHeight() - getImage().getHeight() / 2;
with the following code lines:
Ground ground = (Ground)getWorld().getObjects(Ground.class).get(0);
int myMaxY = (ground.getY() - ground.getImage().getHeight() / 2) - getImage().getHeight() / 2;
tmcappe tmcappe

2011/8/13

#
awesome..thanks man!
danpost danpost

2011/8/13

#
No problem!
You need to login to post a reply.
1
2