User Tag List

Results 1 to 7 of 7

Thread: How to make keypresses carry across frames in Flash

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    JoeRoth12's Avatar
    Join Date
    Feb 2013
    Location
    California
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to make keypresses carry across frames in Flash

    I'm about to launch a browser game but I'm having a problem. If you die, you instantly restart the level with no delay, and if you win, you instantly go to the next level. Because there's no delay, it's important that the player's inputs (running & jumping) carry over into the next frame without the player needing to let go of the keys.

    It works as an EXE, but as an SWF, if you are pressing any keys at the start of the frame, you have to let go and press them again or it won't recognize them.

    Does anyone have any ideas how to get keypresses to carry from frame to frame in Flash runtime?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    JoeRoth12's Avatar
    Join Date
    Feb 2013
    Location
    California
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been running some tests...it seems that in the SWF runtime, no matter whether you're pressing a key or not at the start of the frame, it reads the key as unpressed by default until you let go press it again.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    JoeRoth12's Avatar
    Join Date
    Feb 2013
    Location
    California
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So apparently some keypresses DO carry over, some of the time. Here's what I've discovered so far:

    There are only two buttons in the game:
    Run = Joystick Top or Right = Ctrl or F
    Jump = Joystick Down or Left = Spacebar or G

    - Jump carries over from frame to frame consistently
    - Run carries over from frame to frame some of the time (I can't tell why it changes)
    - If both Run and Jump are pressed, only Jump will carry over to the next frame

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    JoeRoth12's Avatar
    Join Date
    Feb 2013
    Location
    California
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update: I never did find a way to fix this, so instead I found a way around it. Instead of using "Jump to Frame [current frame]" to go to the next level, I eliminated frame-changing altogether. Now the game simply destroys the current level and rebuilds the next level without changing the frame, and the controls work fluidly.

    I just launched the game today for web browser! It's called Nobody Said It Was Easy and you can play it here: http://joerothenberg.com/nobodysaid

  5. #5
    Clicker

    Join Date
    Jul 2011
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha, this game is rad.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JoeRoth12 View Post
    Update: I never did find a way to fix this, so instead I found a way around it. Instead of using "Jump to Frame [current frame]" to go to the next level, I eliminated frame-changing altogether. Now the game simply destroys the current level and rebuilds the next level without changing the frame, and the controls work fluidly.

    I just launched the game today for web browser! It's called Nobody Said It Was Easy and you can play it here: http://joerothenberg.com/nobodysaid
    Man, that game is brilliant! Been awhile since I've felt the way I felt about this game about any game. It's hard, sure, but the levels are so short that it doesn't feel unfair, and you keep things interesting with new gimmicks and new uses of old gimmicks. I like it!

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Played this, funny stuff.

Similar Threads

  1. Is there an easy, direct way to make several frames use the same set of events?
    By Dalal in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 21st February 2012, 04:37 PM
  2. How to carry values and counters over frames?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th February 2011, 10:17 PM
  3. How to carry information across frames
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 12th July 2010, 07:25 PM
  4. Make one object for all frames?
    By Leric in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 8th July 2006, 09:26 AM

Posting Permissions

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