User Tag List

Results 1 to 7 of 7

Thread: Chess/Checkers Movement

  1. #1
    No Products Registered

    Join Date
    Jun 2007
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chess/Checkers Movement

    I have a student who wants to move players on a game board. What condition and action would you create to make this happen?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperiOS Export ModuleMac Export ModuleSWF Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JasonDarby's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    4,938
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Chess/Checkers Movement

    Are they actually wanting to create a board game or just a fake movement on a board?

    Because setting up a path movement with nodes is a good way of doing a fake board movement.

    It really depends, any info you can provide would be great

    Jason

  3. #3
    No Products Registered

    Join Date
    Jun 2007
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chess/Checkers Movement

    One wanted to try and create a chess game. But I'm not sure I know the difference between creating a board game where the pieces are able to be moved by a player or creating a fake movement on the board?

    Is the fake movement one in which the piece moves by itself?

    He wants the movement of the chess piece to be up to the players. So would you have to create a path on every square on the chess board?

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperiOS Export ModuleMac Export ModuleSWF Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JasonDarby's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    4,938
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Chess/Checkers Movement

    There are a couple of ways to do it, but from the top of my head... yes you could create a movement path. But thats alot of precise work. For example the Pawns, you could create one, do all the movements for one square, and two square movements, then clone it to do all the others, and then clone again and replace the black pawn with a white pawn. So though its some work, there are ways to cut it down.

    Another way would be too do it all in the event editor. Using an array perhaps.

    As long as you know the distance between each square, and can compare an array or global value to see if there is a chess item already on the board (so it doesnt move through it).

    Its not straight forward, but possible.

    Hope something there helps

    Jason

  5. #5
    No Products Registered

    Join Date
    Jun 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chess/Checkers Movement

    You could put grids all over the board (use active objects but make them invisible) then make it so when you click on a piece a
    White square appears around the piece taking up the number of grids it can move. Then do something like:

    +Mouse is over "movement Square"
    +User clicks on "grid"
    Then position "game Piece" at 0,0 of "grid".

    Or something like that.
    It would only work for a game like Checkers, because Chess is a bit more complex.

  6. #6
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chess/Checkers Movement

    If I had to do this then the easiest way would be to use an array, and the pathfinding object combined with EasyGrid (or just a little math).

    Basically the concept is the game board forms a grid. Every square is a cell.

    Let's assume that each cell is 32x32 pixels. If I had a 5x5 grid then that gives a total size of 160x160 pixels.

    Let's say I was at the top corner of the grid and I want to move to the middle of the grid:

    Code:
    [S][ ][ ][ ][ ]
    [ ][ ][ ][ ][ ]
    [ ][ ][F][ ][ ]
    [ ][ ][ ][ ][ ]
    [ ][ ][ ][ ][ ]
    The start (marked with an S) is at 0,0 on the grid or 0,0 when converted to screen coordinates (0x32,0x32 although you may want to add an origin which would make it OriginX+0x32,OriginY+0x32).

    F would be at 2,2 (because it is 0 based) and so that position would be 2*32,2*32 or OriginX+2*32,OriginY+2*32.

    Ok so now we can position our objects. We find that to move from S to F we need to move through the cell marked with an M.

    Code:
    [S][ ][ ][ ][ ]
    [ ][M][ ][ ][ ]
    [ ][ ][F][ ][ ]
    [ ][ ][ ][ ][ ]
    [ ][ ][ ][ ][ ]
    That is where the pathfinding object comes in. Using the pathfinding object you can calculate the shortest path between S and F .

    Once you have pieces on the board then they become obstacles.

    Imagine I had a piece at the spot where M is:
    Code:
    [S][ ][ ][ ][ ]
    [ ][P][ ][ ][ ]
    [ ][ ][F][ ][ ]
    [ ][ ][ ][ ][ ]
    [ ][ ][ ][ ][ ]
    Then to get from S to F I need a new path which are shown now by numbers:

    Code:
    [S][1][1][ ][ ]
    [2][P][1][ ][ ]
    [2][2][F][ ][ ]
    [ ][ ][ ][ ][ ]
    [ ][ ][ ][ ][ ]
    Now the hard part in all of this is restricting that path and implementing all sorts of rules (like movement ranges, ect).

    Good luck .

    EDIT: Just realized that TGF 2 wouldn't have the pathfinding object... That is a shame .

  7. #7
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chess/Checkers Movement

    Here is an EXE realization of what I am talking about: Board Test

    Left click to calculate a path, right click to place a stone, press C to clear all of the stones.

Similar Threads

  1. Changes to my extensions (INI++, Chart object, Spell checkers, etc.)
    By Jax in forum Multimedia Fusion 2 - Technical Support
    Replies: 27
    Last Post: 9th March 2014, 08:37 PM
  2. Checkers / Fox and Geese tutorial
    By redpandagames in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 7th July 2013, 06:53 AM
  3. Checkers Electric
    By Jeff in forum iOS Released Games & Apps
    Replies: 7
    Last Post: 4th June 2012, 06:06 PM
  4. Replies: 0
    Last Post: 9th January 2012, 04:34 PM
  5. chess style movement
    By rhoymand in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th February 2007, 02:24 AM

Posting Permissions

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