brunopalermo's Forum Posts

  • I would use sine behavior for that. Either for X or for value only and using the values.

  • You could use the "On animation ended" condition for that.

  • Also, if you have a variable undetermined number of cards, you might have an array for the table and push the card used to its front or back.

    Every hand you would do something like this:

    tableCards array set size to 0,1,1
    
    on card clicked
        if tableCards.Width % 2 = 0 | tableCards push cardId on FRONT
        else                         | tableCards push cardId on BACK
    
    redraw table
    [/code:1cvd5i72]
    
    Hope this helps. Cheers!
  • I just tested our friend's example.

    But if I put random (0,100) and the first result is 56 per example, only numbers will be generated below that, I lose the rest of the numbers.

    Yeah, but the 56 itself is random... It's just an anchor from which all numbers are created. You're not "losing" anything, it's just that randomness picked them out that time.

    bruno's example would fail if z ended up being 0. Also it could still give three consecutive numbers.

    You're right, I missed that. Sorry.

  • Ok...

    Let's say you want three non-consecutive numbers between 0 and 99.

    You could try something like this:

    z = random(100)
    y = random (z - 1))
    x = random(y - 1)
    [/code:jjh1mz0u]
    
    This will return a sequence in which z>y>x, that is, they're in ascending order from x to z.
    
    Hope this helps. Cheers!
  • Is there a specific range? Also, is the offset always 1?

  • Hey Klarner

    Not sure if you're talking about the ricochet effect itself or the visual effect of the bullet tracing... If it's the ricochet, the bullet behavior does that for you if you select Bounc off solid objects. Here's an example:

    https://www.dropbox.com/s/uw9glaiu6zorz ... .capx?dl=1

    If it's the visual effect, there are a few possible approaches: particles, creating "breadcrumbs behind your bullet or even using a line for the bullet instead of a dot.

    Hope this helps. Cheers!

  • marceloborghi,

    It seems it's you who's not getting what she said, actually. As far as I understood, she already has an API KEY, she just doesn't want to share it here, so she used a wildcard for the purpose of posting her question. No big.

    Can you share a capx, irina? As far as I can see it should be working fine.

    Cheers!

  • So I wanted to do a pac man maze and at first I thought to draw over one with a tilemap and then give the solid behavior to the walls but it's quite a pita since it's hard to keep the same proportions of the original. Then I found this tutorial for Unity where he adds multiple collision boxes on the same maze. How would you do it on C2?

    https://noobtuts.com/unity/2d-pacman-game

    You can do the same in Construct 2. You create a sprite for colision box, set its initial visibility to invisible and position like in teh Unity tutorial.

    That said, I, myself, would go for a tileset approach. I believe its better.

    Cheers!

  • The capx is a bit confusing. But it seems to me the main problem is you reset global variables on ES_GameOver and you try to add Money to Total money Earned on the begining of the levels. You should add it BEFORE reseting the variables.

    Besides that, there's a lot you could easily improve in your capx. Specially in regards to structure. You could do without it, but most probably it will bring more problems similar to this one in the future. It may be wise to just pause development right now, design the screenflow and everything on paper, then go back and implement it. I could help you with that. Feel free to contact me via private message. And you can do that in spanish, as I speak spanish quite well.

    Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It shouldn't be a problem. Global variables are persistent between layouts. Can you share a capx.

  • I don't think it's possible. Anyway, if you share why you need to create a new layout on runtime someone might be able to find a workaround or even a better solution. I, myself, can't think of any situation in which you'd need to create a new layout...

    Cheers.

  • Hey Methuselah!

    This may be not exactly what you want, but I had this capx with card game related functions. One of them organizes the player's hand. It might help you to make your own.

    https://www.dropbox.com/s/anbtxlrdk2n1l ... .capx?dl=1

    Hope this helps. Cheers!

  • Add the condition "Trigger once while true" to the event that checks the condition for playing the sound.

  • [pt-br]

    Oi andersonfg!

    Tu podes compartilhar o .capx pra eu dar uma olhada?

    Outra coisa, no forum não é permitido escrever em português a não ser que você inclua uma tradução em inglês do texto, como eu fiz aqui, ok?

    Falou!

    [en]

    Hey andersonfg!

    Can you share the .capx so I can take a look?

    Another thing, you can't post in portuguese here, unless you provide a translation of your message, as I did here, ok?

    See ya!