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

2015/2/20

Hearthstone Clone - How to Add Images?

ProfessionalNoob ProfessionalNoob

2015/2/20

#
I am trying to make a Hearthstone clone and I'm wondering how I add images to a set location. Let's say a player gets a card. How do I lay down that card's image into a specific point in the board?
joandvgv joandvgv

2015/2/20

#
Well, I'm not an expert but it seems like all you need is use setLocation method.
setLocation(int x, int y) 
I don't know if you want any transition stuff, if not. That would work.
danpost danpost

2015/2/20

#
Chances are you will be moving or removing the image after some time. Hence, drawing the image on the background of the world would not be advisable. Create a 'Card' class (have it extend the Actor class); create an instance of the class and set the image to the object; then, add the object (actor/card instance) into the world at the desired location.
You need to login to post a reply.