I’ve never made a tower defence game, but I do have some idea on how to do this.
A good and easy way to load and save data from java is using the json format, which is text based so you can edit the text files outside the game. Reading and writing is typically done using a library, for example Google offers gson, which is an easy to use one.
Now for the data you would need to save. I would create a simple Java class Wave containing the basic information about a wave, e.g. number of creeps of a certain type and the interval between creeps appearing. For example:
public class Wave {
int numberOfCreeps;
int creepType;
float intervalBetweenCreeps;
public int getNumberOfCreeps() {
return numberOfCreeps;
}
public void setNumberOfCreeps(int numberOfCreeps) {
this.numberOfCreeps = numberOfCreeps;
}
public int getCreepType() {
return creepType;
}
public void setCreepType(int creepType) {
this.creepType = creepType;
}
public float getIntervalBetweenCreeps() {
return intervalBetweenCreeps;
}
public void setIntervalBetweenCreeps(float intervalBetweenCreeps) {
this.intervalBetweenCreeps = intervalBetweenCreeps;
}
}
A text file containing a List of Waves would then look like:
[
{
"numberOfCreeps":10,
"creepType":1,
"intervalBetweenCreeps":0.25
},
{
"numberOfCreeps":10,
"creepType":1,
"intervalBetweenCreeps":0.25
}
]
You can read this from disk by reading a simple text file in the the json format, and converting it into a Java object through the use of gson.
Anyway, this is how I would probably get started.