I've created the game Wombat Puzzles, and after 7 levels my world code has become a little too long. Right now i add object to the level like this:
As you can see the world is 6x6 fields, and I want to know if it's possible to create levels by "drawing" them. So you tell the program that:
O = Orange
P = Player
R = Rock
N = nothing
Then level 1:
O, O , N, N, N, P
R, N, R, O, O, O
and so on.
The level above doesn't make sence, but I hope you get what i mean. So i want to know is this possible? Is this worth it? Is it hard to do?
If this is possible, worth it and not that hard, I would like to know how. I have no clue at all, so please help me getting started.
Thanks for your time.
if (level == 1) { addObject(new Player(), 5, 5); addObject(new Orange(), 0, 3); addObject(new Orange(), 1, 1); addObject(new Orange(), 1, 2); addObject(new Orange(), 1, 3); addObject(new Orange(), 2, 3); addObject(new Orange(), 3, 1); addObject(new Orange(), 3, 3); addObject(new Orange(), 4, 4); addObject(new Rock(), 0, 0); addObject(new Rock(), 1, 4); addObject(new Rock(), 4, 0); addObject(new Rock(), 4, 2); addObject(new Rock(), 4, 3); addObject(new Rock(), 4, 5); addObject(new Rock(), 5, 2); addObject(new Grass(), 5, 0); }