dop2000's Forum Posts

  • Yes, there is a slight lag with tap, because this event triggers after the finger was lifted off the screen.

    But this is the only way to do what you want.

    You can't jump at Touch Start event because you can't predict if player will be doing a short touch or a long hold.

  • Construct 2 detects collisions using collision polygons.

    Check collision polygon of your Enemy sprite (on all frames) and of that object that should stop it.

    If this doesn't help, please share your capx file.

  • Just use gestures instead of basic touch events.

  • See my screenshot above how you check which layout is active!

    System->Compare two values -> LayoutName equals <your layout name>

    Instead of having separate variable for each level (Level1, Level2, Leve3 etc), just make one global variable LevelProgress.

    Add 1 after completion of each level to it.

    In your LevelMap check the value of LevelProgress and unlock next level icon. For example if LevelProgress=2, then level 3 is unlocked.

  • Another thing I noticed - you have almost identical event sheets for levels 1 and 2.

    You can delete EventLevel2, and set the same event sheet for both layouts.

    If you need to do something different for each level, just check which layout is active:

  • No problem!

    Or you can do this:

    This means - if sound is playing, stop it. And then play the sound from the beginning.

    (oops, forgot to delete the old line with empty "" tag)

  • Here you go:

    I noticed you never use sub-events in your game. This is a sub-event, it's only executed if the parent event is executed (if Player is on the Floor)

  • Sure, if it's not too big

    my email: <censored>

  • No, it doesn't check if the player is jumping or not, it checks if the sound is playing.

    Again, I don't know how and when you check if the jump is made and decide to play the sound.

    Could you share the screenshot of your entire event where you play you jumping sound?

  • I meant replace your existing action (Audio->Play jumping sound) with those 2 lines.

    This is what you wanted, isn't it?

    [quote:94xz1gbr]Don't play jump-sound if the jump-sound is already playing.

    I didn't see your code and don't know where you play your sound. I'm guessing it's inside some event, maybe On collision with a floor, or On key "Up" pressed. So insert my 2 lines inside that event.

  • KeeghanM

    That's what I was thinking too, but still a bit worried

    I just made a little test - replaced Text object with SpriteFont object in an event (manually in C2), and then compared xml files - sid tag remained the same.

    So yeah, it should be safe to change objects in xml.

  • Every time you play a sound you can assign a tag to it. So play your jumping sound with tag="jump".

    Before playing check if "jump" sound is already playing and either stop it or don't play new sound.

    Something like this:

        Audio -> Is tag "jump" NOT playing
               Audio -> Play "your jumping sound" (tag "jump")
    [/code:2w96fp6l]
  • KeeghanM thanks for the tip!

    Do you know what the "sid" tag is for in the event sheets XMLs?

    <action id="0" name="Set text" sid="140336039528208" type="GameOverText">[/code:34f6o06t]
    
    I was also thinking about making some bulk changes by editing XML files, but I was worried about this sid tag.. What if it's somehow related to the object which I'm replacing?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I also recommend you fixing your animations - crop unused space, make sure origin point is in the same position on all frames, simplify your collision polygons. Your sprites are very small, you don't need complex collision polygons, they are bad for performance.