locked
Side scrolling, man walking, development. Need help on the jump routine! RRS feed

  • Question

  • I've been trying to add a routine for the jumping with the space bar but for some reason my little guy wants to flicker while moving left and right, if you jump without left or right then he disappears. Here's what I've got MRX202

    I can't figure out why my code keeps doing the flicker thing, why can't I seem to get this?

    If you take "Or jump" out of line 72 there's no flicker while moving and dissappears jumping in place!!! ??? My brain has turned to mush, must take a break.
    • Edited by JKrueg Tuesday, June 12, 2012 4:02 AM
    Tuesday, June 12, 2012 3:25 AM

Answers

  • remove  "Or jump"  line 72

    and add this code

     If mdlast <> md Or mslast <> zInt  Then    '    remove  "Or jump"
        Shapes.Move(man[md][zInt],ManX,ManY)
        Shapes.ShowShape(man[md][zInt])
        Shapes.HideShape(man[mdlast][mslast])
      EndIf

     If  jump Then
        Shapes.Move(man[md][zInt],ManX,ManY)
        Shapes.ShowShape(man[md][zInt])
      EndIf


    • Edited by NaochanONEditor Tuesday, June 12, 2012 10:57 AM
    • Marked as answer by JKrueg Tuesday, June 12, 2012 12:15 PM
    Tuesday, June 12, 2012 10:50 AM
    Answerer

All replies

  • remove  "Or jump"  line 72

    and add this code

     If mdlast <> md Or mslast <> zInt  Then    '    remove  "Or jump"
        Shapes.Move(man[md][zInt],ManX,ManY)
        Shapes.ShowShape(man[md][zInt])
        Shapes.HideShape(man[mdlast][mslast])
      EndIf

     If  jump Then
        Shapes.Move(man[md][zInt],ManX,ManY)
        Shapes.ShowShape(man[md][zInt])
      EndIf


    • Edited by NaochanONEditor Tuesday, June 12, 2012 10:57 AM
    • Marked as answer by JKrueg Tuesday, June 12, 2012 12:15 PM
    Tuesday, June 12, 2012 10:50 AM
    Answerer
  • Thanks NaochanON,

    That works sweet! Ended up with this, being that the shape is all ready showing.

    If jump Then
      Shapes.Move(man[md][zInt],ManX,ManY)
    EndIf
    • Edited by JKrueg Tuesday, June 12, 2012 12:21 PM
    Tuesday, June 12, 2012 12:17 PM