0

I am currently designing Agar.io game with Java. Most parts of my game went well. The only problem is when the blob reaches certain size, it become too big for the current screen size to handle. I need to find a way to automatically shrink game canvas (window dimensions stay the same) to make the big blob to appear smaller and smaller food blobs appear even smaller than before.

My original approach was reducing each of blob's width and height to make then smaller, that's when I noticed this approach will not only reduce blob's size but increase distance between blobs. I dropped it.

I need some suggestions on how to take account on blob's x, y positions and width, height to "shrink" game canvas.

Joe Vanjik
  • 357
  • 2
  • 7
  • is there some code here? – gpasch Aug 31 '18 at 07:34
  • @gpasch my code is really long, so I prefer not to show – Joe Vanjik Aug 31 '18 at 17:44
  • 1
    @JoeVanjik you need to add `pan+zoom` transforms to your rendering. But without relevant parts of code we prefer not to speculate as there is a thousand ways how to implement it and usually only two "correct" ones for your implementation of game. Here: [Zooming graphics based on current mouse position](https://stackoverflow.com/a/37269366/2521214) two possible implementations. Why `[game-physics]` tag? if it is important we should know why. Right now I see no connection to it so either it is wrong tag or you forgot to add something into question. – Spektre Sep 01 '18 at 09:53

0 Answers0