This site requires JavaScript, please enable it in your browser!
Greenfoot back
Back to discussions
PoriChori
PoriChori wrote ...

2017/11/14

Placing an Object where the Player stands

PoriChori PoriChori

2017/11/14

#
Hey there, can someone help me with a little Problem? I want to place an object (Fruit) where my player stands (Tiger) but I don't know how to write it in my Tiger class, so it knows about the Fruit class which it should place. Is it understandable what I mean and can someone explain to me what I have to do?
danpost danpost

2017/11/14

#
Some set of conditions will have to be met to execute the following line so that fruit does not run amok in your world:
getWorld().addObject(new Fruit(), getX(), getY());
PoriChori PoriChori

2017/11/14

#
Thanks! Now it works :)
You need to login to post a reply.