Help platform game!

Hi, I wonder if someone could help me,
I am trying to understand how to make a simple platform game and have gotten essentially by checking the tutorials on the web, Im stuck on one thing, however, the health of my character, for the moment I have a hp mc which takes you to the image in the image less health, when the enemy strikes the character this code applies:

{onClipEvent (enterFrame)}
{if (_root. Character.HitTest (this))}
_root. Background.HP.nextFrame ();
}
}

Copy it following making the enemy to constantly make the hp mc to go to the next section, so my character is going to die if he touches the enemy for a couple seconds... What I would like is rather for the enemy hp to move to the next section and then the character will be untouchable a few seconds later so there the chance of getting away.

Thanks to everyone who has had a suggestion for my problem.


Edit/Delete  Message

It's my mistake.  use:

{enemy_mc.onEnterFrame = Function ()}

{If (! this.nothitable & {this.hitTest (_root.character))}

_root. Background.HP.nextFrame ();

This.nothitable = true;

setTimeout(resetF,3000,this);

}

}

function resetF(enemy:MovieClip) {}

Enemy.nothitable = false;

}

Tags: Adobe Animate

Similar Questions

  • Adobe Flash CS5 platform game movement with the help of the arrow keys help!

    Hello, I'm a newbie to flash games. I do a platform game, but cannot reverse my character when it goes backward. This is my code for left and right:

    If (Key.isDown (Key.RIGHT)) {}
    Speed of _x +=;
    }
    If (Key.isDown (Key.LEFT)) {}
    _X-= speed;
    }

    How can I reverse it so when he goes LEFT, the character turns around?

    You can change the value of _xscale-100% to have back, but what others are doing often is have a movieclip that has different positions in different settings and you are editing images based on the direction of travel.

  • Tutorial for 3D with platform games and code source to suggest

    Source code online for the 3d game that look like real people, and it would be difficult to know that it's a game rather than film?

    Is there a good tutorial to develop these games and the platform to run it?

    Original title: a 3d platform game tutorial and source code

    Hello

    Thanks for posting in the Microsoft Community.

    You request assistance of 3D game tutorial is beyond our borders to support. I suggest you post your question in the MSDN forums:

    Check out the link:

    https://social.msdn.Microsoft.com/forums/en-us/home

    Hope this information is useful. Please do not hesitate to answer, in the case where you are facing in the future other problems with Windows.

  • Error #1009 in my platform game! Help, please!

    My game of base platform that I have a "hero" who can walk and jump on the 'ground '. There is also a door to the next scene, which is the next level. The first scene works very well, but "TypeError: Error #1006: value is not a function." to Charles3_fla::MainTimeline/frame1()"appears once in the output. This works however, and I'm not worried about it. The second, I'm going through the door but, scene 2 opens, and then starts flashing as "TypeError: Error #1009: cannot access a property or method of a null object reference." to Charles3_fla::MainTimeline/onenter()"appears a LOT in the output. I don't know how to solve this problem and I would like to help. P.S. I use Adobe CS5 with actionscript 3

    Here is the code for stage 1:

    hero.gotoAndStop ('still');

    var key: KeyObject = new KeyObject (internship);

    var vy:Number = 0;

    var gravity: number = 2;

    var jumped: Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter) (true);

    function onenter(e:Event):void {}

    Vy += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy > 10) {}
    Vy = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    Vy = 6;
    jumped = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    Vy = 6;
    jumped = true;

    }

    If (Key.isDown (Key.up) & & jumped) {}

    Vy = - 13;
    jumping = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    And for scene 2...

    hero.gotoAndStop ('still');

    var Key1:KeyObject = KeyObject (internship);

    var vy1:Number = 0;

    var gravity1:Number = 2;

    var jumped1:Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter1) (true);

    function onenter1(e:Event):void {}

    VY1 += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy1 > 10) {}
    VY1 = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    VY1 = 6;
    jumped1 = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    VY1 = 6;
    jumped1 = true;

    }

    If (Key.isDown (Key.up) & & jumped1) {}

    VY1 = - 13;
    jumped1 = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    Please answer as soon as possible and thank you for your time

    swiatekalex555

    the idea was to stop your main timeline to move forward because it was a problem that you mentioned in a previous message.

    Anyway, this thread has answered a long time ago and is now unrelated to error # 1009.  Please mark this thread as answered and start a new thread.

  • Text 2 n00b q? (Example Gary Rosenzweig platform game)

    I use Flash MX 2004 for a while now to do animation, but I've never been good with Actionscript. I have a few examples of a book, my former employer gave me (with Gary Rosenzweig Fox ), and I tried to reconfigure it. After having messed around with the example of the platform before I can just 'fudge' my way by adding more levels, making levels, change of art, etc.

    What I'm trying to do is basically add a picture "You win!" now. essentially, when the position of the Fox is at a point in the grid, you go to a new framework, the 'framework of victory. "

    But every time that I test, I always have this (probably common) error:

    * Error * scene = scene 1, layer = game, frame = 2:Line 224: ")' expected"
    If (foxPos = x: 250, y: 0) {}

    Total ActionScript errors: 1 reported errors: 1

    Here's the function:

    function winGame() {}
    If (foxPos = x: 250, y: 0) {}
    gotoAndPlay("4");
    }}


    I really enjoy coming to Games Flash and all existing possibilities (Finally I would like to get into 3D stuff), but I've never been very good with math, thanks for any help and understanding programming

    I don't know everything there is to know about actionscript, but I don't think that what you have there is a code valid... at least I've never seen anything like it in the 10 years or so I've been using Flash.

    Try:

    function winGame() {}
    If (foxPos._x == 250 & foxPos._y == 0) {}
    gotoAndPlay (4);  without the quotes for chassis numbers
    }

    }

    I guess it depends really on what foxPos.  In any case, if you compare something you use == to test for equality

  • Satellite A500-19U - need help for games and the AC adapter / CC

    Heys guys.

    I got my new Satellite A500-19U and install games on it like COD4, assassin Creed, Batman, Mafia 2 .and much

    All of these games crashes & freezes after screen black or white, 3-5 Min & gimmea and this happenWHILE CONNECT the AC ADAPTER to charge the battery. While using the battery just fine, except some crashes after a long period of palying. Some time, he said (the display driver not responding) & sometimes the screen black or white. The only way to recover the laptop is ALT + CTRL + DELETE and wait until the game to recover & cases laptop stop responding & the only way is to hard reboot.

    The only one that works such fine bit is Battlefield Bad Company 2. Then I change the DirectX (setting.ini) of car in DirectX9.

    SP please any help on this matter. I think it's a video driver or a Windows 7 problem. And the specifications are:

    Processor: Inter Core 2 Due P7450 2.13 GHz
    RAM: 4 GB DDR3
    VGA: Nvidia Geforce G210M with the driver from the Toshiba Site has also tested the latest driver from Nvidia Site Version: 258.96
    OS: Windows 7 64-bit [pre-installed]

    I think that its not big problem for Toshiba co.  :)

    Hi mate

    I think that it is a nuisance driver in most cases not entirely compatible graphics cards drivers are the reason why games dishes t working correctly.

    What to say; I think that the update of the driver is the key
    You will need to find a good driver version
    Toshiba pilot European page you can find the latest drivers published by Toshiba
    But this does not mean that these are the most recent drivers released by nVidia or ATI
    nVidia or ATI drivers are always different

    In order to check the drivers from nVidia page too.
    You can also try the version published on the Web site www.omegadrivers.net or www.laptopvideo2go.com
    But note; These are not tested drivers and use is at your own risk!

  • Rise of Nations help? Game does not play in full screen? Windows 7 Edition Home Premium.

    I installed the birth of the United Nations, the original game on my computer to windows 7 Home premium and will not play the game in full screen. She always cut the sides of the black vertical column set. I tried everything: image format, right-click and do different stuff with the properties, nothing seems to work. It may be a problem with the compatibility? If so, what can I do about it?

    Hi SkulzAILD,

    1. which edition of Rise of Nations do you use?

    You can read the following article and try the steps to solve the problem.

    Known graphics issues in Rise of Nations: Rise of Legends

    http://support.Microsoft.com/kb/917715

    Also read the following article:

    Known graphics issues in Rise of Nations

    http://support.Microsoft.com/kb/820089

    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.

  • Help please Gamer with problem

    Hello my name is Karim

    I play League Of Legends, World Of Warcraft, Multi Theft Auto and use Skype to communicate.

    All these programs and much more may not work for some reason that I tried the firewall to fix and avg and mcafee that I found that it wasn't on avg, or mcafee

    but always on the firewall I allowed it is set by default and re has done and all games still won't work he was working in the morning, then when I restarded suddenly, he started first: some microsoft.net little box came with some stuff, and then, after that Skype was online but I was not, and everyone is offline now

    Secondly: All the games weren't all im firewall or internet using lan, and this is not of net and firewall is permitted and all but still

    help please ASAP

    Skype error:

    Unavailable Skype home

    Skype home is not available at this time. Check back later to see your news and alerts.

    It's easy to start a conversation on Skype:

    • Choose a contact and start talking
    • Call a phone or a mobile from the keypad, or send an SMS.

    League Of Legends error: ERROR of thrusters

    Could not connect to the HTTP server. Please check that your Internet connection is enabled and that your firewall is not blocking access.

    World Of Warcraft error:

    Battle.NET error #2: unable to connect. Please try again later. If the problem persists, please contact technical support.

    The computer could not connect to the login server because a security program blocking the connection or the connection is unstable.

    Sorry if I posted this topic in a neighborhood hurt my first post and I really need help please help me as soon as possible thank you.

    PS: im using Alienware m18xr2

    Cheers, legend #.

    Hello

    Please follow the methods.

    Method 1:

    Disable the anti-virus software and check if it works very well.

    See the link.

    Disable the anti-virus software

    http://Windows.Microsoft.com/is-is/Windows7/disable-antivirus-software

    Method 2:

    If you have changed the proxy settings in Internet Explorer, please disable proxy and check if it works very well.

    a. open Internet Explorer.

    b. click on tools.

    c. click on Internet Options.

    d. click on connections.

    e. click on LAN settings.

    f. remove the checkmark next to Proxy Server.

    g. click OK.

    h. restart the browser.

    Please check the event viewer for any error message related to the issue.

    See the link.

    What are the information contained in the logs of the event (Event Viewer)?

    http://Windows.Microsoft.com/en-in/Windows7/what-information-appears-in-event-logs-Event-Viewer

  • Creating a set of platform game for mobile/multiple devices?

    Hi all

    About two weeks ago, I started to create a platform on Scratch game. All sprites and environments were created/animated in a combination of Illustrator, Photoshop and Flash CC. However, as I started to invest more time in this game and learning more about Flash, I realized that zero is limited in what it can do, which brings me to this question.

    What Adobe CC applications are associated with creating mobile games? I understand the question is a bit Open ended, but I'm not sure what app (s) I should build the game (I guess that its CC Flash). As I mentioned earlier, most of the sprites have been already made/animated.

    Thank you!

    Some people use PhoneGap as a way to make applications of tools, not Flash, but I would bet that most of the games made with Adobe tools are made with Flash Pro.

    You will be amused to hear that zero itself is written in Flash.

  • Help flash game - destroy enemies by moving above them

    Hello

    I want to make a flash game where the aim of the game is to move some objects with your arrow keys.

    When you move objects, I want them to die (disappear) but I don't know how to do this.

    If anyone has answers help would be much appreciated!

    Thank you

    Sorry, my mistake. To check if an object on the stage has hit another, you can use hitTestObject() in AS2 or hitTest() in AS2. There are examples of the use of one in the online help.

  • Help: the game is a big PROBLEM!

    For some reason I everything worked fine last night and then today I went to a game and he wouldn't bring it upwards. I have tried everything I can do to fix this?

    Hi Tammy B,.

    As BossDweebe said, we need more information to better understand the issue.

    (1) do you get an error message when you start the game?

    (2) what Version of Windows you are using on the computer?

    Step 1: You can follow all the steps mentioned in the article below, which deals with a similar question

    Game hangs or quits unexpectedly

    http://support.Microsoft.com/kb/303032

    (This article addresses the problem of Microsoft game, same steps is good for other games as well on the statistical plan)

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I've just loaded Vista and I have no games, I tried to start - all programs - games - options set up the window options appears, the two check boxes are ticked and I select OK and nothing happens, please help __regards__carol games

    Recently downloaded Vista

    Hi Carol,.

    Welcome to the Windows Vista answers Forum!

    Which version of Windows Vista you have installed?

    Have you tried "turn Windows features on or off"? If this isn't the case, please follow the steps below:

    1. click on start.

    2. go in Control Panel.

    3. click on programs.

    4. Select programs and features.

    5. on the left pane, you will have an option turn Windows features on or off, click on it.

    6. a new window will appear on the, select games and click Ok.

    You need to restart the system to allow the changes take place.

    For more details, visit the below given link:

    Turn on or off Windows features

    http://Windows.Microsoft.com/en-in/Windows7/turn-Windows-features-on-or-off

    You can also run a file system (CFS) auditor to see if any of the file system are damaged. This tool will fix the problem in itself.

    Scan SFC enforcement procedure:

    1. click on the Start button

    2. on the Start Menu, click all programs followed by accessories

    3. in the menu accessories, right-click on command line option

    4. in the drop-down menu that appears, click the "Run as Administrator" option

    5. If you have the User Account Control (UAC) enabled, you will be asked permission before the opening of the command line. You simply press the button continue if you are the administrator or insert password etc.

    6. in the command prompt window, type: sfc/scannow then press enter

    7. a message is displayed to indicate that "the analysis of the system will start.

    8. be patient because the analysis may take some time

    9. If all the files need replace SFC will replace them. You may be asked to insert your Vista DVD for this process to continue

    10. If all goes although you should, after the analysis, see the following message "Windows resource protection not found any breach of integrity.

    11. once the scan is finished, close the command prompt window, restart the computer and check.

    For more information, please visit the below given link:

    How to repair the operating system and how to restore the configuration of the operating system to an earlier point in time in Windows Vista

    http://support.Microsoft.com/kb/936212

    Hope this information is useful.

    Amrita M

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

  • Need a list of what I can stop using the Task Manager to help play games that are hanging up or jump or stopping programs.

    I know how to stop most of the programs running in the back ground by using the Task Manager and the process tab.  But, I click "Show processes from all users" list is double what it was.  I need a list of what I can finish process without going through the computer off and restart or with on dreaded blue screen.  So I ask if anyone has a list of processes that are sure to stop?  Thanks in advance, Frankster195

    Hi Frankster 195,

    Welcome to Vista forums.

    You can try to perform a clean boot. Check the mentioned below of items.

    How to perform a clean boot procedure to determine if background programs are interfering with a game or a program that you currently use

    http://support.Microsoft.com/kb/331796

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/default.aspx/KB/929135

    Hope this information is useful.

    Thanks and regards.

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

  • Where can I find help for games of "MS Entertainment Pack for WIndows (1990). I can't seem to use them on Windows 7, but it can be used on Windows Vista?

    I have been using the following games; Taipei (Majongg tiles), Tetris, Golf (cards) and cruel (maps), which came with MS Entertainment Pack for Windows (1990) and who has worked with every version of MS Windows since 95 Windodws. I can use them with Windows Vista but I can't use them on Windows 7, I really enjoy these games and like to use them in Windows 7 and 8.

    "All Microsoft Entertainment Pack games work on Windows XP, Vista, Windows 7 and Windows 8, but this only applies to 32-bit versions. The NTVDM allows 16-bit applications run in 32-bit versions of Windows. In the 64-bit versions of these operating systems are 32-bit applications be run in a compatibility layer in the kernel and layer 16 bit must be rewraped, this is why Microsoft has removed the feature. "(from Wikipedia)

    It's true. I tested the games ("Best of Windows Entertainment Pack", similar to the MEP even older) on 32-bit Windows 7, no problem. On Windows 7, 64 bit, they don't work (except if try you heavy workaround solutions like running Windows 3.1 on an emulator of BACK, then using this virtual operating system to run games).

  • help with game

    Hello

    im making a flash game, I put in a menu and a shop, but when I do my menu it spawns still display my score and enemy heroes.

    I would like to know how to put all my heroes ect only spawn on frame 2

    IM, making using class files.

    Here's a code then (I hope that's ok)

    Here's some of my class of game file


    function Game() {}

    Key.Initialize (internship);
    ship = new Ship();
    Ship.x = 300;
    Ship.y = 150;
    addChild (ship);


    enemyShipTimer = new Timer (1500);
    enemyShipTimer.addEventListener ("timer", sendEnemy);
    enemyShipTimer.start ();

    RocketShipTimer = new Timer (3000);
    RocketShipTimer.addEventListener ("timer", sendEnemyRocket);
    RocketShipTimer.start ();

    Bombtimer = new Timer (7000);
    Bombtimer.addEventListener ("timer", sendBomb);
    Bombtimer.Start ();

    powerUpTimer = new Timer (10000);
    powerUpTimer.addEventListener ("timer", sendPowerUp);
    powerUpTimer.start ();

    miniBossTimer = new Timer (20000);
    miniBossTimer.addEventListener ("timer", sendMiniBoss);
    miniBossTimer.start ();

    bossCountdown = 3;

    scoreText = new TextField();
    scoreText.x = 290;
    scoreText.text is a String (0);.
    addChild (scoreText);

    var scoreFormat = new TextFormat ("Comic Sans MS", 20, 0 x 000000);
    scoreText.defaultTextFormat = scoreFormat;

    healthMeter = new HealthMeter();
    healthMeter.x = 10;
    healthMeter.y = 10;
    addChild (healthMeter);

    enemyHealthMeter = new EnemyHealthMeter();
    enemyHealthMeter.x = 530;
    enemyHealthMeter.y = 10;
    addChild (enemyHealthMeter);
    enemyHealthMeter.visible = false;

    resetScore();

    gameOverMenu = new GameOverMenu();
    gameOverMenu.x = 80;
    gameOverMenu.y = 35;
    addChild (gameOverMenu);
    gameOverMenu.visible = false;

    gameOverMenu.playAgainButton.addEventListener ("mouseDown", newGame);

    Ship.Shield.Visible = false;

    }

    public static function gameOver() {}

    gameOverMenu.visible = true;

    enemyShipTimer.stop ();
    miniBossTimer.stop ();
    RocketShipTimer.stop ();
    Bombtimer.Stop ();


    for (var i in EnemyShip.list) {}
    EnemyShip.list [i] .kill ();
    }
    for (var i in RocketShip.list) {}
    RocketShip.list [i] .kill ();
    }
    for (var i in Bomb.list) {}
    Bomb.list [i]. Kill();
    }

    }

    function newGame(e:Event) {}

    gameOverMenu.visible = false;
    Ship.Visible = true;
    Ship.x = 300;
    Ship.y = 150;
    ship.takeDamage(-ship.maxHealth);
    ship.addEventListener ("enterFrame", ship.move);
    resetScore();
    enemyShipTimer.start ();
    miniBossTimer.start ();
    RocketShipTimer.start ();
    Bombtimer.Start ();

    }

    function sendPowerUp(e:Event) {}

    powerUp var = new PowerUp();
    stage.addChild (powerUp);

    }

    function sendEnemy(e:Event) {}

    enemy of the var = new EnemyShip();
    stage.addChild (enemy);

    }

    function sendMiniBoss(e:Event) {}

    miniBossTimer.stop ();

    if(bossCountdown == 0) {}
    Patron of var = new Boss();
    stage.addChild (boss);
    bossCountdown = 3;
    } else {}
    Minibosses var = new MiniBoss();
    stage.addChild (Minibosses);
    bossCountdown-= 1;
    }

    }

    and here's an excerpt from my enemy class file:

    SerializableAttribute public class extends MovieClip {} EnemyShip

    var speed: Number;

    public static var list: Array = new Array();

    var shootTimer:Timer;

    Health: number var;

    function () {} EnemyShip

    List.push (this);

    This.x = 700;

    This.y = Math.random () * 200 + 50;

    Speed = Math.random () * 5 + 5;

    addEventListener ("enterFrame", enterFrame);

    var interval: Number = Math.random () * 700 + 1000;

    shootTimer = new Timer (interval);

    shootTimer.addEventListener ("timer", shoot);

    shootTimer.start ();

    Health = 1;

    }

    function takeDamage (d) {}

    health = d;

    If (health < = 0) {}

    Game.updateScore (50);

    var db = new PointDisplay();

    pd.displayText.text = String (50);

    PD.x = this.x;

    PD.y = this.y;

    stage.addChild (pd);

    Kill();

    }

    }

    function enterFrame(e:Event) {}

    This.x = speed;

    If (this.x,-100) {}

    Kill();

    return;

    }

    {if (this.hitTestObject (Game.Ship))}

    Kill();

    if(Game.Ship.Shield.Visible == false) {}

    Game.ship.takeDamage (20);

    }

    }

    }

    Click on an empty part of the scene, and in the properties panel, change the name of the document class.

Maybe you are looking for