Jump to content
News about the LabVIEW Wiki! Read more... ×
Rezar Nashoua

Need help creating Candy Crush type of game.

Recommended Posts

Hello there, I was looking for some help in making a game similar to Candy Crush, I'm working with a friend to try and get this game to work but I'm stuck on quite a few parts of the Labview Code. I am using someone else's code for a basis but they have only managed to get an Array up to load the graphics but the specifics I cannot get down and here is where the problems lie. For one I cannot get it so that the click is restricted to only moving in 4 directions and only swapping with the block next to it. My problem at the moment is you can click any block freely which destroys the purpose of the game. 

Secondly I need to find a way so that when similar coloured blocks are next to each other they get removed and replaced with random coloured blocks, please if anyone could give any help that would be much appreciated. 

mygame_DRAFT_CA.vi

Share this post


Link to post
Share on other sites

How much LabVIEW do you know?  I'll admit that some of altenbach's code is using some techniques I wouldn't have thought of, but simply posting his VI and saying you are stuck gives me the impression you don't have much training.  I'd recommend taking a bunch of the free LabVIEW training that is online, and then I'd recommend you start over with your own design.  As for your specific question I'd say the solution is to have a conditional check (case structure) around the part of the code doing the swapping, and only perform the swap if the second click, is one move away from the first click.  At the moment you aren't keeping track of what the first click is so you'll need to do that so the second click can be checked.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.