mekonbekon's Recent Forum Activity

  • Here are three different ways you can spawn random objects:

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

    Method 1) Add objects to a family and then spawn the family object - a family member will be picked at random.

    Method 2) Save different animations on a sprite and then choose a random animation after spawning.

    Method 3) Save different frames to an animation on a sprite and then choose a random frame after spawning (remember to set the animation speed to 0 in the sprite settings).

  • Hi armaldio, is this plugin is still operational, and if so does it play nicely with PhoneGap or Cocoon.io exports?

  • Hi all,

    I'm currently developing a tool that uses speech synthesis - the HTML5 export runs fine in most browsers, but are there any known limitations/issues if I was to do a Cordova export and wrap with PhoneGap or Cocoon.io for Android and iOS?

    Thanks in advance for any help you can offer.

  • I just cooked up this test:

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

    It tests 3 different cases:

    1) 1 sprite, 10 frames on 1 animation

    2) 1 sprite, 10 animations with 1 frame

    3) 1 family, 10 sprites, 1 frame on 1 animation

    The sprites (or the family in case 3) have bullet and sine behaviours.

    The test spawns an instance every tick until the framerate dips below 50 fps. I compared the total number of sprites spawned before the test maxed out.

    Results: Cases 1 and 2 ran about the same, but case 3, using the family, spawned about 10% more instances, so it seems that in this test having multiple sprite objects with less animations/frames is more efficient than less sprite objects housing multiple animations.

    Bear in mind that I was hitting over 2600 sprites before it stopped in all three cases on my laptop, so for most purposes you're probably better off going the route that allows you to most efficiently organise your code and assets.

  • In some (but not all) situations there are gains to be made in performance by limiting the total number of different sprites objects in your game, but there are also other good reasons for containing multiple objects on a single sprite, mainly by making your project a little more readable and simplifying the code requirements.

    There are a few factors to consider before determining what the best solution would be:

    1) I would tend to only include objects on the same sprite that appear on the same layout as you would otherwise be filling up your memory for each layout with unnecessary art assets.

    2) I would only include objects on the same sprite that have simple behaviours and use the same basic logic e.g. all inventory items, otherwise your code will become overly complex trying to differentiate between the objects when you could instead just refer directly to a specific sprite.

    3) If there were groups of objects that appeared on different layouts with similar behaviours, or objects with quite complex behaviours and multiple animations on the same layout, then I would prefer to put them on separate sprites and add them to a family so that I can still use the same code groups to control them.

    4) In certain circumstances I would use the individual frames on a single animation for different objects e.g. scenery objects, non-animated pick-ups. This also makes it quicker to import graphics as you can import a sprite strip to a single animation instead of individual frames to separate animations.

    5) It is much easier to perform actions like spawning random objects when they are on a single sprite: for example, if I had 10 pickups and wanted to spawn a random one then if the pickups were on separate sprite objects I would need to assign a random number to a variable to determine the pickup and then have a string of 10 conditions to spawn the correct one; if instead I had each pickup on a single frame or animation then I just spawn the sprite and pick a random frame or animation - 2 actions on 1 event as opposed to 10 conditions.

  • Try Construct 3

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

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

    You're welcome

  • You're welcome

  • Glad to have helped

  • How about this?:

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

    It doesn't use any tweens, just checks the relative distance between the input and the spawn point.

  • Would this work for you?:

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

    No need for a spawner, everything works off the block behaviours. I've also included a check to move the avatar out of the block if it resolidifies whilst they're overlapping.

  • You've also got an FPS value in debug.

    If your fps is low but CPU is also low, then it's a good indication that the GPU is killing your framerate.

    Also, rather than testing in debug, stick a text object in the layout displaying (FPS&", "&cpuutilisation) and run normally - should give a more accurate performance reading than debug

  • I'm guessing you could test this quite easily by setting up two projects with the different settings and check in the debug mode.

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies