help! trying to create a chess game!

Get help using Construct 2

Post » Tue Feb 18, 2014 12:35 am

I'm trying to create a game of chess in which the pieces move as in the "Battle Chess: King Me". I just want to be able to click on the piece, click where I want it to go and it start to walk towards the square that I ordered.

Here's what I did:
Demo
B
3
Posts: 2
Reputation: 208

Post » Tue Feb 18, 2014 5:03 am

Have you looked at the Path finding object ?
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,701

Post » Tue Feb 18, 2014 6:51 pm

[QUOTE=emoaeden] Have you looked at the Path finding object ?[/QUOTE]
I tried using the pathfinding, but the pieces do not stop at the right place ...

I only did the pathfinding in the Queen:
Demo
B
3
Posts: 2
Reputation: 208

Post » Tue Feb 18, 2014 7:02 pm

Put your pawns in a pawnsfamily

board tiles should have origin point in the middle

add pawnsfamily instance variable: targetx,targety

on click targettile, set the pawnsfamily variable for the active pawn

targetx = targettile.imagepointX(0)
targety = targettile.imagepointY(0)


event:
for each pawnsfamily
sub:
compare 2 variables
distance(pawnsfamily.X,pawnsfamily.Y,pawnsfamily.targetx,pawnsfamily.targey) > 5
action: move pawns family at
angle: angle(pawnsfamily.X,pawnsfamily.Y,pawnsfamily.targetx,pawnsfamily.targety)
pixels: 50*dt


lennaert2014-02-18 19:02:55
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests