Question about game logic

0 Donald Trump · August 1, 2015
I see that some 2D android games have a bunch of levels, for example, 300 levels. And then they implement a small pagination with left/right arrow to navigate to the level you want to. I am wondering, what is the logic behind this?

How can I implement at least 200 levels in my game without repeating the code or increasing the app size?

Do I need to create a new package and store all levels inside there?

I really need an asap answer!

Post a Reply


Oldest  Newest  Rating
0 Donald Trump · August 2, 2015
I know man, but what process should i follow to achieve this?
0 Donald Trump · August 2, 2015
DUDE... I know object oriented programming, what do you not understand? I'll ask the same question for the third time:

0 Donald Trump · August 3, 2015
Does anyone know the answer?
0 Zach Auringer · August 5, 2015
Try to standardize the game's features. For instance, if you were making a fighting game, design each round to be fought the same way but increase the difficulty by increasing the amount of enemies or the abilities of the enemy. You can implement this by storing the variable that make the game harder in some collection and just simulating the same thing for each level just with different varibles. Does that make sense?
0 Donald Trump · August 5, 2015
@Zach yes it makes sense, I was actually thinking of doing so but, take a look at this:

Look at the images of that game. Do you see how he has a bunch of squares, like a grid view control, and every square represents a different level. Then he has a pagination at the bottom to "scroll" between levels. Whatever square you click, it will open a different level.

THAT is exactly what I want to make. So my question is, how did he do this? Am I supposed to make a single activity and just change the contents of it depending on what square was clicked? Or should I make 200 activities and open separate one depending which square was clicked, lol..
+1 Number Double07 · August 7, 2015
So, is the way to accomplish levels basically to create a class for each level?  So you'd have a base class representing the variables you need.  Maybe an interface I suppose.  Then, you can create a class for each level and inherit the base class for each subclassed level
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator