Dalal's Recent Forum Activity

  • I feel that the Stop action of the Audio object isn't quite fit for games because it abruptly cuts off the waveform, causing an undesirable click or pop [example], at least when using the .m4a format. Most audio players and editors use inperceptible micro-fades to prevent/reduce this artifact. If possible, I think Construct 2 should do the same.

    Unless you work with audio a lot, the 'click' hardly feels like the natural result of stopping a sound. It's not what is expected of a Stop action. The click is literally CREATED when you cut off the audio, because the waveform does a straight line back to 0. Why should something be added to the audio that wasn't there originally? And what is the use of this inconsistent sound in games? That's why I think micro-fading the audio is like a higher quality 'stop algorithm' with more natural, useable results. The final thing you hear is the original sound itself, rather than a sharp click. That seems much closer to the behavior we expect.

    In any case, if the current method cannot be changed, may I suggest creating a 'Fade Stop' action as an alternative? This would fade the audio down to 0 through a specified number of milliseconds before actually stopping the sample. This I feel would have more uses in games over the current stop method and I believe it would be a worthwhile addition to the official Audio object. What say?

  • I don't know how to enlarge the cursor. When using a custom cursor, however, I don't think you'd need to write any color changing code. Just put the "Difference" effect on it.

  • I haven't used the behavior before, but I do fades like this normally:

    If Object is Overlapping     |  Set Opacity of Object to Object.Opacity - 1000*dt
    If Object is Not Overlapping |  Set Opacity of Object to Object.Opacity + 1000*dt
    [/code:1m3t3yey]
    The first line says that if the object overlaps, keep subtracting from its opacity (fade out). The second line does the opposite. It keeps adding to its opacity (fade in). Replace 1000 with the speed of your fade.
  • Glad you were able to figure that out!

    I think a reasonable approach would be to have an instance variable for each action. Assuming a two-button game where you can move left and right, you might add the instance variables "leftButton" and "rightButton" to your "Player" family's instance variables. These variables will store the key codes for each action.

    Continuing this example, you could set P1's leftButton to 37 (which is the left arrow key) and the rightButton to 39 (the right arrow key). You could set P2's leftButton to 65 (which is 'A') and the rightButton to 68 (which is 'D'). Once each player on screen has a different set of controls, the following event logic will work to control the players:

    For each "Player"
       Key Code Player.leftButton is down   | Move "Player" Left
       Key Code Player.rightButton is down  | Move "Player" right[/code:2xcz1gqh]
    
    Basically it's asking each player what their button for a particular action is, then checking to see if that button is pressed. if it is, then do what needs to be done to that Player to execute that action e.g setting animations, moving the player, etc. In this manner, you can assign all of your controls.
    
    That's the basic approach. There could be a better one, but this might give you some ideas.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Look into Families. Create a Family called "Player", and then set the animation of "Player" to Idle, Run, Jump etc. You might need a "playerNumber" variable on the family so you can assign different controls to each player.

  • Could you give an example (pic or video) of the menu you want to make?

  • There ARE some behaviors you can't add more more than once, but Sine isn't one of them : )

  • It depends on what you're trying to do. The most flexibile way I feel is to use a tiled background and use modulus to keep it wrapping. You still have to use 'Set Y', but I don't know if you can avoid that. Here's an example that wraps on all 4 sides with two events. You can replace the tiled background with any image of any size and it'll still work with the same events. Hope this helps.

  • Give it two Sine behaviors. Set one to horizontal, and the other to vertical. Tweak the settings until you get the diagonal movement you want.

  • This is absolutely beautiful work. Thanks for sharing!

  • MrMiller, What!? Seriously!? Where? Please link me.

  • twg, How many HTML-5 game engines have you tried that do this? Does the jerky movement stop after a minute, or does it continue throughout the game? How severe is the jerkiness? How accurate is this simulation in regards to what you're experiencing with movement?

    I want to figure out whether you are experiencing the exact same thing as me, and whether it's truly the JIT compilation that's doing this. If it's the JIT compilation, then I have hope that this will be fixed in the coming months.

Dalal's avatar

Dalal

Member since 17 May, 2012

None one is following Dalal yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies