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

Delta517

Its okay...Im a ninja ;)
Member
Joined
Nov 25, 2008
Messages
1,332
Trophies
0
Age
26
Website
Visit site
XP
1,130
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: https://imgur.com/gallery/BgHrJPC