Need some help setting up a basic Mob Spawner in my Java game :)

Delta517

Its okay...Im a ninja ;)
OP
Member
Joined
Nov 25, 2008
Messages
1,329
Trophies
0
Age
29
Website
Visit site
XP
1,180
Country
Norway
Hi! :D So I'm currently working on my first game in java, and I'm trying to create a basic mob spawner in it :)

What I have done so far, is that I created a If statement, in the Enemy class I made, that uses a Random number generator to check if it should spawn something (Im considering making it time based, since I want the game to get progressively harder). :)

The problem is that for every mob it's supposed to create, I have to manually make a different object for it (Ex Enemy1, Enemy2....), which makes it really time consuming (and probably very CPU consuming). :(

That's why I wondered if there is some other way to do this? :P Maybe storing them in arrays or something if thats possible :P Thanks in advance ;)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Imma make quesadillas for lunch :D +1