Good day, D.I.C.
I've been searching around the webs the past couple of days for tutorials on how to randomly generate "enemies" in java (preferably using the Slick2D and LWJGL libraries) but to no success. So I've come to ask if someone could point me towards a tutorial or somewhere to start, as random enemy generation is kind of important in games
Thanks for any help :3
Random Enemy Gen (Java)
Page 1 of 15 Replies - 1096 Views - Last Post: 22 September 2012 - 07:40 PM
Replies To: Random Enemy Gen (Java)
#2
Re: Random Enemy Gen (Java)
Posted 28 August 2012 - 06:23 PM
This system will be entirely based upon how the rest of your engine code operates, and what you want to randomize. For example, randomly spawning enemies in a side-scrolling shooter game is going to be very different from a mob spawner in a first-person shooter, and much different from a generator that creates mobs with random attributes/abilities.
What is it, specifically, that you're trying to generate random enemies for?
What is it, specifically, that you're trying to generate random enemies for?
#3
Re: Random Enemy Gen (Java)
Posted 28 August 2012 - 07:53 PM
I'm trying to randomly generate enemies for a 2D game
http://axgl.org/f/evo/
Kind of like that game in the style, but I would like for the enemies to be placed randomly on the map. So, essentially randomly generating mobs for a 2D game
http://axgl.org/f/evo/
Kind of like that game in the style, but I would like for the enemies to be placed randomly on the map. So, essentially randomly generating mobs for a 2D game
#4
Re: Random Enemy Gen (Java)
Posted 29 August 2012 - 01:11 AM
What makes you think the enemies in that you posted game are randomly generated? Seems to me like they are placed beforehand.
#5
Re: Random Enemy Gen (Java)
Posted 29 August 2012 - 11:22 AM
hmm.. didn't think about that. Well, let me rephrase my question now that I have thought about it more. How can I create a method to draw a new enemy on command instead of having to hard code each enemy?
#6
Re: Random Enemy Gen (Java)
Posted 22 September 2012 - 07:40 PM
You would have to define "on demand".
If you want temporary randomized enemies that live only in the instance your program is running, then you need to create a factory.
Basically what this factory would do is handle the creation of a new random enemy, and it would return that new enemy instance to be used in your game.
However if you want randomized enemies that will appear in every instance of your program, then you will have to get more involved with file I/O.
You will need to set up a file template of how you will read/write, write your information to that file ( enemy type, position, attributes, ect ) and you will have to code a file processor to read that information in and create your enemy based off of that type/position/attributes ect.
The random part can come from the random attributes/ect written to the file. It can also be randomized by adding the capacity to store all of the enemies read in by your file processor into a vector, to then have randomized access to no particular enemy.
If you want temporary randomized enemies that live only in the instance your program is running, then you need to create a factory.
Basically what this factory would do is handle the creation of a new random enemy, and it would return that new enemy instance to be used in your game.
However if you want randomized enemies that will appear in every instance of your program, then you will have to get more involved with file I/O.
You will need to set up a file template of how you will read/write, write your information to that file ( enemy type, position, attributes, ect ) and you will have to code a file processor to read that information in and create your enemy based off of that type/position/attributes ect.
The random part can come from the random attributes/ect written to the file. It can also be randomized by adding the capacity to store all of the enemies read in by your file processor into a vector, to then have randomized access to no particular enemy.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|