Is it possible to change the status of an object?

Hello!

I'm currently learning AS3 to develop my own game, but is my experience in game development with LUA script. Lua script, you can write/script objects with different status, with IF statements.  For an example,

Code:
if(ObjGet(ObjFind(1001),O_STATUS)==1)     
    {
     This will happen
    }
   else
   if(ObjGet(ObjFind(1001),O_STATUS)==2)
   {
     This will happen
    }

In other words if object 1001 (for example, a key) put the criteria of status 1 = this will happen or if he put 2 status = another triggered event. I was wondering if it is possible to do with the AS3 code?

Let me explain what I want to achieve, I want an event when you kill enemies of script, it turns block that the player challenges. I thought to do through frameworks of the enemy object - 1 enemy = frame, 2 = block.

Code:
if (player.hitTestObject(enemy))
               {
            health.meter.width--; ///reduce health of enemy
                        }
                     Collision.block(player, enemy); ///enemy bounces off player
                         }
               if (enemy!= null)
               {
                    if (enemy.hitTestPoint(bullet.x, bullet.y,true))
                         {
                         enemy.meter.width -= 5;
                         enemy.gotoAndStop(2); //// frame 2 - block
                         removeChild(bullet);
                          {
                              if(enemy.gottoAndStop(2)) /// if frame 2 enemy
                          }
                    Collision.block(enemy, player); /// player can push f2 enemy
                          }

I tried this code, it does not work and also haven't tried the code of State above my experience both Lua, no chance. Any suggestions? Any help would be greatly appreciated.

P.S - Question at random - how to make books/sites that share script files to look at to make reference to and learn?

Your lack of proper indentation promotes a difficult read, but you can reduce that to...

If (player.hitTestObject (enemy)) {}
If (player.currentFrame == 1 | player.currentFrame == 3) {}
-Health.meter.Width;
player.nextFrame ();
}
Collision.Block (player, enemy);
} Else if (player.currentFrame == 2 | player.currentFrame == 4) {}
player.prevFrame ();
}

Tags: Adobe Animate

Similar Questions

  • Is it possible to change the scale of an object with parallax scrolling in Muse?

    Is it possible to change the scale of an object with parallax scrolling in Muse?

    Hi Cashmoneydonuts,

    You can create an animation for it using edge animate and add it to the Muse.

    The following link might be useful:

    Brighten up the Adobe Muse CC sites with animation effects. Inspired by Adobe Magazine

    Concerning

    Sonam

  • Add or change the status of subject?

    Hello

    I am fairly new to this community and may also not yet that familiar with RoboHelp 9, I used recently. I have notices that there is the possibility of changing the status of subject for example on loan for the examination etc. in RoboHelp.

    We work in a small team of 3, often on the same project using RoboSource. I would use the status of subject in order to follow if the author or the translator has completed all its work to ensure that follow-up author is aware that he can basically start with its tasks. I know there is the to do list, but I did not find as tools of reporting practices on the status of subject.

    My question is now, is there an option to increase the status of additional subject or any chance to add the to-do List example to the pod list items as column title? Perhaps there is a more practical way to achieve the same result.

    Thanks for your help!

    Kind regards

    Christian

    Welcome to our community

    See if the video below helps you sort.

    Click here to see

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Is it possible to change the ToolTips delay?

    Hello

    I often find the easiest way to distinguish it from the similar windows on the taskbar is by the complete path provided in the ToolTip. However, with the display of thumbnails enabled, you must first hovering over the taskbar button, there is a slight delay before the thumbnail appears, there is a longer delay before the ToolTip text appears. Once the thumbnail appears I can move the cursor on the other buttons bar tasks and their thumbnails appear instantly, but there are still delays for the ToolTip text. It becomes quite boring.

    Is it possible to change the deadlines so that a) the thumbnail appears a little faster, and b) the ToolTip appears much more quickly (preferably at the same time as the thumbnail)?

    There are other places in the UI I want tooltips to climb faster. For example in Explorer or on the desktop, in some views, the full name is too long to see if I need the ToolTip to read. Is it possible to change the tooltip thus delays?

    Personally, I prefer to have ToolTips set up instantly and maybe a way to make them disappear if they get in the way. In fact, what Windows needs is a status bar as at the bottom of most browser windows. Then, there would be a permanent area to display additional information without cluttering the user interface. Too bad Windows 7 doesn't have it.

    Thank you.

    OK, are you up to now?

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify]
    "BalloonTip' = dword:0000000 has

    Messages rating helps other users

    Mark L. Ferguson MS - MVP

  • Is it possible to change the name of a HP LaserJet 4250 tray?

    Hello

    We have a HP LasterJet 4250, and we use Windows 7 64-bit.

    Is it possible to change the name of a HP LaserJet 4250 tray?

    Greetz,

    Jurrien Bruggink

    Well there's no easy way to do I know offshore. I have come across this thread on Apple support community: Print rename status bar. They're editing the PPD file to change the names of the bins. It seems that it is possible within the OS X with some serious tinkering.

    I couldn't find a place were someone was able to change the names of plateau in a Windows environment.

    I hope this helps!

    -SeanS

  • Manager disc Snap-in for the MMC. Is it possible to change the order of columns. Or remove columns completely?

    Manager disc Snap-in for the MMC. Is it possible to change the order of columns.  Or remove columns completely?

    I would like to move the capacity;  Space free; Status; to be fair, Volume.  The page layout;  Type; File system; seems to me

    useless in this form.  If there is no way to change maybe someone at Microsoft may include this option in Windows 9.

    Hello

    I would like to inform that you can not change the order of columns or remove columns completely as it is by design. However, you can display or hide items in the console window.

    Hide columns in Diskmanagement:

    a. Click Start, type diskmgmt.msc and press to enter.

    b. click view and select Customize.

    c. you can select or clear the check boxes to show or hide items in the console window.

    I hope that helps!

  • Is it possible to change the sensitivity of the mouse in the sierra?

    Is it possible to change the sensitivity of the mouse in the sierra?

    Open system preferences > mouse

    See: Customize your mouse > the basics of the Mac: set your preferences - Apple Support

  • Is it possible to change the playlist view back to display columns on iTunes?

    Is it possible to change the playlist view back to display the columns?

    View > view as > songs.

    TT2

  • Hi all OneHow can you buy an IBook UK not available in Indian store a store; When you change the status of your country, your billing information and credit cards won't work; is there a solution for this using the same method of billing.

    Hello world

    How can buy you an IBook of UK not available in Indian store a store; When you change the status of your country, your billing information and credit cards won't work; is there a solution for this using the same method of billing

    There is no solution, if it is not available in your area, you can't buy it.

  • Is it possible to change the external color of the iPhone?

    I wanted to know if its possible to change the external color of the iPhone. My mother bought a pink iPhone, but she could not get used to it, so she gave it to me, and I want to know if its possible to pass to a rose grey.

    Thank you.

    None

  • Is it possible to change the default channel strip settings?

    Is it possible to change the default channel strip without having to depend on models?

    For example, I always wish to have:

    • Follow the value Name = 3 lines instead of the default line 1.
    • 'Follow the icons' checkbox deselected
    • Always follow box color
    • Control surface Bars always deselected

    Stuff like that... This apples to any screen that is affected by the Configuration of channel strip window. (View mixer or titles).

    Thank you!

    Is it possible to change the default channel strip without having to depend on models?

    NO.

    But why not use a template? You use a template of this moment anyway, the default value of project. Just change and set the Start Action that you configured

    Fact

    Edgar Rothermich - LogicProGEM.com

    (Author of "Graphically improved manuals")

    http://DingDingMusic.com/manuals/

    "I could receive some form of compensation, financial or otherwise, my recommendation or link."

  • Starkey Halo 2 passes to 'Flow Boost' memory state when the iPhone received incoming calls.   Is it possible to change the setting.

    I just got my Halo 2 a few days ago Starkey.  I noticed that when I get incoming calls on my iPhone 6, Halo 2 switches in position of memory 'Stream Boost' that increases the volume and picks up a lot of background noise.  Is it possible to change the default iPhone meets the memory of another parameter memory.

    No, you should contact the developer of the application to this topic.

  • Is it possible to change the order/priority of tags?

    Is it possible to change the order/priority of tags?
    I use this feature of hundreds of times every day.
    Thank you
    TERI

    I don't know, but maybe this add-on meets your needs https://addons.mozilla.org/en-US/thunderbird/addon/tag-sequence-arranger/?src=search

  • possible to change the font size of the bookmark toolsbar?

    possible to change the font size of the bookmark toolsbar?
    upgrade to firefox v22 and notice this bookmark toolsbar got bigger, some bookmark font cannot be displayed, it is normal? possible to change?

    Hello

    Firefox on Windows is now after display, scaling options that can make the biggest text on screens at high resolution.
    You can adjust the resolution of your screen.
    To change it follow these steps:

    • Type of topic: config in the Firefox address bar and hit the Enter key.
    • If the warning that this might void your warranty , click I'll be careful, I promised.
    • Search for layout.css.devPixelsPerPx

    • Double-click layout.css.devPixelsPerPx to edit its value. The default value is - 1.0 in Firefox 22 and above. Change it to 1.0 to run as in previous versions of Firefox.

    If necessary, further adjust the value of 0.1 or 0.05. Values between 1.0 and around 0.5 to reduce the size of the elements. Use a value greater than 1.0 to increase the size. For example, a value of 1.25 will increase the font size of the 125% to account for the default DPI setting in Windows 8. Check the value that you enter. Definition of a value that is too small will take everything away and too high will explode things.

    If the web pages should always be adjusted so you can watch the extension Default FullZoom Level or NoSquint .

    To adjust the font size for the user interface, you can use the extension of theme font & size changer .

    This solve your problems? Please report to us!

    Thank you.

  • Is it possible to change the default font in the Mail application?

    I use the native Mail application on my Pro 9.7 "iPad. Is it possible to change the default font for new messages and replies?

    N ° police cannot be changed.

Maybe you are looking for

  • I have shortened Clipboard keyevents sent my ICB MainCallback Funciton?

    Hello After reading the post of Ctrl - Alt Keypress, I wrote a program like below: int panelHandle = 0; WNDPROC currentWndProc = 0; int main (int argc, char * argv []) { ............ panelHandle = LoadPanel (0, "test.uir", test); InstallMainCallback

  • has no windows update: 80070005. any ideas? __

    error messagesI have Windows Vista

  • used to install vista SP1

    Why Microsoft does not have sp1 then it installs without that we have to jump through hoops?   It allows to install without poop autour with her.   Why we would have to do their work for them?  I don't want a PhD in Microsoft any more than they want

  • Mouse and keyboard does not work after sleeping on a laptop

    After awakening from a sleep of my laptop, my keyboard and mouse went crazy, pushing buttons at random on the screen, beep and completely freeze then both. I restarted my computer and got to the login screen which I was able to type in, then he conne

  • DVD drive (D :) went weird.

    Hello I have a weird problem, & I don't know how to explain it well. So, I say from the outset. I copy some files from my laptop to a 4.7 GB DVD. While it has been copied, I was you rename a file in my notebook when suddenly the blue screen of color