lincolnsalles's Recent Forum Activity

  • And thanks mekonbekon

    E obrigado mekonbekon

  • Ziwer Black but that's how I did it as I posted up there that I found the answer. Thanks for the replies thanks. I will try the other TB method. Thanks for replying

    Ziwer Black mas foi assim mesmo que eu fiz conforme postei ali em cima que eu descobri a resposta. Obrigado pelas respostas obrigado. Vou tentar o método outro do outro TB. Obrigado por responderem

  • I had an idea to do with variables and it worked lol. I ended up finding the answer alone here.

    It looked like this:

  • I created a square with 4 animation frames and in start on layout I defined animation for stop.

    Each frame is the square missing a piece, from 0 to 3, 0 is the entire square and 3 is the most broken.

    I want it to be more broken with each click. But it's not working.

    Each click it changes the frame, but compare, if it is in frame 0 it changes to 1, if it is in 1 it changes to 2, and so on. But when I click it, it changes straight to frame 3. Why? Where am I going wrong?

    This test is just because I want to create different collision animations in the future, but it is not working.

  • E mais uma coisa, não precisa colocar os outros eventos, só essa linha de código da foto.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In this example he uses a speed variable that is worth 400. It would be the same as if he had said set y to TiledBackground.Y + 400 * dt. (Without the variable). So I hope you noticed that there is a global variable at the beginning of the event, if you didn't create the variable, nothing happens. You can just do it without the variable as I informed above. And you can use self in place of the object name, which is an expression that refers to the object itself, without having to type the name.

    It would look like this: set y to self.Y + 400 * dt (I tested it and it worked). And note that the tiled background must be twice the size of the layout (Always for this method), because when it reaches half the screen it goes back to the beginning. / But I said all this just for you to understand the operation and not just decorate.

    Simply use a tiled background the right size of the layout and in Every tick - / Tiledbackground - set image y offset- Self.ImageOffsetY + 400 * dt condition

    What is it? At each tick, select the tiled background object and choose the set image y offset action, which basically moves the tiled background object in the direction you want to repeat endlessly. It scrolls the image within the image itself, without needing to have an image twice the size. Then the code means self (the object itself and imageoffsety + add 400 to that scroll.

  • Dude, you're good lol. In fact I had gotten this answer from an experienced person a day ago, but I still hadn't posted it here on the forum because I waited to see if anyone had anything different. But the set offset really worked and it is an action only for the tiled background, it does not work for sprite, because the object does not move on the x axis, only the image inside the object. I'm using this and thanks for the reply.

    In that case I had to take my background drawings and open them as a tiled background. But in my project, he is an infinity runner and I expected to change the scenarios after a while with this scroll, without stopping the game. I imagine that this would be done by scrolling the x-axis of the background elements and everything. With this offset set I will have to replace the images to change the levels, instead of scrolling the scenarios. I'm still wondering what that would be like. But with his answer the topic came to an end of doubt. Thank you for the answer, you are right. Thanks.

  • Na verdade eu postei o código faltando um pedaço realmente eu coloquei a posição dos dois objetos conforme você falou e não só do BG. Então o problema não é esse. Mas o uso da família sim é uma boa ideia obrigado. Mas mesmo no seu exemplo, que já é o mesmo que o meu, só postei faltando, se alterar a velocidade de um só da erro. Eu procurei bastante e não encontrei um só tutorial que trate de background infinito tendo paralaxe no meio. Nenhum tem parallax. apenas o background rolando eu consigo fazer mas se eu tentar simular o parallax já era. Obrigado pela resposta. Ainda estou pesquisando.

  • Even if I use variable for speed x, and put different speeds for each element, it still gives an error.

  • Okay, I was actually researching a lot of videos and tutorials, seeing various ways to do this, I saw that I was really forgetting to multiply by dt (delta time). Nor was I referring to the set x the object's own position. Now it worked and see how my code is now: (I'm not able to post the photo)

    System - Every tick / BG - Set x to BG.x-400 * dt

                        / chao - Set x to chao.x-400 * dt

       BG - x- <512 / BG - Setx to BG.x + 1024

                        / chao - Setx to chao.x + 1024

    As you can see, I just didn't create the variable, I used the normal engine speed and it worked. It worked ok. But it had worked out before in other ways. But a problem remains.

    See that I have two layers, the floor and the BG (bottom). If I just change the speed of one of them to simulate a parallax, then it causes an error in everything and the type of a bug, which is all disconnected and becomes a huge white hole. If I return the two equal speeds it will be fine. I'm still trying to work this out.

    Thank you for your help. Now I have to resolve the speed difference issue, because I want 5 layers. But it is not working even with two.

  • The images do have transparent backgrounds, that's not it. The rolling of the mountain with the ground happens normally, only the error when I change the speed of the bullet property of one of the two. It only works if the ground and the mountain are at the same speed. This is weird. If I put 6 layers all at the same speed it will work, but I need different speeds to simulate the parallax

  • I know that there are many ways to do this, after tetting a lot, I got it that way.

    But I only partially succeeded. At the moment I have a ground and a mountain in the background. Here is an image of the layout and the event sheet:

    I put bullet behavior on the ground and on the mountain with speeds equal to -400. Until then, infinite scrolling normally works. But if I just slow down the mountain a little bit to create the illusion of parallax, then there will be an error in the rolling of the ground, appearing a white gap where I didn't have it before, as in the image below:

    Why does it happen?

    I've been trying to get the perfect background scroll for a while and I'm not going to stop until I get it perfectly, because I have a simple project that depends on it. I appreciate anyone who can help. My goal is to have 5 layers of parallax that way. I have also tried to do, instead of using bullet, set x of the object in every tick, but the same thing also happened. I'm using the bullet for now, since the same in your speed already comes with the right delta time, as the manual says? Thanks.

lincolnsalles's avatar

lincolnsalles

Member since 16 Aug, 2015

Twitter
lincolnsalles has 1 followers

Trophy Case

  • 9-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies