dop2000's Recent Forum Activity

  • So you have coin -> particle object -> effect sprite. The effect sprite is always spawned at the particle object position. If you know which coin the particle object is attached to (say with hierarchy or pin), you can accurately pick that coin.

    EffectSprite On Created
    Particle X=EffectSprite.x
    Particle Y=EffectSprite.y
    Particle pick parent Coin
    

    or simply:

    EffectSprite On Created
    EffectSprite is overlapping Coin
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use relative paths like ".keyname" to access values.

  • So what JSON string do you see in browser console?

    Not sure why you are storing each object as an array. Try this instead:

    Use "Set Value" action instead of "Push"

  • On the first screenshot - remove "Wait 0.2" and "Wait for previous action to complete", they are not needed.

    On the second screenshot - you are saving values to Local Storage on every tick, this is a big no-no. Local Storage operations are asynchronous, they require time to complete. You are basically reading and writing values in Local Storage at the same time, this is why they reset to default.

    You should only save to LS when it's safe to do so. For example, at the end of the level.

  • The only solution I can think of is to check which coin is the nearest (or overlapping) when the effect object is created.

  • I think you need to disable unbounded scrolling in layout properties.

  • So you need to smoothly change the parallax from 0% to 50% for example? You can use lerp, but it needs to run on every tick:

    Every tick: Set layer "foo" parallaxX to lerp(LayerParallaxX("foo"), 50, dt*2)

    It may be easier to use Tween behavior - add it to any object, ran a value tween from 0 to 50. While it's running, set layer parallax to tween value. With tween you will be able to choose different easing functions, which is not possible with lerp.

    I'm not sure what can be done about "pixel perfect".

  • Can someone confirm that Create and Destroy are asynchronous actions? I did not expect that.

    No, they are not. "Wait for previous action" in this case works similar to "Wait 0" - it delays the execution until the end of the tick. But I don't recommend using "Wait for previous action" like this, because in some rare cases it may actually wait for some other async action to finish.

    The problem with Create and Destroy actions is that they are not performed instantly. Until the end of the event or end of the tick object counters may not be updated, and other events (or functions you call) may not be aware of the created or destroyed instances.

    There are a few ways to work around it:

    1. Add "Wait 0" after Create action. This will delay until the end of the tick, so use with caution as it may break the logic.

    2. Pick newly created instance by UID or using "System Pick Last Created" condition.

    3. Use the next top-level event to update the counters.

  • Using the layout name in the function call sadly won't help me because I also have a Pause menu that appears in most layouts. Some layouts have both the pause menu and another menu.

    I think you can still use that system. Say, if the game is paused, try to call function inputPressed_layoutname_PauseMenu

    If it doesn't exist (catch branch in the script) - call inputPressed_Common_PauseMenu

  • Speaking of controls, in our game I collect inputs from different devices (keyboard, mouse, gamepad, touch), and have a bunch of functions which mimic Keyboard/Gamepad conditions and return 0/1 value:

    One benefit of this approach is that these functions can be used in complex expressions, for example:

    Functions.OnKeyPressed("Confirm") | (Functions.OnKeyPressed("Use") & Player.isFlying=0)

  • Yeah, I miss the flexibility of old functions. I used similar callback-style functions in C2 projects.

    I think the nearest solution with C3 function is to use some universal naming system for them and call them by name. For example, you can have functions inputPressed_layoutname:

    inputPressed_Level1

    inputPressed_Level2

    inputPressed_Menu

    Then you can call the function for current layout using a bit of scripting:

    try { runtime.callFunction("inputPressed_"+runtime.layout.name, localVars.keyCode) }
    catch(e) {}
    
dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 247 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x4
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies