QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Larryrl on March 24, 2019, 04:35:26 pm

Title: Candy Crush saga type game
Post by: Larryrl on March 24, 2019, 04:35:26 pm
I am working on a match 3 type game and am wondering is it better to hard code the levels inside the source code, so I determine where each piece goes, or do I simply randomize the placement. If I do the randomize, how do I keep it from putting 3 of a kind together from the beginning. When the level is displayed it should not already have matches to take off and give me points for when I was not even playing at that point. Any help would be appreciated.
Title: Re: Candy Crush saga type game
Post by: bplus on March 24, 2019, 04:53:39 pm
I do not know Candy Crush but random layout keeps games from becoming predictable.

So layout board, look for triples and swap values around until none left. You probably already need a function to detect a triple.
Title: Re: Candy Crush saga type game
Post by: FellippeHeitor on March 24, 2019, 05:28:05 pm
If you won't be adding the new types of challenges these games currently have (like destroying certain blocks more than once, limiting moves, etc) a random board is ideal. Just make sure not to give users random boards with only one movement left at start - you'll need to check available moves and "sanitize" the board before game starts if needed.

Now if you want to go the fancy route, then the boards will need to be created with some careful thought.
Title: Re: Candy Crush saga type game
Post by: eddy498 on March 24, 2019, 11:05:30 pm
i second what bplus said, you should already be creating a code to check whether there is a triple or higher of a kind together. use that same code to create a board where if there is a triple or higher it will replace the board entirely until it creates a proper board or just replace the ones there until it has no triples.  having it all being done in a loading screen in the background will give your code enough time to go and make the appropriate board. you can code it so that when board is ready loading screen ends like regular candy crush
Title: Re: Candy Crush saga type game
Post by: _vince on March 25, 2019, 10:17:27 am
Why is candy crush so successful?
Title: Re: Candy Crush saga type game
Post by: bplus on March 25, 2019, 10:41:28 am
Why is candy crush so successful?

"insidious mind control"
Title: Re: Candy Crush saga type game
Post by: bplus on March 25, 2019, 11:35:25 am
Am I correct in my understanding the only moves you can make are swiping 1 space left/right or up/down, which causes candies to swap positions? Then if triple or more, up/down AND left/right the candy blocks are removed and more fall from top to replace removed blocks.
Title: Re: Candy Crush saga type game
Post by: eddy498 on March 25, 2019, 05:02:01 pm
Am I correct in my understanding the only moves you can make are swiping 1 space left/right or up/down, which causes candies to swap positions? Then if triple or more, up/down AND left/right the candy blocks are removed and more fall from top to replace removed blocks.
Yup
Title: Re: Candy Crush saga type game
Post by: bplus on March 25, 2019, 05:16:28 pm
Thanks, looks like they have you buying every little thing to supplement the game. Yikes!
Title: Re: Candy Crush saga type game
Post by: eddy498 on March 25, 2019, 06:27:44 pm
Thanks, looks like they have you buying every little thing to supplement the game. Yikes!

worst part is that they actually have in app purchasing for games like this because they limit how many lives you have and how many times you can fail then have to wait an hour for 1 live or buy them...