A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Game Movement Problems

  1. #1
    http://www.p-s-p.tk/
    Join Date
    Mar 2008
    Location
    England
    Posts
    20

    Unhappy Game Movement Problems

    Hey guys i solved the last problem i was having but now i need some help, i have a grid (10 by 10) and in the grid are 100 MovieClips named Dice1, Dice2, Dice3 and so on. Basically each dice is either a number between 1 and 6 or a blank frame to suggest there is no dice on that frame. I want to compare the dice in the grid to see if the dice above, below, left and right of the current dice are on the same number and then if there are 6 dice with the number 6 on them they will be removed and points added to a score. The dice don't have to be in a line of 6 but just 6 dice connected. The idea is that if a dice is showing a number and has that amount of dice connected to it either directly or non-directly they will be removed. I can't figure this out, please help.
    http://www.astano.co.uk/GAMES/DevilDice.swf
    (I'm trying to rebuild the PS1 game Devil Dice!)

    Thanks in advance.
    Last edited by Astano; 12-04-2010 at 07:11 PM. Reason: New Problem

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    138
    I am a noob as well, but what I could suggest is a multidimensional array.

    10 arrays within the single array, and each one of those arrays have 10 values.

    grid = [grid01=[0,0,0,0,0,0,0,0,0,0],grid02=[0,0,0,0,0,0,0,0,0,0],grid03=[0,0,0,0,0,0,0,0,0,0],grid04=[0,0,0,0,0,0,0,0,0,0],grid05=[0,0,0,0,0,0,0,0,0,0],grid06=[0,0,0,0,0,0,0,0,0,0],grid07=[0,0,0,0,0,0,0,0,0,0],grid08=[0,0,0,0,0,0,0,0,0,0],grid09=[0,0,0,0,0,0,0,0,0,0],grid10=[0,0,0,0,0,0,0,0,0,0],];

    say grid 02 (lets day grid 01 is top and 10 is bottom) and then 5. well the surrounding would be grid01 4 grid01 5 grid01 6 grid02 4 grid02 6 grid03 4 grid03 5 grid03 6

    so grid01 4 would be grid[0][3] so you would but like, if grid[0][3] == w/e, and so forth, you can do loops to help you run through it all and if the grids around it = your target grid, you turn the character to null inside the loop. and if its null then say the image goes away. Btw, that layout for multidimensional is pretty noob. I am sure there is a array command you can use to get the same result with out typing it all out by hand. I am eager to see this too!

  3. #3
    http://www.p-s-p.tk/
    Join Date
    Mar 2008
    Location
    England
    Posts
    20

    Smile Thank you

    I like your suggestion, i keep thinking of ideas and then realising a problem with it, i will try this idea and see how far i get, good idea Pro suggestions welcome lol

  4. #4
    Senior Member
    Join Date
    Apr 2009
    Posts
    138
    just make sure you implement them correctly, I am not sure how and every one tells me that it will work (as it does perfectly) but its not good programming. So try to see if you can get the correct way to create a multidimensional array and perhaps post back here? anyways keep me updated on your progress aswell

Tags for this Thread

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center