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

What is happening right now?


reply to Mario not dying when touching object

By danpost - about 4 hours ago
A few things to consider:
  • only check collision between two object in one class -- not in both (I would put it all in the Mario class);
  • only check collision immediately after each move of the actor;
  • keep horizontal and vertical movement code separate (knowing which move caused a collision will tell you the orientation of the colliding actors);
  • you may want to dispense with the array of enemies in your world class; I doubt very much that there is a need for it
Please give your reason for the array if you feel you need it. To determine orientation, you will also need the sign of the speed along the axis moved. For example if moving vertically ("falling"), if vSpeed is negative then a collision will be a upward moving head-bump and, if positive then it will be a landing atop of the actor.

reply to No Buttons Pressed

By danpost - about 5 hours ago
CosmicCaleb wrote...
if the left, right, up, and down keys are not pressed, then the function happens
So, basically, you want something like this: <Code Omitted>

reply to Greenfoot not opening on Mac OS X?

By paletapayasa - about 8 hours ago
Thank you so much, I was finally able to enter the app!

reply to Piano Tiles - Continuous Tiles

By faze_bleach - about 9 hours ago
Thanks very much danpost, sorry for the late reply.

reply to While loop

By Super_Hippo - about 10 hours ago
What did you try?