dop2000's Forum Posts

  • "for each instance" may not be bad if you don't have too many instances and not running this event on every tick.

    Generally, try to avoid events that are not triggered, i.e. run on every tick.

    Break your code into separate event sheets and groups. (EDIT: Sorry, didn't notice that you've already done this). Don't include unnecessary event sheets. For example, in your game layout don't include an event sheet from the main menu layout.

    Use Inspector in debug mode to identify which sheets/groups are using most CPU. Try temporarily disabling big parts of your code and see if this improves CPU usage. When you find most CPU-hungry events, rewrite them.

  • The order of events in your project is not right..

    Here is how I usually do this:

    In the loader layout (Titles) you need to wait for "Loader layout complete" event before doing anything else.

    When this event is triggered, I read all game settings from Local Storage. Instead of storing each value separately, I put them all in a dictionary, see this simple demo. After loading the dictionary, you can extract values to variables, if you want, see this screenshot.

    When settings are loaded (or not exist and default settings are used), only then I set audio volumes and start playing music.

    You don't need to load settings again, so don't do this on start of every layout.

  • Ashley I'm reading this tutorial on loader layouts in C3, and it says:

    Is this true? Is it possible that loader layout may sometimes be skipped in mobile apps and web games?

    I often use loader layouts to read data from local storage, request files with AJAX and decide which layout to load next. If loader layout is skipped, this will break my games...

    Tagged:

  • I think it's an outdated information. It also says loader layout is not shown in mobile apps, which is not true.

    I'm pretty sure loader layout is shown every time you run the game, even if its files have been cached on disk.

  • Repeat 10 times
     Create Enemy
     Set Enemy health to int(random(100,200))
    

    If it doesn't work for you, please post your code or project file.

  • I promise I'll think of it :)

  • Don't use Physics together with other non-physics movement behaviors like MoveTo and Rotate, they are not compatible and will be conflicting with each other, causing weird bugs.

    I made some changes to your project, take a look:

    dropbox.com/s/r270h45hgrifpxs/bouncyboss.c3p

    Pay attention to collision polygons, the polygon on Boss sprite was completely messed up.

    Because the boss is a line it doesn't reflect from walls well.

    You can try to further improve this by adjusting reflection angles, for example using raycasting feature of the Line Of Sight behavior. Before the collision with walls, cast a ray, save its reflection angle in a variable. On collision use this saved reflection angle value to set new velocity x and y. But it may be a difficult task, since the boss can hit two different walls with its two ends...

  • I'm using MobileFacebook addon from the Construct Master Collection. It has analytics. The collection is commercial and I don't think you can purchase an individual addon.

    .

    You can try adding cordova plugin "cordova-plugin-facebook4" to your project manually after the export, see this comment.

  • Simply open the capx from the tutorial in C3, right click on function name and select "Replace with built-in function". It will fix everything for you automatically.

    After replacing both functions you can delete the old Function object.

    Also, check out this post for more examples of thumbstick controls:

    construct.net/en/forum/construct-3/how-do-i-8/radial-thumb-control-mobile-148503

  • Just add Solid behavior to the tilemap. Or add the tilemap as a custom obstacle for Pathfinding. It's not much different from sprites.

    Here is a demo I made for some other post, it uses an invisible tilemap:

    dropbox.com/s/isnc7nm26ekdv8q/PathfindingFTL.capx

  • Are you talking about two objects with ScrollTo behavior? Or two scroll bars? Or sliders? Please post a screenshot of the code or a small example project.

    Also, an off topic question. How did you get your FB/Twit links in your profile?

    construct.net/en/profile/edit/social

    It took me a while to find this link too.. Not sure why it's not accessible through the menu.

  • Yes, you can build an obstacle map for Pathfinding with tilemap. Pathfinding cell size needs to be smaller than the tile size. Set tiles for walls, other tiles need to be empty, or have a collision polygon which allows to pass through them.

    Another option is to use EasyStar.JS plugin for tilemaps, it has tons of great features. See the last page for C3 link:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-easystar-js-pathfindi-96215

  • Wow, thanks for the offer! It will still take me some time to pick example projects and add descriptions to them. There are hundreds of projects in my dropbox, and of course not all of them are worth sharing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I suggest reading this tutorial, it explains how the project is loaded:

    construct.net/en/tutorials/how-to-use-loader-layouts-to-make-custom-loading-screens-179