PHSFBLA's Forum Posts

  • 6 posts
  • Hey, thanks for the response. I'm glad its not just me, but it seems really strange to me. I'm no expert programmer by any means, but I'd think that functions here work just like Methods in Java not sure why it's failing. I was hoping to teach students how functions can be useful using this easy block of code.

    In debug mode, somehow the fade variable gets set to -809 almost instantly. I have no idea how it could've ever get to -809 using this code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to create a generic function that will slowly transition the screen from visible to black. The premise is that the "Fade" function will accept two parameters. The first parameter will determine how much the fade will decrease by and the 2nd parameter determines how many times it will cycle through/repeat until it is done.

    When I run this block of code though, the effect is instant and I eventually appear on Layout 2. What I'd hope would happen is that you'd see the screen gradually fade and then you'd emerge on Layout 2.

    Any help on what I've done wrong would be greatly appreciated! I tried adding Wait in the loop various times with no success. I also had originally tried Repeat (Function.Param(1) times as opposed to the for loop but it made no difference.

  • Thank you for you help, I can't believe I didn't catch that.

    Thanks!!

  • Unfortunately, that didn't fix anything besides make lines 52/53 more compact.

  • I'm trying to create a function that replicates a sword stab in this mini-project of mine. In my head, the code I have makes sense, but on execution, it is like the program isn't reading all of my code.

    This is the code I have so far:

    What it seems to be doing is just going so fast through the code that it just skips all animation and the "action = 1". However, it does take 1 second for the sword to disappear.

    You can't see it from the code snippet I provided, but when action is set to 1, the character is unable to move. It works in all other instances of the game. I threw in the "8Direction" disabled for good measure, but it doesn't do anything either.

    Any help would be greatly appreciated!

  • 6 posts