Flash board game - player Make unable to land on the same space as the other player

I am currently working on a basic flash game. The entire game is driven by a spinner. Once a player spins the spinner, it determines it is the player's turn. Once the round is determined, it moves the current player amount appropriate to the spaces. If the current player's final destination is the space that the other player currently resides, I want it to move one additional space.

Here's the function that I work with, and I am struggleing to operate. Any reccomendations, help is much appreciated:

function moveRedPiece (): void

{

trace ("Spin Complete");

for (var i: int = 0; i < numberOfMoves; i ++) {}

If (currentSpaceRed < 28) {}

currentSpaceRed += 1;

}

ElseIf (currentSpaceRed == 28) {}

currentSpaceRed = 0;

}

If (redArray [currentSpaceRed] .x == p1.x & & redArray [currentSpaceRed] there == p1.y & & currentSpaceRed < 28 & & I == numberOfMoves) {}

currentSpaceRed += 1;

redtargetX = redArray [currentSpaceRed] .x;

redtargetY = redArray [currentSpaceRed] there;

plasticUpSound.play ();

var redTween:TweenMax = new TweenMax (p2, 1.5, {x: 3, y: redtargetY + 4 redtargetX, ease:Expo.easeInOut, onComplete:dropMeRed});})

trace ("RED BUMP 1");

}

ElseIf (redArray [currentSpaceRed] .x! = p1.x & & redArray [currentSpaceRed] there! = p1.y & & currentSpaceRed == 28 & & I == numberOfMoves) {}

currentSpaceRed = 0;

redtargetX = redArray [currentSpaceRed] .x;

redtargetY = redArray [currentSpaceRed] there;

plasticUpSound.play ();

var redTween2:TweenMax = new TweenMax (p2, 1.5, {x: 3, y: redtargetY + 4 redtargetX, ease:Expo.easeInOut, onComplete:dropMeRed});})

trace ("RED BUMP 2");

}

else {}

redtargetX = redArray [currentSpaceRed] .x;

redtargetY = redArray [currentSpaceRed] there;

plasticUpSound.play ();

trace ("not");

var redTween3:TweenMax = new TweenMax (p2, 1.5, {x: 3, y: redtargetY + 4 redtargetX, ease:Expo.easeInOut, onComplete:dropMeRed});})

}

}

}

Concerning

If you have made the changes that I proposed (I == numberOfMoves - 1) my guess is redArray [currentSpaceRed] .x! = p1.x or redArray [currentSpaceRed] there! = p1.y for some reason any.

Add this line just before the if statement:

trace (redArray [currentSpaceRed] .x + "is" + p1.x + "&" + redArray [currentSpaceRed] there + "is" + p1.y);

Tags: Adobe Animate

Similar Questions

  • I use dualscreens, whenever I chose the fullscreen on Youtube/contraction /... it always go full screen on my main monito, in any case to make it full screen on the other instead?

    I have 2 monitors: A and B
    My configuration: work on screen (a primer), put the Firefox on monitor B.
    What I need: I need to play full screen on twitch.tv/youtube/... on monitor B (he always go full screen on A every time I try, even though I putted firefox on B)

    Try this:

    1. Close Firefox and start a new session
    2. Open Firefox on the second monitor and change the size of the window
    3. Closing of Firefox
    4. Open Firefox and it should open in the second monitor, until it please try to select full screen for one of the multimedia sites.
  • Satellite P750: Unable to connect to the other PC with WLAN

    Satellite P750 was working fine until yesterday.

    Today, when you use the Atheros AR9002WB-1NG wireless adapter I can't connect to the other pc on the network.
    However, I can connect to the internet ok.
    Other pc can not see me either.

    * When I use wired everything is ok *.
    I tried to stop the antivirus and firewall, but it made no difference. I reinstalled the drivers and etc. shares checked file.

    Can anyone help please?

    Hello

    You should enable the option called Ad-hoc to peer option in your WLan settings!
    Go to network connections
    Select connections-> properties-wireless
    Add the new network
    Here you must configure this (insert SSID, encryption, and password), and don t forget to check this is a computer-to-computer (ad hoc) network

  • How can I make a video reflection (face the other way around)?

    Hi, I would like to have some actors in a video face the opposite direction.  Is there a work around, or the effect, I could use to create a reflection of the image so that what is on the left is on the right?

    Thank you!

    Robert

    First Pro CS6

    After Effects CS6

    Go in the effect controls panel. Search for the word flip. Take the horizontal flip effect and drag it into the clip.

  • Flash getURL links work when SWF is embedded to the Director?

    I have a simple test platform that said no, the links no longer work. All this works?

    My test bench includes two buttons in Flash, you get a PDF from a remote server, the other opens a PDF locally on my hard drive.

    When played from the Flash drive, the local link works fine, the remote link looks like it would work if I was willing to change my security settings and restart.

    When they are incorporated into the Director both links are inactive.

    And, even if it is not terribly relevant, when the SWF file is read remotely via a browser, the remote link works

    Your Flash .swf is expected to be housed in a HTML doc, and so a getURL function is tried to reach out to the browser. When you import your .swf in a film by the Director, the film's Director takes the place of the browser window. If your function does not in a browser. This is compounded if you play the .swf from a Director projector because there is no immediately available browser.

    There is a simple solution. You can use the getURL me, string function in Director to intercept the url.

    So if your Flash animation has something like this:

    ------------
    myButton.onRelease = function() {}
    getURL ("www.disney.com", _blank);
    }
    ------------

    Then in your Director movie, write a behavior something like this:

    ----------------
    thisSprite property

    on beginSprite me
    thisSprite = me.spriteNum
    end

    on getURL me, link, target
    gotoNetPage link, target
    end
    -------------

    Then screw the Flash sprite this behavior.

  • If you use firefox for linux, I'm unable to open the game client for a called flash browser game darkorbit.

    I'm using Linux Mint 17.2 xfce.
    The Firefox I use is 42.0 Mozilla Firefox for Linux Mint Mint - 1.0.
    Shockwave Flash is 11.2r202.
    The browser Flash game is DarkOrbit ( www.darkorbit.com ).
    The game was working fine until about 2 months ago.

    I log in the game (as before) and get on the last page without any problem.
    When I click on 'Start' to go to the game client, the screen is black. The browser tab written game client will blink twice.
    Please note that everything works fine when I use the chrome Web browser.
    DarkOrbit works very well with Firefox on Windows.

    Is there a way to use the pepper Flash used in Chrome/chrome using the freshplayerplugin wrapper.

    Your Linux distro may have related packages for it.

    Alternatively, you can use Chrome or chrome for that one site and use Firefox for everything else.

  • Dragging my updated firefox to update to the latest version and now the game I play which is a flash based game lag all the time in firefox, but not in Internet Explorer

    OK so I play a game called Emporea on my PC and it uses flash, I've never had a problem then I refreshed firefox as she suggested and it updated to the latest version, I've never had problems with it before on previous versions and now, with this, the lag is so bad that it makes the game almost unplayable. I tried to open it in other browsers such as IE, and it works very well in people. so, the question is somewhere with firefox, I've updated my flash drive and still no change in firefox

    One of the changes in Firefox 48-49 title is e10s, separating the process of browser interface process page content. The performance impact of this can vary a lot between the systems, and it would be useful to know if you have this feature enabled. To check this, either:

    • button '3-bar' menu > '? ' button > Troubleshooting Information
    • (menu bar) Help > troubleshooting information
    • type or paste Subject: support in the address bar and press enter

    In the first table on the page, find the line of Multiprocess Windows and see if the number on the left side of the fraction is greater than zero. If so, you are using e10s.

    If you use e10s:

    To determine if this feature is causing this problem, you can turn off as follows:

    (1) in a new tab, type or paste Subject: config in the address bar and press enter/return. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste the cars and make a pause so that the list is filtered

    (3) double-click the preference browser.tabs.remote.autostart.2 to switch the value from true to false

    Note: the exact name of this preference may vary, but it will start by Browser.Tabs.Remote.AutoStart

    On your next startup of Firefox, it must be run in the traditional way. Any difference?

  • try to uninstall freeride Games Player about Win8 EXEtender problem occurs.

    I'm trying to uninstall freeride Games Player and my computer is not letting me do, it displays an error saying 'EXEtender' ' an installation support file could not be installed. The system cannot find the specified file. "I use a windows 8 OS so someone help me please.

    Hi Roman,

    1. is the specific issue of uninstalling freeride Games Player?

    2. How do you try to uninstall the game?

    I want to tell you that the software runs as a service in the background, which could make the difficult uninstall without first disable the process.

    Here are some ways you can follow to resolve the problem:

     
    Method 1:
    Run the fixit with the help of the link and then try to uninstall the game.
    Solve problems with programs that cannot be installed or uninstalled

    Method 2:

    a. in the screen, press the Windows key + X
    b. Select "task manager".
    c. in the Search tab process for the process of «GPlayer.exe»
    d. click on it and click "end task."
    e. now, try the uninstall again.

    Method 3:

    "Player of the 'Free Ride Games' must be disabled before you start the uninstallation process. To disable the 'Free Ride Games' reader, right-click on the 'Free Ride Games' icon, then click on the button "Exit".

    Now, try to uninstall the reader 'Free Ride Games'.

    Steps to follow:

    has from the screen, press Windows key + X
    b. Select Control Panel.

    c. click on programs and features.
    d. find and right click on the 'Free Ride Games player"and click the Uninstall/Change button.

    Hope this solves the problem. If the problem persists, you can write to us and we will be happy to help you further.

  • I have a Dell Inspiron 1545 and I can't download Adobe flash or Adobe acrobat reader, when I try to play my games it says upgrade from flash and when I try to download it on the screen comes empty

    I have a Dell Inspiron 1545 and I can't download Adobe flash or Adobe acrobat reader, when I try to play my games it says upgrade from flash and when I try to download it on the screen comes empty

    Try offline installers:

    For Adobe Reader: http://get.adobe.com/reader/enterprise/

  • How can I implement ads my flash android game?

    I have a problem on the implementation of your ads in my flash android game. I searched on Google Adsense, but their code is not mobile phones. I raised my admob, but you need to add your game on the first play store. I am relatively new to actionscript, so could you please help me with this in simple terms?

    It won't be easy, unless you make your own ads.

    If you do it yourself, you must use ads to someone else.  If you use a different ads, you must use their api to include their ads to your game.

  • How do you create a flash in-game popup on the same frame?

    How do you create a flash in-game popup on the same frame?
    I need to make a popup in flash on the same chassis. Basiclly as you reach the framework and randomly (I know how to do things at random) a popup can appear saying that you got a price; and I want that things in the back remains the same.
    Please help me!
    Thankx in advance.

    Code is placed in the timeline in the framework where you intend it to be.

    You have not given enough information to be able to help with your problem of var timer.  Try to reason it yourself well.

  • In the middle of a game of backgammon the other player just won't move.

    Original title: question of Backgammon

    Hello, I'm in the middle of a game of backgammon and the other player just won't move.  I tried the boost device, but which did not expel them and have not reached the still.  Ideas?

    Hi PeteSenf,

    You can close and start a new game and check.

    Check out the link:

    Internet Backgammon: how to play

    http://Windows.Microsoft.com/en-us/Windows7/Internet-Backgammon-how-to-play

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • I'm unable to get on the daily challenge of Microsoft games. Getting a message that says code error xbox 004500

    I am unable to connect to the daily challenges of Microsoft games.  Get an xbox 004500 error message

    Hello

    The Microsoft Community (formerly answers) has no influence on the XBox or XBox Live
    If you need to contact them.

    XBox - Support
    http://support.Xbox.com/en-us/pages/default.aspx

    XBox - Contact us (support)
    http://support.Xbox.com/en-us/contact-us

    XBox - Support Forums - and my XBox (top-right)
    http://forums.Xbox.com/

    Xbox technical support phone number

    • Toll-free: (800) 4MY-XBOX or (800) 469-9269

    Opening hours: 600 PM 2200 h / Pacific / daily

    International (direct line in the U.S.): 425-635-7180

    XBox LIVE - Service status
    http://support.Xbox.com/en-us/Xbox-Live-status

    Manage the XBox Live account
    http://support.Xbox.com/en-us/billing-and-subscriptions/account-management/Xbox-Live-account-management

    XBox Live Sign-in problems
    http://support.Xbox.com/en-us/billing-and-subscriptions/Windows-Live-ID/Xbox-Live-sign-in

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How to open torrent files hoyle board games that I can play chess & cribbage

    How to open torrent hoyle board games so I can play chess & cribbage & where I put that means that the file

    Ask the source you got the file from.

  • Hoyle Board Game is not displayed correctly

    Hoyle Board Games

    I have not had any problems with any of the Hoyle Board Games, except the games of pool, where my video goes in horizontal lines, and I'm told through popup balloon which the view needs to change to 16-bit color to display correctly. Unfortunately, it's my favorite game.

    Hello

    • What operating system is installed on your system?

    It seems that the game works on the 16-bit color depth, you can change the number of colors by following the steps below and check if the problem persists.

    Steps described below applies to Windows 7 and Windows Vista.

    (a) right click on an empty space on the desktop and click on the Screen Resolution. (See screenshot below)

    (b) select the monitor screen to change the color bit depth for. (See screenshot below step 3)

    (c)   click the link Advanced settings . (See screenshot below)

    (c) click the monitor tab.

    (d) select colors available in the dropdown of the wick of the color you want...

    (e) click Yes to confirm the change of color bit. (See screenshot below)

Maybe you are looking for

  • message on my Apple Iphone SE

    I received a message on my Apple Iphone is "your Apple ID and phone number are currently used on a new Mac" what does that mean?

  • Back to 'Vanilla' after messing around with Triple Boot

    First of all, you should know, I wonder a "software-handyman' - I LOVE messing around with my MacBook startup files, and sometimes I'll even an exaggeration with which. At the moment I'm running on a bootloader custom (refined) installed on am modifi

  • Duel to start a G20

    Hello I have a little problem and I was wondering if someone could help. I have a g-20 and will have to Duel Boot of the machine. Only problem it is a Serial ATA HARD drive in. When you run the XP installation, it is said that no HARD disks are decte

  • Como hacer a 8 ecualizador bandas?

    Hola a todos, soy nuevo in el foro... soy estudiante of carrera in ing. El en electronica Instituto Tecnologico de Hermosillo, estoy throughout the virtual Instrumentacion materia... el caso're tengo do a 8 ecualizador bandas... Against una funcion i

  • I scan a document to an email

    I can't get my HP Deskjet to scan so that I can email a document. Can someone please