dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: I have figured out Bullet Time...

  1. #1
    j00 r teh pwnz0r3d DarkMagicHacker's Avatar
    Join Date
    Feb 2001
    Location
    Your mom's room.
    Posts
    622

    I have figured out Bullet Time...

    Check it out and enjoy. If you can clean up the code 4 me, please repost it

    I wanna make a Max Payne game in flash. That would kick ass.

    Code:
    onClipEvent (enterFrame) {
        if (_x<leftBorder+_width/2) {
            _x = leftBorder+_width/2;
        } else if (_x>rightBorder-_width/2) {
            _x = rightBorder-_width/2;
        }
        if (timer==0) {
            if (Key.isDown(Key.RIGHT)) {
                _xscale = -100;
                xv = 4;
            } else if (Key.isDown(Key.LEFT)) {
                _xscale = 100;
                xv = -4;
            } else {
                xv = 0;
            }
            if (Key.isDown(Key.DOWN)) {
                slowMotionCharge = 360;
            }
            if (Key.isDown(Key.UP) and _y==yMin) {
                jump = true;
                yv = -5;
                _y -= 1;
                tellTarget (this) {
                    gotoAndPlay("jump");
                }
            }
            if (xv!=0 and this._currentframe==1) {
                tellTarget (this) {
                    gotoAndPlay("run");
                }
            }
            if (_y<yMin) {
                _rotation += rotationSpeed;
                yv += gravity;
            } else if (_y>=yMin) {
                _rotation = 0;
                _y = yMin;
                yv = 0;
            }
            _x += xv;
            _y += yv;
            tellTarget (this) {
                play();
            }
        } else if (timer>0) {
            tellTarget (this) {
                stop();
            }
        }
        if (Key.isDown(Key.SPACE) and keyUp==true and _root.slowMotion==false) {
            keyUp = false;
            _root.slowMotion = true;
        } else if (Key.isDown(Key.SPACE) and keyUp==true and _root.slowMotion==true) {
            keyUp = false;
            _root.slowMotion = false;
            timer = 0;
        } else if (Key.isDown(Key.SPACE)==false) {
            keyUp = true;
        }
        if (_root.slowMotion==true) {
            if (timer==0) {
                timer = timerMax;
            }
            timer -= 1;
            slowMotionCharge -= 1;
            if (slowMotionCharge <= 0) {
                _root.slowMotion = false;
            }
        } else if (_root.slowMotion==false) {
            timer = 0;
        }
    }
    onClipEvent (load) {
        leftBorder = 0;
        rightBorder = 400;
        rotationSpeed = 7;
        gravity = .2;
        yMin = _y;
        _root.slowMotion = false;
        timer = 0;
        timerMax = 5;
        slowMotionCharge = 360;
    }
    You pwn. I pwn. We all pwn for ice pwn.

    Chop Suey! The Greatarst Gaem EVAR!!!!!!!!

  2. #2
    j00 r teh pwnz0r3d DarkMagicHacker's Avatar
    Join Date
    Feb 2001
    Location
    Your mom's room.
    Posts
    622
    heres teh .fla
    Attached Files Attached Files
    You pwn. I pwn. We all pwn for ice pwn.

    Chop Suey! The Greatarst Gaem EVAR!!!!!!!!

  3. #3
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    A few grevances:

    a) This is not very mathmatical
    b) You already posted in the more relevent forum, Games
    c) What's so amazing about making a game run slower? Isn't that something that most final games can do (especially in the case of arcade ones) so that levels later on can be harder??

  4. #4
    j00 r teh pwnz0r3d DarkMagicHacker's Avatar
    Join Date
    Feb 2001
    Location
    Your mom's room.
    Posts
    622
    Geh, I made a new version... it stinks though, because teh gravity becomes fux0red >:
    You pwn. I pwn. We all pwn for ice pwn.

    Chop Suey! The Greatarst Gaem EVAR!!!!!!!!

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