Underdog's Recent Forum Activity

  • Problem Description

    I tried to insert a new value "SUPER" in a 2D array on X and a value "100" on its Y .

    In the array, it duplicates "SUPER" (even if I add a value on Y axis)

    I might have done something wrong, since I'm not familiar with Arrays.

    Attach a Capx

    ____ sorry can't upload it ____

    Description of Capx

    Really basic. I have a 2D array and tried to insert a value in XY.

    When touched [Sprite]

    ArrayName >> insert "SUPER" at index ArrayName.At(index) on X axis

    Example:

    arrUnits >> insert "SUPER" at index arrUnits.At(arrUnits.IndexOf("unit5")) on X axis

    Steps to Reproduce Bug

    • Create a 2D array (XY) width 6, height 2, depth 1
    • On start of the layout, fill the array X & Y (with the value you desire. I used "unit0" to "unit6" on X and some values 1-100 for Y)
    • Add a touch event on Sprite
    • On touched Sprite, Insert "SUPER" on X and insert "100" on Y

    Observed Result

    ____ What happens? ____

    Notice that "SUPER" is written 2 times in the array (through the debugger)

    Expected Result

    ____ What do you expect to happen? ____

    Having "SUPER" written once, and 100 following SUPER

    like:

    index0: unit0,5

    index1: unit1,3

    index2: unit2,4

    index3: SUPER,100

    index4: unit3,2

    Affected Browsers

    • Chrome: (YES/NO) YES
    • FireFox: (YES/NO)
    • Internet Explorer: (YES/NO)

    Operating System and Service Pack

    ____ Your operating system and service pack ____

    Windows X Familly - Intel(R) Core (TM) i7-4770 CPU 3.4 GHz

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using

    Release 239 also tested in r243

    ____

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I gave up trying to spawn new objects. I found another solution by using animation.

    I just Set Angle as already described and I set Width to distance(Startposition / Endposition) and play an animation in loop.

    Yes, it slightly deforms the blocks of the animation because we scale the width but the feel is there.

    I'm also thinking having different animations triggered by the distance in order to keep the blocks on the same size but, I don't know if it really requires it!

  • So... marching ants!

    I don't have an exact answer or time to work on this now... but if I were to try this, I think I would start with a lerp function for a straight line movement, and a qarp function for a curved line.

    Here's a reference - what-are-lerp-qarp-and-cubic-for-the-nonmath_t64198

    Hey Oosyrag,

    I tried different approaches with lerp and qarp, I still meet the same issue. Because my object (Bars) has a Bullet behaviour, when their angle change toward the new direction, they rotate from their pivot point. I don't know how to find a way to make them rotate from the same another point. I tried with Pin behaviour, creating a dummy object so I can pin my spawned object. But here again, they rotate around their image point (pivot).

    Here is a capx of what I tried for example:

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

  • Any help is always welcome

    Thanks, I will take a look at it.

  • Hi everyone,

    I try to create several objects from Touch Start Position that rotate toward Mouse Position.

    They also move toward Mouse Position.

    The issue is that I would like to change the pivot point of the created objects so they rotate from the Start Position. So, all my objects rotate and stay aligned.

    I tried several approaches such as Set angle(StartX,StartY,Mouse.X, Mouse.Y), tried Pin behaviour by creating a sprite from Start Position and Pin the objects in different modes such as Angle, Rope, Bar style and I can't make it work like I imagine.

    The idea is kind of simulating the same effect of the arrow in Hearthstone. I already did the example of the nice tutorial posted 2 years ago but it does not have the curve effect that I try to reproduce with animation.

    Thank you if you have any idea

  • Thank you Korbaach, your help was useful I understood the concept. It works well!

  • Hi everyone,

    I was following the tutorial "Array for Beginners" by Ramones.

    https://www.scirra.com/tutorials/307/ar ... ers/page-3

    This tuto is old and uses Web Storage that has been replaced by Local Storage.

    I was able to save the array in the local storage but I can't load it!

    Here is what I have done:

    On saveArray Button clicked ---> LocalStorage ---> Set item "01" to animals.AsJSON

    On loadArray Button clicked ---> (Array) Animals ---> Load from JSON string "01"

    I was expecting the entry text that displays what is in your array be filled by the Array loaded?

    What should I do?

    Thank you for your help

  • Oh Shinkan, thank you so much. You can't imagine how much time you just saved me

  • Hi everyone,

    is there a way to automatically crop all frames of one animations?

    Crop is really useful but I wonder if we can automatize this action?

    Thank you

  • Hi guys,

    Probably, my question was to vague.

    I would like to add a Multiplayer Turn Based aspect in my game, like a Chess Game.

    I found this tutorial

    Multiplayer Tic-tac-toe [C2][Web2py(Python)][AJAX][Cross-domain]

    https://www.scirra.com/tutorials/1062/m ... ain/page-1

    However, I don't want to be real time. I would like the First Player does all his moves and then, posts it to the "WEB" so, other Players can try to beat it.

    Depending on the result, both Players will receive rewards.

    Which 1st step do you consider me to do?

    Which other tutorial do you think I should look at?

    My Multiplayer programming skill is almost null, so any tutorial references will help me a lot.

    Even a Step by Step to look at will help me.

    Thanks again

  • Hi guys,

    In my game, I would like to give the opportunity to the Players to create challenges that they can post on a server for other Players.

    Depending on their success, they earn XP - Currency and even Legendary Items.

    Do you know if we have a tutorial that could explain how to create a Map for example and post it for other players?

    It could be anything, non necessary a map. What I am looking for is how to share game content generated by players for other players.

    Is it possible with CS2?

    Thanks!

  • robertjs3

    It works with a variable that I set to 0 before it spawns the projectile and once the animation is finished, I set it back to 1.

    Thanks again guys!

Underdog's avatar

Underdog

Member since 1 Feb, 2013

None one is following Underdog yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies