dop2000's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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) {}
    
  • The easiest solution is to use TiledBackground for axis objects, set their width to 1000000 pixels and hope players won't reach the end :)

    Here is an example of infinitely scrolling bg:

    dropbox.com/scl/fi/pzwcxbqkpcbf2tova7pjt/InfiniteParallaxBG.capx

    Also, you need to use delta-time when you are moving objects, or they will move at different speeds on different framerates. Replace "Move 3 pixels" with "Move 180*dt pixels"

  • Ruskul Could you report it?

    Looks like "Pick children" condition is the culprit. Disabling "for each child" doesn't make much difference.

    Damn, this is awful.. I just checked - we have over 500 "Pick children" events in our project. This can explain some weird performance problems in the game.

  • I love hierarchies too, this should definitely be reported. I hope Ashley will fix it in LTS version.

  • Check out these examples:

    howtoconstructdemos.com/category/slide-bar

    Note, that for volume you'll need to use log10() expression:

    dropbox.com/scl/fi/5e5kyap5eqq6g7u1kfksb/VolumeSlider.c3p

  • Also how do I do I define "valid locations" since the map will evolve the valiud locations will also change.

    You will have to refresh the array with valid locations. Use a function to clear and re-populate the array. Call this function every time the map evolves.

  • Yes, right-click on the layout in the project view (the panel on the right) -> Copy. Right-click in another project -> Paste.

    Be careful though, if there are different objects with the same name in both projects, the whole thing may not copy correctly.

dop2000's avatar

dop2000

Online Now

Member since 26 May, 2016
Last online 29 Nov, 2024

Twitter
dop2000 has 250 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