Set spawn points for each sprite?

heres my dilema
i currently have 5 sprites and 5 different set co ordinates for each one to spawn into with individual behaviour scripts, however i want each sprite to spawn into one of the set co ordinate without more than one of them spawning into the same point.
so eventually each sprite will spawn into a random set co ordinate
so something like
pRandomStartingLoc = (200,100) (300,100) (400,100) so each sprite spawns into only one set of cordinates without more than one spawning into the same one

Okay fourth time may be the charm.
This behavior contains a Single Locations list that is global to all sprites with this behavior attached. Each sprite picks a random loc from the list and then deletes that value from the list so that no other sprite can use it.
Note: This uses some advanced Lingo, but you should only need to replace the point values in the list of point values.
--  Random Set behavior
property  pSp   -- this sprite
property  pStartLoc  -- this sprites location at beginsprite
-- global/static behavior property
property  curLocs  -- list of sprite locations used by ALL sprites with this behavior attached
on beginSprite me
  -- define our quasi global locations list if it is not defined or is empty
  if me.script.curLocs.voidP OR me.script.curLocs = [] then
    me.script.curLocs = [point(200,100), point(300,100), point(400,100), point(500,100), point(600,100)]  -- Define Sprite Locs Here
  end if
  Locs = me.script.curLocs
  pSp = Sprite(me.spriteNum)
  pSp.loc = Locs[random(Locs.count)]   -- set my location to random point from list
  Locs.deleteOne(pSp.loc)  -- remove this Loc from list so that no other sprite can use it.
  pStartLoc = pSp.loc  -- store current location in case you want to return to it
  -- debug code. Check message window
  put "Sprite " & me.spriteNum & " is at location " & pSp.loc
end beginSprite
on goToStartLoc me
  pSp.loc = pStartLoc
end
on endSprite me
  me.script.curLocs = void
end
on reset me
  me.endSprite()
  me.beginSprite()
end

Similar Messages

  • How to take a single data point for each trigger pulse ( synchronou​s acquisitio​n).

     hi
              im using the pci-mio-16E1 card, with the IDE VC++, so  im looking for an example to explicate me how to make an synchronous acquisition data using an external timing, so the idea is to acquire (take) a single data point for each trigger pulse  from one  input channel ,and saving  the data in a file .
    now im making a code using the AI_setup and DAQ_op functions, im getting  a speed acquisition (it is the start of acquisition data), and  it is  a synchronous acquisition just for one trigger pulse, and me i looking for an acquisition for each trigger pulse. 
      so to  understand my problem you can see my code :
    iStatus = Timeout_Config(iDevice, lTimeout);
             iRetVal = NIDAQErrorHandler(iStatus, "Timeout_Config", iIgnoreWarning);
       //  configuration and selection of  signal trigger  
             iStatus = Configure_HW_Analog_Trigger(iDevice, ND_ON, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
            iRetVal = NIDAQErrorHandler(iStatus, "Configure_HW_Analog_Trigger", iIgnoreWarning);
      iStatus = Select_Signal(iDevice, ND_IN_CONVERT, ND_PFI_2,ND_HIGH_TO_LOW);
             iRetVal = NIDAQErrorHandler(iStatus, "Select_Signal", iIgnoreWarning);
        iStatus = AI_Setup(iDevice, iChannel, iGain);
       iRetVal = NIDAQErrorHandler(iStatus, "AI_Setup", iIgnoreWarning);
       while ((iReadingAvail != 1) && (iStatus == 0)) {
     /* Wait until reading is available. */
             iStatus = AI_Check(iDevice, &iReadingAvail, &iReading);
            iRetVal = NIDAQYield(iYieldON);
           //  Acquire data from a single channel 
        iStatus = DAQ_Op (iDevice, iChannel, iGain, piBuffer, ulCount, dSampRate);
       while ((iDAQstopped != 1) && (iStatus == 0)) {
            iStatus = DAQ_Check(iDevice, &iDAQstopped, &ulRetrieved);
            iRetVal = NIDAQYield(iYieldON);
           iStatus = DAQ_VScale(iDevice, iChannel, iGain, dGainAdjust, dOffset,ulCount, piBuffer, pdVoltBuffer);
          iRetVal = NIDAQErrorHandler(iStatus, "DAQ_VScale",iIgnoreWarning);
       /* Set analog trigger mode back to initial state. */
           iStatus = Configure_HW_Analog_Trigger(iDevice, ND_OFF, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
      /* Set PFI line back to initial state. */
           iStatus = Select_Signal(iDevice, ND_IN_START_TRIGGER,ND_AUTOMATIC, ND_DONT_CARE);
              iStatus = DAQ_Clear(iDevice);
     /* Plot acquired data  */
          iRetVal = NIDAQPlotWaveform(pdVoltBuffer,ulCount, WFM_DATA_F64);
    so this is the data acquired -0.900879,-0.900879,-0.900879,-0.900879,-0.900879,​-0.900879,-0.900879,-0.900879 and i think that is a noise because all time i get this data.
    tank you very mutch fo your help

    Hello,
    Please see the responses to this thread at the following post.
    http://forums.ni.com/ni/board/message?board.id=250​&message.id=13686
    Also, please only post one thread per issue.
    Regards,
    Sean C.

  • How to set command action for each item in the popupmenuimage

    Hi all,
    In my canvas application,i used images for popupmenu.Now i have to set command action for each item in that popupmenuimage.I dont know whether it is possible in canvas or not.Can anyone tell me the solution for this .
    Thanks,
    sourab

    Buttons is typical of a c/s application, or, in case of Web Forms, a Java applet. Instead of buttons, you have to use hyperlinks.
    See:
    http://otn.oracle.com/products/reports/htdocs/faq/faq_migration.htm#346
    The hyperlink wil have to be to a URL that does the insert in the table. This can be a mod_plsql procedure, for instance.

  • Set height size for each state enabling browser scrollbar if needed..

    I'm working on a flex project, completely new to it. I'm trying to resize my application based on the set height size for each state. I'd like the wrapper to resize in the browser so that the  browser's scroll bar appears if needed. hope this makes sense....
    My enitial opening page I've set the height to 1000. now when I click on a link to another state from this page, we'll call it 'home' which i have set to 2000
    The page opens in its 2000 height but no scroll bar appears to scroll down in the browser...
    If anyone's done this or knows how to, I'd really appreciate your input.

    I've done something similar with a few of my apps, you have to use a little javascript on the html page and the ExternalInterface class in your app. Basically, you need to resize the "browser's" height based on your flash file.  So here's quick example:
    In your html template page (which you can edit in your flashbuilder project panel ->html-template->indext.template.html)
    in your html add the jscript function:
    <script type="text/javascript">
             function setWindowHeight(heightVal){
                 document.getElementById('theWindow').style.height=heightVal; // make sure to give the body tag an id of 'theWindow' or whatever
    </script>
    In your flashbuilder app you need to call the javascript fx, you can use the ExternalInterface class for this:
      ExternalInterface.call('setWindowHeight',val+'px');
    you need to send the jscript fx the height of your container or whatever you want it resized to....

  • Set a FocusTraversalPolicy for each of the JPanels

    I have a JInternalFrame that contains a JTabbedPanel that contains 1...n JPanels
    I want to set a FocusTraversalPolicy for each of the JPanels
    independently.
    Each JTabbedPanel has many JComponents.
    Please help ME

    I don't know much about JTabbedPanel but I imagine you can get each of the JPanels contained in it. So couldn't you just set FocusTraversalPolicy for each of them? I guess I really don't understand what the problem here is.

  • Unable to set GL Account for each ItemGroup in Inventory

    Hi,
    I am Using SAP b1 2005b Patch level 27.
    I created one database with "Chart of Accounts INDIA."  then I got Default Chart of Accounts.
    I want to set GL Account for each ItemGroup in Inventory.
    How to assign the Perticular GL Account for Particular Item Group? where can i find this provision in SAP b1?
    I am trying from past 2 days, I did not get the way to assign the GL Account for each Item Group.
    Plz help me asap.
    Regards,
    Nagababu.

    Hello,
    you can set it in the module administration --> setup --> inventory --> item group --> tab accounting. But first you must define the name of item group. it is still in the same form.
    let me know if problem still persists. G'luck.
    Rgds,

  • Insert multiple images in one slide and setting dsiplay time for each

    Hi,
    I am using Adobe Captivate4.
    I could not able to insert multiple images in one slide and set display time for each image.
    Need help in this regard.

    This is not about background image.
    I have 3 images and want to insert in one slide only. I could able to insert image1 for first time, but could not able to insert image2 and image3.
    I have followed the same steps: Insert Menu>Image.

  • Set exported resolution for each image within InDesign

    I'm generating a document in InDesign destined only for the screen (as a PDF) and I'm wondering whether in CS6 the user can set the exported resolution separately for each image. i.e click on a image and set the resolution for that image. Reason: to allow end-viewers to zoom in on certain images and retain quality.
    And while I'm on the subject of changing resolution, a few years ago someone wrote a script for me (in response to a post), that when you clicked on an image within InDesign, resampled the original to 300 dpi, saved it, and made the necessary adjustments in InDesign so the image stayed the same size.
    Can CS6 do that? Or do I need to dig up the old script?

    > ... destined only for the screen (as a PDF) ...
    The developers of PDF will thank you for that statement!

  • GarageBand - How to set different BPM for each track?

    Hi, for the last couple of years, I've been using Sony Acid on my PC to mix multiple tracks to make blends and remixes of songs. I've just switched of the a MacBook, and am trying to get Garage Band to do the same. I'm curious whether or not I can set the BPM of each track individually so they will all play at the same BPM when mixed. I'm only able to find the master BPM that changes the entire BPM. Any help would be great. Thanks in advance.

    Well, as far as I can see you don't really want different BPMs on each track, but you want all tracks to have the same tempo - only you want to make the tracks fit that tempo.
    You could do that in GB by first bringing each of the tracks to the desired tempo, then export it and re-import it. (There's some other ways to do it, but they all involve some fiddling around and maybe some math.*)
    Logic offers a nice feature where you can shorten and lengthen a region just by dragging it out. That could be used for the purpose you're trying to achieve.
    *For example: Determine the BPM of each of the tracks. Set the project's tempo to the BPM of track A. Import track A, turn it purple so it follows the tempo. Then set the project to project B's tempo, import it, etc. You will end up with all tracks in the same tempo, and you can still make the whole project go faster or slower.

  • Setting Inventory Accounts for each Item Grops

    Hi,
    1.I want to set the different Inventory Accounts for each goup in "ItemGrops" In ItemMaster.
    how can i set?
    2. in ItemMaster-> Inventory tab->Set G/L Accounts by option
    when i select the 'ItemLevel' and update it is showing error like
    '"Purchase credit account not defined for this item'"
    how can i rectify this error.
    plz help me asap
    Regards,
    Nagababu

    Nagababu,
    You have stated that you are trying to Set GL by Item Group.  If you want to set GL by Item Group, I am wondering why you are trying to change the setting in the Item Master area by ....ItemMaster-> Inventory tab->Set G/L Accounts
    If you want this setting to be a Global setting for all the Items then you have to set this in <b>Admin > System Initia.. > General Settings > Inventory Tab.... Set G/L Account by</b>
    After this... you can set the different G/L Accounts for each Item Group by accessing the Item Groups itself   <b>Admin>Seup>Inventory>Item Groups</b>
    For each Item Group in the Accounting tab you can set the different GL Accounts relevant to that Item Group
    In case for some items you want the GL's to be different (not based on the Item Group they belong to), then you could go to the Item Master > Inventory tab and change the settings to <b>Item Level</b> and Change the G/L as required.
    NOTE: You do not have to specify the G/L Account for each Item individually if you are going to be using Item Groups.
    Suda

  • Set reference point for coordinates

    How to set the reference point for a rectangle in coordiate system using javascript? I want to set this value before setting the geometricBounds property
    Thanks.

    Hi,
    Try this:
    app.activeWindow.transformReferencePoint = AnchorPoint.BOTTOM_RIGHT_ANCHOR;
    Options:
    AnchorPoint.BOTTOM_CENTER_ANCHOR
    AnchorPoint.BOTTOM_LEFT_ANCHOR
    AnchorPoint.BOTTOM_RIGHT_ANCHOR
    AnchorPoint.CENTER_ANCHOR
    AnchorPoint.LEFT_CENTER_ANCHOR
    AnchorPoint.RIGHT_CENTER_ANCHOR
    AnchorPoint.TOP_CENTER_ANCHOR
    AnchorPoint.TOP_LEFT_ANCHOR
    AnchorPoint.TOP_RIGHT_ANCHOR
    Hope that helps.
    Marijan (tomaxxi)
    http://tomaxxi.com

  • How to set Logo Image for each Project Site Seperately in project server 2010.

    Hi,
    I want different logo images to be set for each Project Site of different  project Separately in Project server 2010.
    Scenario is,   we have different Project of different client , each client want different logo for their respective Projects.
    How to accomplish this task?
    Please Help me.
    Thanks

    Hello. Store the logo somewhere accessible, either in a library at the PWA site collection or on the project site, make a note of the URL to the site then navigate to the project site and depending on what logo you want to update you can click Site Actions
    > Site Settings > title and description then update the image URL there. Alternatively, on the homepage of the project site add an image web part then reference the new logo using the URL. Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • User set cliping points for Highlight and Shadow

    OK I know Lightroom 3 is currently available as a Beta version and is not complete and there may be more features to come.
    But
    Wouldn't it be nice in the develop module to set the point at which you get clipping warnings for highlight and shadow.
    I ask this as a lot of my work goes straight out for repro, and it would be usefull to be able to set the highlight  to say 90-95% and the shadow to about 15-20%.
    OK I know I can run  a tool over the image and see what the percentage is, but it would be a lot esier if I could set my own limits and just watch for the red and blue "blobs"
    Just a sugestion
    John c

    I too find the FTP server implementation to be sorely lacking in OS X Server. There is no option to share out only the designated FTP root folder without showing the other share points. It seems impossible to lock down subdirectories to specific users with letting them see the contents of the root directory. Maddening!
    I'm looking at other FTP server options. Rumpus comes highly recommended, but I also just found CrushFTP which also looks intriguing, especially its option to integrate with LDAP - something that Rumpus does not do. CrushFTP is also significantly less expensive.
    -Doug

  • HT5295 Why do i have to keep setting x2 speed for each podcast that i listen to?

    When I play podcasts through the Music app, I can set x2 speed and it stays selected for all podcasts that I play.  Here, it seems that I have to flip up the settings page and set x2 for each podcast I play.  Why won't this setting persist across plays?

    What do you mean by the settings page? The sped selector is on the Now Playing screen.
    I understant this When I play podcasts through the Music app, I can set x2 speed and it stays selected for all podcasts that I play. However, what  is here in "Here, it seems".

  • Setting language independently for each app

    Before leopard we could set the language of each app independently (in the get info window) but now we are stuck with a system-wide setting. Is there any way to get the functionallity back? And I don't want to manage a separate user for each language, it just doesn't work for me.
    thanks

    Here's the long story:
    I'm tring to have my finder and some apps in french but I want to use some other apps in english (Final Cut, Photoshop, a bunch of pro video apps for work). I use mainly FCP and the thing is that if I open it in french, for some obscure reason it assumes (erroneously) that I must be in France and that I have an azerty keyboard... so all the keyboard shortcuts are changed. It gets absolutely unusable, even undo is changed for something other than command-z. So I tried language switcher, with my system and finder set in french. I ran the list of my apps and decided, app by app, which one I wanted in french and which one I wanted in english. I saved those settings every time, because I felt it would be dumb to have to launch language switcher first each time I wanted to launch an app. Then I launched Final Cut Pro (7.0.3). At first it looked like all went well, it was in english, my system was in french. But when I checked trough the menus, I found that all the menu items were written in english but the keyboard shortcuts associated with them were the french ones! I tried to get it back to work normal by switching the system back to english and doing the reverse process with Language Switcher. Didn't work. I tried three or for other things that didn't work either (and I won't detail them all... sorry). So I reverted to my last time machine backup.
    I assume the .lproj trick you mention is essentially what Language switcher is doing, so that wouldn't do me much good. I really miss the way we could do it before leopard...
    anyways, thanks for answering!

Maybe you are looking for

  • Troubles connecting MacBook to LG TV

    I recently bought an LCD TV from LG, model 32LD358 (full HD, 1920x1080, 50 Hz), but i can't connect my macbook (2010). i bought a minidvi-hdmi adapter and a hdmi-hdmi cable. if i try using 480p as my tv resolution (which seems to be the only one work

  • Jdev 10.1.3.5 problem

    I upgraded my jDev to 10.1.3.5, everything seems working fine until I hit the "deploy" button on the ANT script of my BPEL processes. it's failing to deploy with this error : ORABPEL-05215 Error while deploying the BPEL process was compiled fine so I

  • IPhoto 6 crashes everytime when switching application

    iPhoto 6 crashes every single time when I switch to other applications like mail or iWeb via a command inside iPhoto 6 (emailing pics/ building web site, etc.) or via Finder (using application switcher or not). I did pretty much everything previously

  • PO amendment after creating / adding in system

    Hello Experts, I have noticed a purchase order whose Vendor chagned after creation. I have tested Vendor BP can't be changed in PO after adding it in system. There is a case in which Vendor has been changed. How I found out is : We saw a printout fro

  • Need to reinstall my system, how do I backup iPhoto library?

    I have a very large iPhoto library and now need to reinstall my system. I dodn't want to loose the library but how can I make a save backup that I can import later again?