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

2020/11/11

getting the Y cordinated of a object

Ralkey Ralkey

2020/11/11

#
im trying to get the Y cordinates of the ground in my project. so when my character touches the ground.class it will get teleported to the top of my ground. but I have no idea how.
if (isTouching(ground.class)){
    setLocation(getX(), /*the part that i will put the Y of the ground in*/);
}
if anyone can help with this that would be great (if its necessary info I have multiple (6) ground's in my scene)
danpost danpost

2020/11/11

#
Ralkey wrote...
im trying to get the Y cordinates of the ground in my project. so when my character touches the ground.class it will get teleported to the top of my ground. but I have no idea how. << Code Omitted >>
This was just posted on another discussion thread.
You need to login to post a reply.