Help making a character fall below surface...

I have a game I'm making and have been programming for awhile that I just recently got back to, and am need of assitance trying to make the main character fall and spawn to a previous location when he falls of the main platform/surface which he is continuously running on. This is a new endeavor for me and perhaps I'm just overly tired today, but I can't wrack my brain around it, any assistance is greatly appreciated.
My current code for the jump function in scene, and starting code for fall animation(with "wally" being the mc character, for reference), plus the Array I'm trying to reference:
var iceiceArray = new Array(ice1,
ice2,
ice3,
ice4,
ice5,
ice42);
ice1.addEventListener(Event.ENTER_FRAME, villainsLeft2);
function villainsLeft2(event:Event)
          for (var i:Number=0; i<iceiceArray.length; i++)
                    iceiceArray[i].x -=  15;
//jump function
var grav:Number = 10;
var jumping:Boolean = false;
var jumpPow:Number = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(Event.ENTER_FRAME, update);
function onKeyDown(evt:KeyboardEvent):void
    if(evt.keyCode == Keyboard.UP)
        if(jumping != true)
            jumpPow = -50;
            jumping = true;
wally2.startY = wally2.y;
function update(evt:Event):void
    if(jumping)
        wally2.y += jumpPow;
        jumpPow += grav;
        if(wally2.y >= wally2.startY)
            jumping = false;
            wally2.y = wally2.startY;;
//falling function
if (!wally2.hitTestObject(iceiceArray)) {
          wally2.y -=15;

your syntax is wrong.
Think about it: a Logical statement is evaluated this way:
if(true){
    doTrueStuff();
}else if (false){
   doFalseStuff()
in your case:
wally2.hitTestObject(iceiceArray[i]) is first evaluated (befroe the negation), so if you actually hit, say the iceplatform nr.7 it evaluates to TRUE
then you are negating the TRUE (!TRUE=FALSE), making it FALSE (so the condition does not enter your subroutine)
then instead of leving the for loop with a return (because after checking that your player hits one of the platforms checking the rest is not necessary)
you simply continue the loop, thus "overriding" anything you previously evaluated in it.
you should write
          for (var i:Number=0; i<iceiceArray.length; i++)
          // if you don't hit platform...
          if (wally2.hitTestObject(iceiceArray[i])) {
        //give the backbouncing a little more space, othewise (if your platform is not pixelperfect placed, you might nit get out of the collision zone with one collision detection)
          wally2.y += 5;
          return;

Similar Messages

  • Requirements transfer to follow up materail, if the stock falls below

    Hi All
    The issue is related to the requirements transferring the follow up material,
    when the inventory falls below the safety stock,
    the requirements has to generated for the follow up material,  in which is maintained in MRP 4
    =================
    Here in our case,
    when the Inventory stock falls below the SAFETY STOCK,
    the requirement are getting generated for the same material, but not for the follow up material( which is maintained in MRP4)
    ========================
    What is the way out for transferring the requirements to follow up material (which is maintained in MRP4), in case of stock falls below the safety stock  ?
    Thanks  & Regards
    BRSR

    requirement was already clear when you explianed in the first attempt.
    i was trying to verify from you did you done anything on that or read any material for follow on mateial.
    so follow on mateial has 2 stategies  (please check in SAP help file as i didnt worked on this from long time)
    1. to use the all existing stock of old and pass the requirement to other
    2. on the perticular date ignore any requirement for old material and pass all requirement to new mateial.
    there is not way to achive your expected results.
    and i am not finding any business requirement that way....what is point of thinking "safety stock" when the material is going to replace by other material.
    Please think on this.
    Regards,
    Pravin M.

  • Error Message in Delivery : Quantity falls below minimum inventory level

    Version : SBO 2005 A SP01 PL22
    Description of Issue:  When trying to Add a Delivery you get Error Message: Quantity falls below minimum inventory level [Delivery - Rows - Warehouse Code] [line: 0]  [Message 131-14].  You are then unable to Post the Delivery and Print the corresponding Packing List.
    Testing Findings:  Upon detailed testing of this issue and work with SAP Support it has been determined that the issue is that the Delivery Row Ordered Qty is looking at the OITM In Stock Qty when determining if the full Row Qty can ship instead of the OITW In Stock Qty.  This is an issue because due to other "bugs" this Client has encountered their OITW Qtys in other Whses are negative, even though they have the Block Negative Inventory and the Manage Inventory by Warehouse Flags Checked On.  This then reduces the OITM Qty below the level of the Delivery Row and you get the above error message. 
    Example:  A Sales Order Row has an Order Qty of 15 for Whse 01 for a particular Item.  The OITW In Stock Qty for Whse 01 = 17.  The OITW In Stock Qty for Whse 03 = -7.  The Block Negative Inventory and Manage Inventory by Whse Flags are both Checked On.  The 'Net' OITM In Stock = 10.  When you try to Copy the Sales Order to a Delivery and Add the Delivery, you get the above Error Message and it will not allow you to Post the Delivery and Print the Packing List.
    Current Workaround:  Client is performing Inventory Goods Receipts to bring the In Stock Qtys in the affected Whses to greater than or equal to zero.
    Proposed Solution:  SAP Development to add logic to SAP Business One to validate the Delivery Row Qtys to Ship against the OITW In Stock Qtys instead of OITM when the Manage Inventory by Whse Flag is checked on. 
    Supporting Documentation: This DRQ Request relates to Support Message # 864405 2007.  All above referenced testing details including example SO#'s, Item #'s, etc. and an entire copy of the Client's database are available and linked to this Message #.

    Hi Ramu,
    also you can  make sure you are choosing the right WH in ctrlshiftS windows if You do, then chek on Inventory -> Inventory report -> inventory status if you have enought and available quantities for the delivery, if you dont then you gonna have to make the PO and the AP Invoice to add more quantity to that item
    regards

  • Error While Creating Delivery : "Quantity falls below minimum Inventory"

    Hi All,
        I have an error while creating a delivery in BusinessOne. I have created a new item using the BusinessOne UI. And i created the salesOrder for this item and it was created successfully. But when i tried to create a salesDelivery for this Item i am facing an error that "Quantity Falls below Minimum Inventory".
          How can i solve this? How can i add quantities for this item in the inventory?
    Thanks in Advance,
    RAMU.

    Hi Ramu,
    also you can  make sure you are choosing the right WH in ctrlshiftS windows if You do, then chek on Inventory -> Inventory report -> inventory status if you have enought and available quantities for the delivery, if you dont then you gonna have to make the PO and the AP Invoice to add more quantity to that item
    regards

  • Help making a Install USB of os x 10.4.6. for my Macbook 1.8ghz

    Hi,
    I need help making the USB install of os Tiger.
    The drive is having trouble reading the install disc I own so I am trying to make a USB install of it.
    I wantto install from the usb not install to it to be clear.
    Things I have!
    X1 8gig sandisk flash drive
    1 Macbook white 1.8 ghz Intel
    1 Pc with Macdrive 7
    1 Install disc that seems to have trouble being read in the drive > few marks on the disc and the mac DVD drive make lots of noise reading it but
    It will go to Disk utilities.
    Seems to be a bug in Tiger and restore doesn’t seem to work as in I can’t drag and drop a source to the restore the DVD to the flash drive.
    I already tried only 1 time to copy the DVD to the formatted flash drive using Macdrive and it read it as a bootable drive but the apple simple came up
    And then I got a the error (Can’t find driver for this platform error APCH or something like that.
    I have a torrent download of OS x 10.4.6 as well just in case some files are corrupted > I own the disk so it’s not illegal.
    I am new to mac but long time user of PC.

    Ok ..you need another Mac to make this work!
    you just use another mac even a old one like g4 to make a restore to a flash drive that you have formatted and verified.
    Bye
    Sam

  • I am trying to complete a form but can't get to the final drop down question as it is not displayed because it falls below where my screen ends.  i have tried changing the resolution but that doesn't work.  any suggestions?

    i am trying to complete a form but can't get to the final drop down question as it is not displayed because it falls below where my screen ends.  i have tried changing the resolution but that doesn't work.  any suggestions?

    brilliant
    google chrome works where safari doesn't on my macbook air.  many thanks
    i now have an embarrassing qu.  have dowloaded spider solitaire (sad!) and i can't add cards at the bottom of a column for the same reason - the display cuts short.  i have tried to extend it with the arrows in the bottom corners but it makes no difference.  any ideas?

  • Quantity Falls Below Minimum Inventory Level

    Hi!, I have an item that we manage  by warehouse, we've set the minimum inventory level to 5000 pieces.
    So the MRP has procured me 5000 pieces through a purchase order. I received my item through Goods Receipt PO and now that I want to transfer it to another warehouse I get a message "Quantity Falls Below Minimum Inventory Level".
    I though the purpuse of the minimun inventory level was to procure more, not to lock transactions on the item. Is there a setting that I can tweek so I can use my 5000 pieces?
    Thank you.

    Hi,
    That message is a warning only.  If you have enough authorization, you could still get all necessary transactions done without problem.  The message is not avoidable.
    Thanks,
    Gordon

  • I need help making Adobe Edge animation appear correctly on iphones, ipads and android phones.

    I need help making Adobe Edge animation appear correctly on iphones, ipads and android phones. It currently looks fine on desktops and androids. I am using wordpress with a responsive theme (Canvas). I will need you to document The url is http://adamhtc.org.s183459.gridserver.com.

    Thanks George, interesting thought.  I looked on Adobe's site and they "advertise" fillable forms for the iPhone and Android markets, but on the Windows Phone tab, that is mysteriously missing.  lol    Maybe it will come later?   Meanwhile, I'll google to see if there are any PDF viewers that can handle it now.   Thanks for the reply.  :-)

  • Help making a logon page

    I need help making a simple logon page in Dreamweaver MX. I
    have tried Visual Basic. and several other methods to no avail. If
    someone could help me it would be greatly appreciated
    Ron Hansen

    Hi Ron
    The proceedure is pretty much the same in
    PHP/Coldfusion/JSP/ASP.
    There is a very easy to follow example in the Dreamweaver
    Help File.
    Just go to Help-->Developing Applications Rapidly -->
    Building pages that restrict access to your site (ColdFusion, ASP,
    JSP, PHP) --> Building a login page
    I don't think it can get much easier. But remember that you
    will need to have a database table of user details in place to
    complete the process.
    Good luck.

  • Need Help making a Screencast for IPHONE

    Hello there
    I need some serious help making a screencast for a client - for it's Iphone Apps -
    something similare to this
    http://www.newsluxe.com/chaumet-et-iphone.php
    but more sexy, with a animated background and a different type of cursor.
    Anyideas ?
    I really don't know where to start - I found leads however :
    Camtasia Studio , screenflow, ,
    Maybe you could help me filling the gaps.
    Thanks for your help !

    does anyone know how apple made these forums?
    I think they use Jive:
    http://www.jivesoftware.com/products/forums/
    The Apple way for users to add photos is the .Mac web gallery:
    http://www.apple.com/ilife/iphoto/#webgallery

  • My grandma is a new apple user and she needs help making an apple account.

    my grandma is a new apple user and she needs help making an apple account.

    She should call Apple support or visit the Genius Bar at an Apple store (make an appointment first at http://apple.com/retail). They will walk her through the process.

  • Help making a clock

    Hey,
    I was hoping to get some help making a clock update for me, but I don't want just to show the actual date, I know how to do that. What I want is to be able to set a time, and then the clock start running from then. For instance, after I enter Jan 3rd, 2005 at 3:43 as my time and date, I want the clock to start from there and update every second. Does that make sense?
    Could someone help me out where to look to get this to happen? Thanks!

    I think the OP wants to be able to set a time OTHER
    than the current time. He doesn't want to wait
    untill the time you entered to have the clock tick,
    he wants to have it tick immediately from the "fake"
    time that you've entered.
    At least that's how I understood him. The offset is
    the difference between the real time and the fake
    time entered by the user.
    If he just wants to display the current time, but not
    stat doing that untill some point in the future then
    yeah TimerTask is the simplest way to do it, but I
    don' think that's what he's trying to do.thanks for the replies guys. I appreciate it. Sorry if I was a bit unclear. Norweed was right in saying that I want to set the time and start updating immediately, not wait until the time reaches my entered time and then count. Sorry for the confusion.
    I was thinking that a offset would work, thanks for recommending that. I'm wondering if the time will get off after a while, I need this program to run probably arounnd 2-3 hours. Hopefully it won't drift very much over that time.
    Thanks all for the recommendations and I will check all that out.

  • Help Making a Ringtone!

    Hi,
    I can't seem to make any ringtones for more than the first 15 seconds of a song in garageband. I know the songs I am trying to use are unprotected because they are recordings of me playing jazz and we didn't protect them, they are in mp3 format. But I can't get mp3 mp4a or AAc format to play more than the first 15 secs. I tried tuneclone, mp3 converter and everything. All i want to do is create a ringtone of a song. please help.

    harriettfromjacksonville wrote:
    Purchased a ringtone and need help making it my ringtone for my new Iphone.  Help.
    You have to create the ringtone.
    There are many free ways to do this.  Google will find them.

  • FCE helps making better quality videos than imovie?

    I have been using iMovie HD and it looks like its corrupted and cannot re-install it since I lost the disk image.
    I am thinking of going to FCE over upgrading to iLife 09.
    Does FCE helps making better quality videos than imovie?

    Eswar M wrote:
    ... Does FCE helps making better quality videos than imovie?
    if your source is miniDV/Standard - yes.
    if your source is 720p or iFrame - no.
    in terms of speed and simplicity - iM09 is 'better'.
    in terms of options and feature - FCE is by far superior.
    note: iM09 is no 'upgrade' of your version, but a from ground off new app.
    another note: FCE has a very steem learning curve, but after managing that is a fantastic tool!

  • Name of date table when Stock level falls below Reorder level

    Hi,
    I want to know is there any table where we can find the date when stock level falls below the recorder point(View - MRP1(MRP Procedure))?
    Please update.
    Thanks
    Dipak

    Not answered.

Maybe you are looking for