brunopalermo's Forum Posts

  • Hey mathie!

    I made a simple example showing one of the ways you can control sounds.

    Download Example

    Just check or uncheck the sound or music and see they playing or not playing. Click anywhere to change layouts.

    In this one I used a dictionary just because I'm using buttons (ckeckboxes) as controlers and, since I use the same button for every group, I chose to use dictionary as I can dynamically set the key I'm changing.

  • Hello, Razertune!

    Why are you using a sprite with an instance variable instead of just using a global boolean variable?

    You could have a musicOn global variable. And check if it's "true" or "false" whenever you have to check it like you're already doing.

    Hope this helps. Cheers.

  • Hey !

    It's hard to answer without knowing much about your game or what exactly you're trying to achieve.

    You could use an array with the events and select one randomly when needed. You could use a permutation table, or a probability table if events have differente probabilities of happening, from the Advanced Random object. You could simply use the choose() system expression if the list of events is short enough. It all depends on the complexity of your game and event list.

    Hope this helps. Cheers!

  • Hey guys.

    Funny thing is I'm using images created directly in Construct and I still get this problem in the preview, that is, while I'm viewing the layout in the editor, but it works fine in runtime. That's why I got to this thread as I wasted the last hour trying to solve a non-issue. Lol.

    Here are pictures from the editor, the preview and the runtime. I added the white lines so it's clear where the cuts are.

  • Sorry for the huge delay.

    Are you picking a sprite (by UID or otherwise), before tlling it to play the animation? Because if you don't they'll all play at once.

    EDIT: I just noticed you aparently use a global variable (Day) to control all animations, so, if that's the case, they'll all change to the same value stored in Day, making them grow together. Day should be an instance variable, thus, each of the sprites would have its own Sprite.Day value. And THIS should control its own frame.

    In this case you should have something like:

    every 1 second
     for each seed
     if seed.day < seed.AnimationFrameCount
     add 1 to seed.Day
     set animation frame to seed.Day
    

    Hope this helps.

    Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey there!

    When you create the sprite it will play the animation at the default speed. You should either stop the animation right after the creation or just set the animation speed to 0.

    Hope this helps.

    Cheers!

  • This is awesome! :o

  • You do not have permission to view this post

  • You can also set it to "read only".

  • And this is how your functions would look like.

  • I'm not sure I understand your problem, but if you're having a problem to create the function itself, just right click you event sheet and choose "Add function" on the menu.

    Is that what you needed or am I mixing things up? :)

  • It's done the same way. But when you create the function you must inform what kind of value it returns if any.

    If you don't, no "Set Return Value" will show among your function actions. Also, you must add parameters right clicking the function and chosing "Add parameter".

  • The problem is the platform behavior is not super precise. Some deviantion may happen. In this example, you sometimes get the character a little off to the left or rigt. I wasn't able to isolate a reason for that, though.

    See Example

    Use A to jump left and D to jump right

  • It's hard to answer without any other information, but if you're using the platform behavior you'll just use a simulate control actions for jumping when each of those buttons are pressed. And another for moving left or right when the character is not on ground.

  • Hey GianniB!

    I'm not sure I get what you're trying to do exactly. I can see in your code that every time the layout starts you stop all sounds and restart the background music. But I'm not sure what is your goal. Could you elaborate?

    Cheers!