# Thread: Help on how to make grid cells scroll at different speeds?

1. ## Help on how to make grid cells scroll at different speeds?

I have a game that creates randomized tiles spawn from the top of the screen. They move down one pixel every 0.01 second to create a scrolling effect. At the speed of 1 pixel, the generator creates perfectly spaced cells. However, when i increase the speed to 3 pixels instead of 1. The generator creates unaligned blocks with thin spaces in between the cells and eventually ruin the the perfectly spaced grid. I attatched the mfa file along with some screen shots. Please comment on how to solve this problem!

2. Hi,

I looked at it, and your right.. it does move it..
3 pixels be exact. the speed is going faster, but your also moving the squares.

Event 6, your changing the Y position of the blocks

3. Thanks for commenting Perry! But is there a way that I can change the speed in game from 1 pixel to 2 or 3 pixels and have no spaces created in between the squares?

4. Why don't you try just changing the layer ?
set the layout to -1 then you get a scrolling effect.
(like all the flappy etc clones)

let me get an example for you

5. Not sure what you mean. In my situation, the tiles are like walls, I have a player that moves around and other objects that directly interact with the walls. So I have to keep everything in a single layer.

6. Here is an example: https://www.dropbox.com/s/w34rvv0959...lling.mfa?dl=0

you can put it all in 1 layer. but it shows you how it moves and increasing the speed

7. I checked out the example. It didn't really solve my problem with the random spaces in between the squares, but thanks for trying!

8. What I was trying to get at was how you can do it this way too.
Now your moving the blocks with + 3 so yes, you will see gaps.
You need to use something else for moving the blocks
Like changing the speed from the item, not the Y co-ordinate. (See the word Speed )
so, the block needs to be set to somethine else (The movement type set to bouncing ball)

9. I updated the mfa with different code in order to fix the problem by using fast loops. I have a timer (alterable value) that will have 1 added to it always. When the time reaches 37, it creates another square. At speed 1x, it runs without any thin spaces in between each one. For the 3x speed, I made it so that instead of increasing the timer by 3 always, I made it start a loop 3 times. On each loop, it adds 1 to the timer. So 3 loops times 1 is adding 3 to the timer. But the problem is, event that checks to see if the timer is at 37 isn't checking in between fast loops. Is there a way I can have it check between the loops and create the block at 37 instead of skipping to 38 which creates the 1 pixel space?

I have the mfa here:
https://www.dropbox.com/s/kp8lm266lx...s%202.mfa?dl=0

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•