dop2000's Forum Posts

  • You can add Drag&Drop behavior to the Boombox sprite in my example, move it around and see if the sound area follows it. (it does)

  • Yeah, character position could be saved in an array on every tick, and then "replayed".

    However, if there are lots of other moving objects, saving movement history for all of them could be a nightmare.

    Here is a plugins that may help:

    https://c2rexplugins.weebly.com/rex_tarp.html

    plugin-time-action-recorder-and-player_t79821

  • I really don't understand why there is no "Spawn" action. It's not a deal-breaker, you can always use "Create object" instead.

    Other than that I think SpriteFont is very similar to sprite.

  • Please post a screenshot of your event sheet, or share your capx.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can also use instance variable to store array's UID.

    Add a couple of helper functions for setting/getting values in array by its UID and voilà - you have your array in instance variable.

  • No, you created something very weird <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I forgot to tell you that before playing the sound, you should check that it's not already playing.

    Anyway, here is the working example:

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

  • Thanks for the capx. So what's happening is when at least 1 enemy has line of sight, "Else" event is not executed for other enemies, which don't have LOS.

    You need to change your event to this:

  • If you are talking about the project size or performance, then no, adding Browser object doesn't affect that.

  • [quote:3w4z38dp]So when the enemy loses line of sight and doesn't have sight to anything else it should follow the ELSE code and set SeesEnemy to 0 along with EnemyX to 0 and EnemyY to 0, and then find path to its target (didnt screenshot that part)

    The error could be in that part. Could you share the screenshot of all events related to line of sight and pathfinding?

  • If by "using code" you mean "using events", then this works:

    Button Set Text to "?"

    If you meant "by numeric code of a character", add Browser object and try this:

    Variable charCode=981
    Button Set Text to Browser.ExecJS("String.fromCharCode("& charCode &")") 
    [/code:1qkt1a7i]
  • Not exactly...

    Your variable DistanceSoundBomb changes from 0 (complete silence) to 1 (full volume).

    If distance between objects is 1000 pixels or more, then it will be 0.

    You can change "1000" in that formula to 50 or whatever number you want.

    For playing/stopping sound you should use these events:

    System->Compare two values -> distance(detector.x, detector.y, bomb.x, bomb.y) is less than 50 -> Play sound

    System->Compare two values -> distance(detector.x, detector.y, bomb.x, bomb.y) is greater than 60 -> Stop sound

  • Ok, and where will you get the data to put into these arrays?

    You need to read this data from somewhere - a text file with JSON strings, or CSV file, or XML, or maybe request it from a server etc.

    I would probably use CSV - you can create a table with all values in Excel, save as CSV and import to C2. You can do the same with the lists of categories/animations.

    Also, you should probably re-think the whole idea of how you store all these pictures.

    10 animations with lots of frames, different values for each frame, plus all of them divided into categories - this mess will be very difficult to manage.

    Maybe instead of animation and frames, consider importing all images as files into your project.

    So you'll have a bunch of files (001.jpg - 199.jpg for example) and two empty sprites.

    In your CSV file you'll have the list of all images (001 - 199), list of categories for each image, points value for each image:

      001, Animals, Birds, , 7 002, People, Professions, Celebrities , 12 etc.

    Load data from CSV into an array or dictionary. When user selects a category, find a random image in the array from this category, load its picture into your sprite using this action:

    Sprite1 load image from URL "123.jpg"

    Check tutorials, I think I seen something similar there, some picture quiz game.

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

    As for the repetition issue, you can simply delete images from the array after they have been used.

  • Check out SpriteFont, I think it should suit your task.

    I recommend SpriteFont+ plugin (slightly better than the official SpriteFont) and SpriteFontGenerator tool, you can create beautiful and unique fonts for your games.

    SpriteFont object behaves like sprite, you can resize it, fade, rotate, add behaviors, effects, pin to other sprites (flowers) etc.

  • Sure, you can start audio playback on collision with some sprite.

    Or compare distance(character.x, character.y, gold.x, gold.y)

    Say, if distance <500, start audio.

    If distance >600, stop audio.

  • msha91

    Oddly, I'm only getting this error in Chrome, in other browsers it works fine.

    In event 8 move "Remove all physics joints" above the "Sprite set physics disabled".

    This should fix it.