Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Score Increments for Vertical Matches #2

Open
karlfosterBCL opened this issue Jan 22, 2019 · 2 comments
Open

Issue with Score Increments for Vertical Matches #2

karlfosterBCL opened this issue Jan 22, 2019 · 2 comments

Comments

@karlfosterBCL
Copy link

When I match a vertical 3 the score does not increment. It does horizontally but not vertically. If it then triggers a horizontal match by cascading, then the score is recalculated.

@karlfosterBCL
Copy link
Author

karlfosterBCL commented Jan 22, 2019

When I amend the findMatchedGems method in field to strip most the detail out and replace with this, then vertical gems are scored. To simplify I removed combos from score calculation. Suspect one of the other checks is happening and not updating the vertical checks.

// Add all matched gems without effects
		for (Match match: this.rowMatches)
		{
			for (int d = 0; d < match.length; ++d)
			{
				CellObject gem = this.getGem(match.i + d, match.j);
				//if (gem.effect == CellObject.Effects.NONE)
				if (!matchedAll.contains(gem))
				{
					this.scoreController.updateScore(10);
					matchedAll.add(gem);
				}
			}
		}
		for (Match match: this.colMatches)
		{
			for (int d = 0; d < match.length; ++d)
			{
				CellObject gem = this.getGem(match.i, match.j + d);
				//if (gem.effect == CellObject.Effects.NONE)
				if (!matchedAll.contains(gem))
				{
					this.scoreController.updateScore(10);
					matchedAll.add(gem);
				}
			}
		}

@karlfosterBCL
Copy link
Author

karlfosterBCL commented Jan 22, 2019

For anyone else looking to use this as a basis (its really cool!) then its the bit in getAllMatchedGems responsible for checking long matches. The one that works along columns is missing the update to score:

this.scoreController.updateScore(match.length * (match.length - 1) * (match.length - 2) / 2);

It can be found in the iteration that runs over rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant