DiegoM's Recent Forum Activity

  • Have you checked your Admob account? Maybe your application was flagged for some reason and is not being served ads. Nothing has changed on our side.

    As for preview showing ads... preview is pretty much the same as a web export, so it shows test ads as if the application was hosted on a website. They look very similar to a mobile exports ads, but are shown using a different library.

  • I can only guess what might the problem be because Admob doesn't really tell the developer anything when an ad is not served, so it's really hard to figure out anything at that point.

    Having said that, I don't know how often the ad requests are being made in your app, but Google Mobile Ads SDK (which takes care of the request under the hood) might just be ignoring them for iOS devices if it determines you are making too many.

    Try checking your Admob account for any hints about "limited ad serving" or something similar, maybe your app has been flagged for some reason and that's why not all requests get back an ad.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this:

    1. Remove the Wait from the top
    2. After creating each object set their Visibility to false
    3. After that add a Wait of "Some fixed value" * (loopindex + 1)
    4. After the Wait action, set the Visibility to true

    This should add a bunch of Wait actions each waiting more than the last. As the timers complete each instance will become visible, giving the illusion they are being created in a sequence instead of all at once.

    You can later change how the instances become visible so it is more interesting than them just becoming visible immediately.

  • Have you tried opening and closing your project in the latest beta? Just to verify if the problem still happens in that version.

    It is possible the problem has already been fixed. If it is fixed in the latest beta but you don't want to use beta versions, you will have to wait until the next stable release.

  • When you draw a tile, a model is created to represent it, it mainly has the position and the index of the tile. Those models are never actually deleted after creating them because it is infinitely easier to keep them around than figure out what needs to be recreated and with what information depending on what changes.

    Since the tile models don't hold any image data themselves they are rather lightweight memory wise. They could probably be made to be more compact if they where represented in some unorthodox way (thinking about storing all the information directly in an ArrayBuffer instead of a class so all the bits can be packed as neatly as possible and using static methods instead of class methods to reduce the memory footprint even further), I don't think it's worth the trouble though.

    When it comes to drawing, only the visible tiles are looked at, so that part is as efficient as it can be.

  • I think in the first snippet, the problem is a misunderstanding on how those events work.

    The mouse event is a trigger, so it is only executed when the left mouse button is clicked. So far so good...

    The following event is not a trigger, so it is executed every tick. That means that as soon as CanAttack is set to false the first time, the actions for CanAttack = false start executing every tick.

    So every tick you have this timer being setup to wait for 1 second and after that setting CanAttack to true.

    The problem with all of that is that by the time CanAttack is set to true the first time, a whole bunch of other Waits for 1 second actions have also been set up, and after each of those finishes, CanAttack will be set to true, making it seem the clicks are not setting CanAttack to false.

    If I understand correctly, to get the behaviour you want, you need to place all the actions in the Mouse trigger. That way CanAttack is set to false, then you wait for 1 second and after the wait is done you set CanAttack back to true. Because everything is in the trigger it will only happen when the mouse is clicked.

  • If you don't want to share your whole project, try removing as many things as you can from it, while still reproducing the problem.

    If you could share a trimmed down project, it would help a lot to solving this.

  • The crash suggests that there is a problem loading the state of a tween or a timeline. So maybe it has to do with a save being done while a tween or a timeline is playing and then there is a problem restoring that state.

    That might explain why it doesn't happen consistently... I am just guessing though, so the conditions that cause the crash might be different.

  • Can you share the project, and give steps to reproduce the problem?

    Without that it's very hard to figure these problems out.

  • As for criteria when arrays and generators are used... I think our Javascript API is just a little bit inconsistent in that regard, so you'll have to work with what you find in different parts.

  • The children method returns a generator function

    developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator

    The result of a generator function is an iterable that can be placed in a for of loop just like an array would.

    const ObjectA = runtime.objects.ObjectA.getFirstInstance();
    
    for (const child of ObjectA.children()) {
    	// Do things here
    }
    

    That is the most common way in which you will use generator functions and likely won't need to know more than that. If you want to know more about them I recommend looking at the MDN documentation.

  • I just tried using the new instance signals to get around signals not directly receiving parameters and it looks like you can set up what is effectively and Event-based observer pattern.

    At the end of your function create a new instance with the "Create Object" action, set any instance variables you want to be available in the "On Signal" triggers and then have the newly created instance fire the signal.

    The instance will then be available in the trigger with all the instance variables that where set.

    After firing the instance signal destroy the instance to save memory.

    It's pretty much the same as creating an event and then have a dispatcher fire it in traditional programming languages.

DiegoM's avatar

DiegoM

Member since 24 Apr, 2015

Twitter
DiegoM has 1,379,523 followers

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies

Blogs