dop2000's Recent Forum Activity

  • If you are talking about sample capx from this page, just replace "Browser Log" with "Text set text"

  • You need this plugin:

  • So your PlayerBox sprite is 32x32px.

    Create a new sprite, size 50x100, name it PlayerFallingBox. Add Pin behavior. Make it invisible.

    On start of layout set its position to PlayerBox and pin it to PlayerBox.

    Change your event to something like this:

    PlayerFallingBox on collision with Enemy

    (and) PlayerBox is Falling

    (and) PlayerBox.y<Enemy.y -> Subtract 1 from Health

    So this bigger PlayerFallingBox sprite will only be used to detect collisions when the player is falling.

    In all other events continue to use PlayerBox.

  • maxwell88

    Capx example displays everything in Browser's console log. Press F12 in the browser, you'll see.

    As I understand, you need to do this:

    Every time your game starts, load Timestamp from local storage. Paste today's date, save timestamp to local storage (AsJSON).

    To get the number of days in a row your app was played, use DateInARow.ContinuousCount( ) expression.

  • Check out the Time Away plugin:

    You can use it to check how long the app was inactive and award a number of points depending on this time.

  • You can add all such sprites to a family, this will allow to optimize some of your code.

    But you'll still need to have separate event for creating each of the sprite types.

    Construct 3 allows creating objects by their name - Create "RedEnemy".

  • Kudos to you! I'm terrible with graphics and visual effects..

  • mariogamer

    I'm confused.. How did you make this awesome game and yet asking these very basic questions?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1.) Those changes are very helpful and have increased performance dramatically, thank you. However, on overlapping rather than behaving as solid, when I change the units to divide their distance equally within their group, is that going to stop other units in other groups from crossing individual units within the first group?

    2.) The collsion checks don't need to be checked for every instance on the map, providing collision isn't an impassable (cliff/building) and would prevent pathfinding to detect it which would cause units to either go over/through it (with overlapping) or go to it and then need to recalculate pathfinding to go around it, which would look horrible and be inefficient.

    Sorry, I read these questions multiple times, but still don't understand them.

    Could you explain what all these triangle objects will be doing in your game? And why do you need to check if they collide with each other.

    3.) Although your solution works well, is my original method feasable? And if it is, I'm sure it could combind it with your solution.

    How did you learn about the skipping unnecessary checks?

    My solution is basically the same as your method. On tick 1 collision is checked for the first 20 instances. On tick 2 - for the next 20 instances. And so on.

    Run the project in Debug Mode. You'll see the number of collision checks is much lower when instances are spread and increases when they all move to the same point.

  • I tried Browser-> Execute JavaScript:

    var global = Function('return this')(); 
    
        document.onkeydown = function(){
    
        if(window.event && window.event.keyCode == 116)
                { return false; }
        }
    [/code:266tm0v5]
    
    It works, but only in Chrome.
  • You only asked how to save a value, you didn't ask how to load it <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    This is the bare minimum code:

    Also, have you tried googling? There are plenty of tutorials with good examples of using the local storage:

    https://www.scirra.com/tutorials/all

    In your capx you are not saving high score in Local Storage! You are saving and loading the entire game.

  • Do you really need to check for collisions between all 2000 instances? Cause that's millions of checks every tick, and I don't think any optimizations will help in this extreme case..

    I made some changes to your file, have a look:

    https://www.dropbox.com/s/q0im3vciif8u2 ... .capx?dl=0

    You should only use "Is Overlapping" with this method, don't use "On collision".

    And, of course, the more objects are added, the less often overlapping checks are performed for each of them, so the accuracy of collision detection will decrease.

    Also, interestingly, when instances are spread on the layout, the number of collision checks is lower, than when all instances are in one spot. I'm guessing the engine is skipping unnecessary checks for objects that are too far away from each other.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 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
  • x5
    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