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

2014/10/29

Character goes through the platform (from below)

sunjay001 sunjay001

2014/10/29

#
Can someone please help me with this simple problem. I am working on a platform game. It's almost done, but I have a tiny problem. The player can go through the "Ground.class" from below. How can I make my player stop when it hits the bottom of the Ground? It can stand ON the platform, so the 'onGround' works.
Super_Hippo Super_Hippo

2014/10/29

#
If the onGround works, you can probably write similar code to check for above the player. There is probably something like 'getOneObjectAtOffset(0,/*something positive*/, Ground.class)'. If you change the positive value to a negative one, it will check above the player.
You need to login to post a reply.