Ishadijcks / Ishadijcks.github.io

PokéClicker
15 stars 32 forks source link

Mobile fixes #163

Closed CaptainDapper closed 7 years ago

CaptainDapper commented 7 years ago

There are quite a few changes here; the main goal being play-ability on an Android device running Chrome browser, although I'm sure the changes will extend nicely to other mobile devices due to the fixes mainly being CSS @media queries. There are a few other changes/cleanups so I'll do my best to explain them here as my committing practices are terrible:

Cleanups: Deleted some old images Resized the unknownPokemon.png - it was a whopping 280 KB! Now it's 21 KB Deleted the old /PokeClicker/ directory

CSS Changes: Underground and few other modals won't break style for smaller width windows Modals can be scrolled left and right if they won't fit on the screen When the bootstrap columns wrap, the style got funny so there are several margin changes when that happens

Bug fixes: On mobile, the quest complete notification would spam relentlessly. Apparently the notifyMe function wouldn't work, and it would stop the player.curQuest.notified = 1 line from ever running, so I just swapped the two lines.

Quality of Life Features: In Dungeons, you can now move to any tile adjacent to an already "explored" tile. This was a bit tricky, since you can reveal the floor with the chests it wasn't as easy as tracking the tiles you've already visited. If you revealed an empty tile, it should count as explored, but not if it's an empty tile unreachable due to other room types blocking the path. Ended up using a Flood Fill algorithm, which seems a bit hefty but in a 5x5 dungeon should be negligible as far as performance goes.

CaptainDapper commented 7 years ago

There are a few issues leftover that I have noticed:

When tapping rapidly on a pokemon in a gym or a dungeon, the timer stops counting down significantly lowering the difficulty. This could probably be fixed, but since the javascript doesn't run when the phone is locked/asleep/whatever it's called, I think it's okay since the game is significantly more difficult since it doesn't idle.

Clicking on an item uses two of them; I think once for "mouse"down and once for mouse up. I saw a "change click to mousedown" commit somewhere in the multitude of pipelines so I left this issue alone. Not too many people are playing this on mobile, I would have to guess, and I rarely want to use only one item anyhow. ;P

Ishadijcks commented 7 years ago

That's awesome, thanks a lot!

yuhasem commented 7 years ago

Don't forget to remove the "PokeClicker/" at the end of the link to the game on the subreddit, since that no longer points to a valid directory.

Aegyo commented 7 years ago

Changed the subreddit link