AllanR's Forum Posts

  • any chance the animation speed for Down is zero?

  • you have more than one instance of enemy, so when you set the flash light to enemy.x there is no guaranty that it will set it to the enemy you want it to. You also have more than one light which further complicates things.

    you need to make sure you are only dealing with the correct instances. One way to do this is to make enemy a container and put the light in there, and then use for each enemy.

  • He probably wants the text spaced proportionally based on the width of individual characters, and then an option to left, right or center justify the text on the curve. I was thinking of taking a crack at it but don't have time today...

  • nicely done! :)

  • are the ControlL and ControlR the objects you want to stay on screen? they are on layer controls, so parallax for that layer should be 0,0.

    and you want those objects to start on screen so that they stay there - right now they are way down at the bottom, which is off screen for that layer after setting parallax to 0.

  • looks like fun :)

    In my example, gravity is constant so there is only one equation which makes it easy to apply an impulse to the bird and have it follow the curve. Having other things affect the trajectory will make it harder to follow the path / accelerate / decelerate. Good luck! The artwork looks fantastic.

  • one way would be to give the boxes an instance variable "Used" and set it to true when a selection is assigned to it. then when you go to assign the next selection, only pick the boxes where "Used" is false (and then pick a random instance from that set of boxes).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the remote preview only works as long as you have it running on your computer. You would have to export it and post it on a site somewhere for people to be able to play it (the Scirra Acrade is an option).

    To hold a variable number of cards, see this thread from a few months ago - and check out the sample I posted. It builds a deck of cards, shuffles it, and allows you to place as many as you want in a hand.

    https://www.construct.net/en/forum/construct-3/how-do-i-8/sort-deck-cards-half-circle-154988

  • the Load array from JSON statement should load the array from AJAX.Lastdata, not the tag name

  • in a tap blast type game, you don't have to worry about checking all the directions each piece can move. So, the logic should be easier... you also don't have to look for chain reactions. Doing hints would work pretty much the same.

    So, yes, it can be done.

  • the problem is the greater than 0 part. As the objects speed up, they will move more than a whole pixel each tick. So when the spawn code gets triggered the previous objects are further down the screen than what you want.

    Instead of spawning the new objects at -144, you should spawn them at the Y value of the previous row minus 144. that will leave no gap.

  • instance numbers are automatically assigned when the object is created. There is also a UID (unique id number) which you can pick by UID as well.

    what you want to do is add an instance variable - like I did in my file, I added a variable called CardValue (but didn't end up using it). You can then use that to pick cards.

  • I just copied and pasted digits from other cards in the C3 image editor - didn't put in any effort to line things up so they are not perfect... and then gave up at 15 because that was enough to get the point.

    I made 4 instances of "Card" on the layout and made them the same as the 4 you choose for your example - so testing would be easy.

    if you wanted to randomize it I would make a "CreateCard" function that would create the instance, pick a random card value (from 1 to the highest card number), and then load the instance variables from a master array (2 dimensional, where x is the card number, and then 4 y values).

    it gets a little trickier if you want to make sure there are no duplicate cards, or if you want to make sure there is a possible way to play all four cards...

    to make sure there are no duplicates, I would make a master deck of cards, and then randomly pick from that deck (deleting the card from that deck so it can't get picked again).

  • I took your sample file and simplified things - used one Sprite object "Card" and added animations for all the individual cards, and added instance variables for the 4 values.

    this eliminates a lot of duplicate code, and requires only one array "Current_Card".

    when a card is played, it loads the instance variables into the Current_Card array, then when another card is attempted to be played it uses IndexOf to see if any of the new card's values are in the array...

    https://www.rieperts.com/games/forum/shuffle_Cards_03.c3p

    CicadaGames solution should work fine (comparing every value in one array to each value in the second array) but I still think you should try to eliminate all the duplicate code and excess arrays.

    EDIT: fixed a bug - the reset function should reset the Current_Card array, and I decided to use array contains value instead of IndexOf to make the code a little easier to read.

  • I imported it to Construct3 and it looks fine there... plus web fonts are much easier to work with in C3. Don't know why C2 doesn't render it correctly, but I suspect there isn't much you can do about it.