help! trying to create a chess game!

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Have you looked at the Path finding object ?

  • Have you looked at the Path finding object ?

    I tried using the pathfinding, but the pieces do not stop at the right place ...

    I only did the pathfinding in the Queen:

    Demo

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)