Results 1 to 4 of 4

Thread: Match3 Engine

  1. #1

    Match3 Engine

    ..............
    Last edited by ironquark; 13-03-2012 at 11:30 PM. Reason: ..........

  2. #2
    I can't get it to crash at all, can you tell more detailed steps? Also, you are using generics which aren't supported in my old Delphi7 - so can't compile it

    As for the pieces moving, you need a timer with small interval for it. There's hundred different ways, but this is 1:
    - In the onMouseUp event set moving := true, and save vector := piece2.position - piece1.position, set delta: single to 0.
    - In the onTimer, draw piece1 to piece1.position + vector*delta and piece2 to piece1.position + vector*(1-delta), then add delta by something like 0.05 per tick.
    - When delta>=1, set pieces to final positions and stop animation.

  3. #3
    Quote Originally Posted by User137 View Post
    I can't get it to crash at all, can you tell more detailed steps? Also, you are using generics which aren't supported in my old Delphi7 - so can't compile it

    As for the pieces moving, you need a timer with small interval for it. There's hundred different ways, but this is 1:
    - In the onMouseUp event set moving := true, and save vector := piece2.position - piece1.position, set delta: single to 0.
    - In the onTimer, draw piece1 to piece1.position + vector*delta and piece2 to piece1.position + vector*(1-delta), then add delta by something like 0.05 per tick.
    - When delta>=1, set pieces to final positions and stop animation.
    press the right button of your mouse to put the blocks at the board:




    Uploaded with ImageShack.us

    and when you match pieces below the blocks it crashes...

    I'm using Delphi 2010 instead Delphi 7

    I've posted the code to see if somebody can help...

  4. #4
    The "Crash" problem happens on the ApplyGravity function,

    Swap(A, B);
    Exit(True);

    You have to do something to avoid it Swap pieces out of bounds, on some tests it tried to swap a piece on -1,4

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •