Page 1 of 1

Board Game

PostPosted: Tue Nov 12, 2013 8:53 am
by dansk1978
Hi
I'm very new to Construct 2 (but not to programming) and am trying to write a simple board game which is a bit like Tic-Tac-Toe. I have created a background and 9 "spots" on the next layer which are individual cells. I was wondering how to create an event whereby if I click on one of the 9 cells, a counter appears upon that one only? So far if I click on a cell, a counter appears on all nine! I just can't work out how to write an event which references one particular sprite!

Thanks
Matthew

Re: Board Game

PostPosted: Tue Nov 12, 2013 9:51 am
by Darklinki


9 different sprites or different instances ?

Normally you just do something like:
+ On touch cell //Creates automatically a reference to the touched cell, this reference is available in every action and condition below of it
-- cell spawn counter

If you have different sprites put them into a family


Re: Board Game

PostPosted: Tue Nov 12, 2013 10:01 am
by dansk1978
Hi
I used the duplicate sprite feature (holding ctrl to copy more) - are they instances or sprites?

Thanks

Re: Board Game

PostPosted: Tue Nov 12, 2013 10:03 am
by Darklinki
They are different sprites, instead of duplicating them you should just copy them.

Just click on them in the editor and press strg(ctrl) + c and strg(ctrl) + v.

If you do it like you, you would need to put them into a family. If not you need for every object another event.

Re: Board Game

PostPosted: Tue Nov 12, 2013 10:16 am
by dansk1978
Thanks that's great - I'll test it out tonight.

Re: Board Game

PostPosted: Tue Nov 12, 2013 1:15 pm
by TELLES0808
It will help you too: https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail

Re: Board Game

PostPosted: Tue Nov 12, 2013 3:45 pm
by dansk1978
Thanks, I'm just wondering at the moment whether to make my "spots" (where the counters land) to be instances or a family and how to reference them all within events - such as movement.