oosyrag's Forum Posts

  • You can add the available colors to an array, and delete the color out of the array after it is chosen. Use floor(random(array.width) to get a random array index

    You can also use the advanced random plugin to make a permutation table. A permutation table is a randomized list, so if you go through each index of the permutation table in order, you'll get nonrepeating random values.

  • Add the else condition to the second event.

  • I believe it goes in the URL itself, although I'm not particularly familiar with the API. This is what I'm assuming from glancing over it -

    https://translation.googleapis.com/language/translate/v2?key=MYKEY
    

    Edit: sorry auto format cut the url

  • The key is included in the query parameters. cloud.google.com/translate/docs/reference/rest/v2/translate

    Otherwise, you'll need to be authenticated through OAuth 2.0.

    developers.google.com/identity/protocols/oauth2/javascript-implicit-flow

  • Does running

    var win = nw.Window.get();
    win.maximize();
    

    on start of layout work? I don't have the full version export to nw.js to try it.

  • Put the green block onto a family. For each green block, check if overlapping family at all four orthogonal positions. If it is, add 1 to a counter variable. If the counter variable is greater than 2, delete the green block.

    Of course, this changes if the next block you check might have had more 3 adjacent blocks before deletion, so you've got a game logic issue to solve even before implementation. If you place a block that results in two adjacent blocks needing to be deleted, which one gets deleted?

    You might be able to get around this by flagging the block with another instance variable instead of deleting it right away, then delete all flagged blocks at the end of the tick.

  • I haven't tried it, but try setting fullscreen: true in package.json, per stackoverflow.com/questions/71073474/how-do-i-make-my-nw-js-application-start-in-fullscreen

  • It doesn't so much have to do with line of sight as states. Your home should not block los. Use an instance variable to keep track of the player is hidden or not. Upon entering the home, check line of sight, if no los, set hidden to true. Otherwise, hidden is false. Enemy attack should be based on Los and hidden state.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you've been using construct for 9 years and can't read that as conditions and actions, I can't help you. It's definitely not code in any sort of programming language.

  • + Mouse: On any click
    -> Sprite: Tween "" value from 1 to 0.5 in 1 seconds (Default, destroy: No, loop: No, ping pong: No, repeat count: 1)
    
    + Sprite: Is Tween "" playing
    -> System: Set layout scale to Sprite.Tween.Value("")
    
  • Try using the tween (value) behavior on a helper object, where start value is your current scale and end value is your target scale.

    While tween is playing, set layout scale to object.tween.value.

  • To center between multiple sprites, you can just enable scroll to on all of them.

    For zooming, you can set layout scale.

  • Personally I think that if you were invested in making a pinball game(s), importing and using a physics library would be the cleanest way. It would be more work up front but it should mostly be a one time thing.

    Teleporting the physics simulation ball to a separate location is a nifty idea! That seems like it would work well, as long as the physics simulation doesn't get thrown off with a sudden change in position from manually moving the object.

    Also add suggestion to implement/update the physics object and just wait. Box2d collision filtering is a thing that exists after all, we just don't have access to it through the official plugin.

    I'm not very familiar with the addon scene but I'm a little surprised there isn't a third party addon that uses an alternate physics library already. I guess physics is probably one of the more complicated things to implement after all.

  • You would usually use a cloud service to keep track of progress across devices. With a little creativity, I imagine you might be able to take advantage of high score or leaderboard type api to keep track of user progress.

  • You can write/save them to a variable or array as the data is received, and only display the results visually to the user when both are updated.