Spawning enemies for my game
Let me start off by saying I'm really new to java I just started like a month ago,
Here's my problem... I'm making a simple 2D platforming game, but i'm confused on how to get enemies spawning and or working.
I just need the whole concept of how that would be done, I don't want to be spoon fed the actual code.
Would I make a class for it and then every time I want a new enemy on screen i would do something like (if I had a class called "enemy") enemy = new enemy?
Also how can I use an array to control their x and y locations?
Any help is appreciated, thank you.
Re: Spawning enemies for my game
Having a class to control the location of each object is useful. The class would contain their x,y location.
Their movement would depend on the game's logic.
You could use an ArrayList to contain a list of all the currently alive objects.