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

2019/5/13

Adding Objects

itscarlwheezer itscarlwheezer

2019/5/13

#
How would I make the player place an object on a specific actor class my pressing a key?
Super_Hippo Super_Hippo

2019/5/13

#
You can't place anything on a class. You can place something on an actor. You need a reference to this actor. Then you can call getX and getY on this object to get its location and you use these X and Y to add your object with the world's addObject method.
itscarlwheezer itscarlwheezer

2019/5/15

#
Thanks so much Super_Hippo can you send me that code?
danpost danpost

2019/5/15

#
itscarlwheezer wrote...
Thanks so much Super_Hippo can you send me that code?
if (<< at specific actor >> && << my key pressed >>) << add object >>;
Sorry, you only get what you put in for (no codes provided and very generalized description of issue).
You need to login to post a reply.