Skip to main content
Participant
November 24, 2017
Question

matchstick puzzle in ActionScript

  • November 24, 2017
  • 1 reply
  • 375 views

I want to create a matchstick puzzle. But I'm struggling with it.

the puzzle is like this

the player will have to move only 6 matches to get 3 squares

their are two solution for this

first one:

second:

i actually do not know how to accomplish this. If anyone here can provide me any help i'll be thankful.

thank you in advance.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
November 24, 2017

create a matchstick movieclip.

arrange your movieclips to form the initial layout and assign instance names to your matchstick movieclips.  add click event listeners to each one and on click move the clicked matchstick to a 'removal' pile.  (clicking on a removed matchstick should return it to its original position.)

you can decide how to end game.  eg, after 6 clicks, when the used clicks has a discard pile that contains one of the two groups etc.

ghezlan95Author
Participant
November 25, 2017

i did that. i created the movie clips and added the instance name and added the event listener. and what you said is exactly what i want to do but i struggled with the coding. So if you have any idea of how to achieve this in action script i'll be thankful.

kglad
Community Expert
Community Expert
November 25, 2017

how to achieve which suggestion?  i made two.