A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: !!why!!

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Location
    USA
    Posts
    184

    !!why!!

    Why does the bullet not move?
    http://209.204.165.10/eric/shoot%20out.swf
    In the Swf you can not see the bullet, it is off to the side.
    Space = Shoot
    Left & Right = Move
    Down = duck
    Up = stand up
    Control = Reload(Doesnt work for the pistol only rifle)
    (The bullet should only fire with the pistol standing up)
    You can grab the rifle by walking over it then clicking the rifle picture at the top.
    http://209.204.165.10/eric/shoot%20out.fla

  2. #2
    Senior Member zervell's Avatar
    Join Date
    May 2004
    Posts
    259

    oh god

    I was going to fix the game and than I looked at your code. Its realy bad. The hardest part about writing code is making the code understandalble and most important simple. When you write code like you did in this shoot out and your games have problems its almost imposible to fix. It would be fast to start over. Well I'm not just here to talk to you all day I made a small game that has tons less code than yours and dose more. Downloaded it and try to keep your code as simple as possible it saves time for everyone including you.
    Attached Files Attached Files
    CEO OF

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    Hawthorne
    Posts
    40
    I have got no idea why it doesn't work. Your code looks fine.

    Renaming the movie clip from "shoot" to "shooter" and changing the references to it in the "Laser" movie clip as such:

    code:

    onClipEvent (load) {
    laserMoveSpeed = 15;
    this.vx = _root.shooter.vx*laserMoveSpeed;
    this.vy = _root.shooter.vy*laserMoveSpeed;
    this._x = _root.shooter._x;
    this._y = _root.shooter._y;
    }
    onClipEvent (enterFrame) {
    this._y += this.vy;
    this._x += this.vx;
    if (_root.boundary.hitTest(_x, _y, true)) {
    this.removeMovieClip();
    }
    }



    fixes the problem, but I don't know why. Maybe Flash doesn't like the name "shoot"?

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Location
    USA
    Posts
    184
    Well I cant open that file its not the same version of mx as mine.

    The reason the code is confusing is because when i began the game I never planned on having as many things as i have. I just planned for walking/shooting animation and shooting, then I added bullets, another weapon, sounds, and ducking.

    I could start over and probably get the shooting to work but then I would need to do the animations again which I am not good at, although I could copy the frames but I dont like doing that.

  5. #5
    Senior Member
    Join Date
    Feb 2004
    Location
    USA
    Posts
    184
    ahh
    Thanks Skellum
    that worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center