Wednesday, November 25, 2015

java - How to spawn multiple enemies?



I can store it in an array, ok, but after how can i paint it? Because if i do
enemy = new Enemy();
enemy2 = new Enemy();
i create two istances of the object, but afer how can i paint it?
I use:
g2d.drawImage(Enemy.getImage(), Enemy.getX(), Enemy.getY(), this);

But obviously it use the class, not the variable.
Images will not be overlyed because coordinates are random.
Excuse me my terrible english.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...