An enemy to follow me around the screen but not too fast

Hi I'm building English teaching apps but through games.
I'd like a BUG enemy to follow me around but NOT TOO fast as I have little kids of 5 years old using this,
Would it be something like get the coordinates of my HERO character and send the BUG there.
I use POINT at the moment to send my HERO to where the mouse clicks.
Could I send the BUG there as well but using less x and y increments.
Would this be too much for the processor - too much going on with music playing as well?

again, don't remove it:
var speed:Number=.99;
public function onEnterFrame(event:Event):void {
var xDistance:Number=clickPoint.x-this.hero.x;
var yDistance:Number=clickPoint.y-this.hero.y;
if (Math.abs(xDistance)>10) {
var angle:Number=Math.atan2(yDistance,xDistance);
this.hero.x+=v*Math.cos(angle);
this.hero.y+=v*Math.sin(angle);
} else {
this.hero.gotoAndPlay("static");
enemy1.x = speed*enemy1.x+(1-speed)*hero.x;
enemy1.y = speed*enemy1.y+(1-speed)*hero.y;
if (clickPoint.x>=hero.x) {
this.hero.gotoAndPlay("right");
//trace(Math.abs(xDistance));
if (this.hero.x>=clickPoint.x) {
this.hero.gotoAndPlay("left");
//trace(Math.abs(xDistance));

Similar Messages

  • I have a new 7th gen iPod, I have up loaded the latest iTunes version, I go to the music tab to sync, I click sync and the ipod starts to sync, but it does not sync all the music. It indicates all the songs on the screen, but not on the ipod

    I have a new 7th gen iPod, I have up loaded the latest iTunes version, I go to the music tab to sync, I click sync and the ipod starts to sync, but it does not sync all the music. It indicates all the songs on the screen, but not on the ipod

    I do not have the screen shown with the
    Pull down the “Store” menu and choose “Deauthorize This Computer”
    3. Now go back to the Store menu and choose “Authorize This Computer”
    options.

  • I dropped my phone and cracked the glass screen. How much is it to replace the screen but not the phone?

    dropped my phone and cracked the screen - how much is it to replace?

    Apple doesn't repair iPhones, they replace them. US$199 for a 4S, US$149 for all others.

  • TS3274 Email display problem: My email only display the list of emails and a preview (first two lines of the body of the mail). If one click on the message it only shows the heading on the right hand side of the screen, but not the content.

    My email only display the list of mails in my in box with a preview of the first two lines of the body of the message. When one clicks on the message to open it, only the header is displayed in the right hand side of the screen - the actual message is missing. This happens on older mail previously downloaded that use to work properly as well. Any idea how to fix this?

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Lidswitch:How to just shutdown the screen but not hibernate the system

    I used to set HandleLidswitch = hibernate in /etc/systemd/logind.conf and when I close the lid, only the screen was turned off and everything went on in the system. So I can sit there waiting for the work done without being distracted from the flashing outputs of gcc.
    But after reinstalling the system(I made a stupid mistake), it seems that after HandleLidswitch is set to "hibernate", it completely shutdown the computer, which stick to the defination of hibernate, but not what I want.
    How can I get the good old feature back? Thanks in advance!

    You can set HandleLidSwitch=ignore and then set what you want with acpid.

  • Iphone 5s has been hung. Repeating Apple logo on the screen but not shutting down or not even restarting

    My Iphone 5s is neither restarting nor it is shutting down. Apple logo has been glowing and after each few minutes blue screen is coming for couple of second and apple logo is coming repeatedly.

    Hello sarahim1955,
    Welcome to the Apple Support Communities!
    I understand that your iPhone is restarting and only displaying the Apple logo. In this situation, I would recommend reading over the attached article and using the information within to help troubleshoot this situation. 
    If your iOS device restarts, displays the Apple logo, or powers off while you're using it - Apple Support
    Have a great day,
    Joe

  • I've downloaded firefox to my Andriod but it wont work... Trying to open ebcheckgreyhound...it only show a bit of the screen but not the rest

    Need help

    I assume you mean http://ebcheck.greyhound.com/
    Unfortunately we are unable to help you with this site as it is password protected.
    The site provides [email protected] and ITS Help Desk # 1-800-458-6383 as ways to contact the site administration. http://ebcheck.greyhound.com/contact.asp

  • Virtual Screen but not Screen Sharing

    Hello all,
    I am wondering if there is a way that I can allow a user to log into my machine with a "virtual desktop" but NOT share my screen.  Consider the following scenario: Machine A and B both run OS X Lion.  Machine A is logged in as user A.  Machine B would like to log into their account remotely through screen sharing.  Once they are authenticated, they have the option to "Connect to a virtual display" or "Share the display"  The challenge is that I would like to allow them to connect to their virtual display but NOT allow them to share the display while I am using it.  Is this possible?
    To rephrase the question: is it possible to make remote users request permission to share the screen but not to log into their virtual desktop?
    Thanks in advance for any help you can offer!!
    Bests,
    Phil

    Hmm, this is not my experience... is it possible that I have something incorrectly configured then? My setup is as follows:
    Machine A:
         - Mac OS X Lion 10.7.4
         - User A: Administrator
         - User B: Regular User
    Machine B:
         - Mac OS X Lion 10.7.4
    Scenario:
         - User A is logged into Machine A
         - From Machine B, select Finder->Go->Connect to Server and enter vnc://address_of_Machine_A
         - Enter credentials of **User B**
    I am presented with two options:
         - "Share the Display - 'User A' is using the display"
         - "Connect to a Virtual Display - See your desktop and files"
    When I select the latter, everything goes smoothly with the virtual desktop and both users are able to work simultaneously.  However, when I select the first option, User B is able to share User A's screen without entering any additional credentials, which represents a serious privacy issue.  Any ideas?
    Thanks so much in advance for your help!
    Phil

  • Trackpad draging and jumping around the screen

    trackpad works for a while but then the trackpad begins to drag (when I move my finger around the trackpad, the curser either doesent move at all or moves very slowly) and the curser begins to jump around the screen when the trackpad and computer isent being touched. I tried to connect a wireless mouse and it too bagan with the same problems. if anyone has any ideas of how to fix it, im all ears.

    Yes i've gotten this twice.
    Once from not quite legitmate software.
    Once from a sketch NSFK site.
    Both times, it was easily resolved for me by shutting down.
    Follow the procedure to reset SMC controller ( make sure you do this properly ) Guides are available on Apple's support page.
    Immediatly after the SMC reset before any other reboot reset the PRAM several times.
    then reboot as normal.
    ...I'm not sure what exactly is going on.. I think some setting is getting adjusted and set EFI that's why normal reboots, safe mode, nothing else solves it.   One of the more eye opening aspect of it for me was when I rebooted my macbook into Windows7 via bootcamp and it still presisted.   At that point it had NOTHING to do w/ OS software, plist, safe mode or myraid of other suggestions you'll encounter. 

  • HT201412 Restore did not work.The ipad mini says it is disabled, connect to itunes.When connected, it says that it is locked! After Recovery/Restore completed, device still malfunctions. The slide image keeps dancing around the screen.Device types on its

    What if you have a situation where Restore did not work. I do. The ipad mini says it is disabled, connect to itunes. When connected, it says that it is locked! I have tried using Recovery/Restore but after it completed, the ipad mini still malfunctions. It does not allow you to start the device. The slide image keeps dancing around the screen. The opening page keeps changing in size and the keyboard types on its own! What can be done to fix this????????

    Maybe a reset would help, to be followed by trying the recovery again.
    To reset, hold the on/off and home buttons together for about 10 seconds till the Apple logo appears.  Then do the recovery.
    If this doesn't solve it, I recommend visiting an Authorized Apple Service Center.

  • Photoshop Elements 10 Help with image jumping around the screen

    I'm using a trial version of Elements 10 that I'm interested in buying it but 50% of the time when I click on an image so that I can click and drag it around the screen, it jumps off the screen.  I have been using Elements 6 and never had this problem and it is super frustrating.  I'm using a laptop and thought maybe it was my touchpad so i got a mouse and it is still doing the same thing.  Is there a way to fix this problem?  I will stick with Elements 6 if this can't be fixed as it takes me twice as long to edit images since the layers are jumping around and I keep have to kit the "undo" button.

      The editor saved prefs often get corrupted. If resetting all tools doesn’t work you may need to rebuild the editor preferences to resolve any conflicts.
    Hold down the Ctrl+Shift+Alt keys and simultaneously click on the Edit button on the welcome screen. Release the three keys and look behind the welcome screen by closing it. Or hold down the keys whilst double clicking on PhotoshopElementsEditor.exe
    You should see a pop up box with the words: Delete Adobe Photoshop Elements Settings File?
    Click on Yes
    Close down Elements and re-open it in the normal way - then wait whilst it rebuilds the preferences.
     

  • IPad mini keeps clicking when open and green bars highlight and keep moving around the screen

    MY iPad mini when open keeps clicking and a green bar keeps moving around the screen highlighting things, how do I stop it?

    Go to Settings > General > Accessibility > Switch Control and turn this OFF.

  • Mouse pointer jumping around the screen

    My mouse pointer has just started jumping around the screen. It vibrates and slowly moves down the screen even if I am not touching it. I have cleaned the sensor but that has not helped. I unplugged it and the pointer still jumped around.
    Any ideas what might be causing this as I have not seen quite this problem on other discussions.

    HI,
    That's interesting... restart your iMac. See if that makes a difference.
    Also, do you have anything nearby that might cause interference, like a cell phone or graphics tablet?
    May sound crazy, but dust and lint build up on a mouse pad can cause erratic cursor behavior.
    You could try deleting this file.
    com.apple.driver.AppleHIDMouse.plist
    /Users/YourName/Library/Preferences. Drag that file to the Trash, empty the Trash and restart your iMac.

  • MY MAC PRO MOUSE POINTER JUMPS FREELY AROUND THE SCREEN AND MAKES IT IMPOSSIBLE TO NAVIGATE PROGRAMS... ANY IDEAS

    My mac Pro mouse pointer jumps freely around the screen, making it dificult to navigate... it also moves the screen around without touching anything... any ideas whats wrong?

    Check this forum link for some good suggestions:
    https://discussions.apple.com/thread/4650109?tstart=0
    Post if you have any questions!

  • The smaller picture in face time bounced around the screen and has disappeared. How can I get it back.

    The smaller picture in face time bounced around the screen and has disappeared. How can I get it back.?

    I take it this was during a call? Close the app and open it again.
    Failing that, and when the call is over, do a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. The screen will go blank. Be patient, the device will power ON again in the normal way. It is app and data safe!]

Maybe you are looking for