Pick & move an object on chessboard

Get help using Construct 2

Post » Sun Dec 08, 2013 10:50 pm

Hi all,

we dont know how to pick an object based on a specific criteria.

We have seen in many examples, how to pick an instance but on that way we cant assign the move to another object action.

In this simple example we first would like to pick one of the objects (A, B or C) and move it to overlap with another one:
http://fluidworkshop.com/board/board_test.capx

Since later on we would like to extend the number of objects, we would like to write a general rule and then just pick the object to move, and the other one to move to, and apply the complex rules to them.

Any suggestions?
Many thanks!martiin2013-12-08 22:50:46
B
7
S
1
Posts: 12
Reputation: 556

Post » Mon Dec 09, 2013 2:49 am

I can't open the capx file you gave. There's an error message:

http://tinyurl.com/m6hfnu3narFsnw2013-12-09 02:49:53
B
19
S
5
Posts: 80
Reputation: 1,383

Post » Mon Dec 09, 2013 4:07 am

You can install Rex Rainbow's plugins easily:
scirra.com/forum/app-yetanother-construct-2-repository-beta_topic52050.htmlmartiin2013-12-09 04:08:12
B
7
S
1
Posts: 12
Reputation: 556

Post » Tue Dec 10, 2013 7:50 pm

Any idea please?
B
7
S
1
Posts: 12
Reputation: 556

Post » Tue Dec 10, 2013 8:02 pm

I don't like installing plugins. So don't know what your capx looks like. I presume you want to drag piece to overlap another peice. you can do this with behaviors.
I suggest you read the manual about behaviours.
On sprite right click choose behaviours then press plus sign. Find drag and drop. Now piece should be able to move.

Overlapping is easy. Create event with sprite is overlapping with another object. Select object.

I would read manual about families etc. In fact I would read manual in entirety and use the build in examples as source. Open select desired example to view source.

Edit: there is a checkers game somewhere I just tried to look, but don't have it bookmarked. Search the forum / tutorials / arcade. Can't remember where it was. It has drag and drop if I am not mistaken.DUTOIT2013-12-10 20:04:33
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Tue Dec 10, 2013 8:29 pm

I like Rex plugins, but I'm always hesitent to install his. He makes great plugins. But I find they are often linked to other plugins. Board can't be used without his SquareTx/OrthoTx plugin. Not only that Matcher, InGroup, Board are all linked together.

While this is cool. It clutters up the work space. I think personally Rex needs to compress his plugins a lot more. Board should have matcher and the shapes built in. so on etc.

But to be honest. Rex is a smart guy. He does this because it's a good way for him to generate work. it's great that he releases stuff for free including many CAPX that I notice people build off of rather than learning C2 or programming themselves.

But at the OP. I suggest if your going this path. just hire Rex to do some work. he will get the work done faster and save a lot of grief for you and everyone who helps(except Rex :D)

and also why are you using RexRainbow Function? C2 has a native Function plugin already!
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Wed Dec 11, 2013 2:52 pm

Thanks for responses.

We use Rex plugins because they cover most of the functions we need for a board game. But our problem is not based on these functions.

The question is, how to make a chess selected and moved in a turn-based mode?

One turn: the first click picks a chess, and the second click on an empty tile moves it. But how to make a chess picked?

That mentioned chess source code would be very useful, but we found only a Construct1 version of it.

Sorry if we ask something trivial.

What do you think? Thanks!
B
7
S
1
Posts: 12
Reputation: 556

Post » Wed Dec 11, 2013 2:58 pm

Give the object a boolean variable
on object clicked set set boolean to true
on tile clicked if boolean is true move to tile
on arrived set boolean to false.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Dec 15, 2013 3:39 pm

Thanks, we make a try...
B
7
S
1
Posts: 12
Reputation: 556


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests