Okay, so I'm making a fly along type game.
I need for when the sprite comes in contact with the floor of the fly along game for the sprite to shrink into it. Causing an affect that makes it look like it is crashing into another planet. With the perspective being correct and everything. So the sprite would be at it's normal set size and then the nearer and nearer it gets towards the floor the smaller and smaller the sprite shrinks into the floor or planet. For example, a UFO landing onto planet earth, BUT this is a slide along game so it is a little bit trick I presume. Also, the floor I'm using, I made my own amazing earth floor, and it's 1400 x 80 so I want to know how I can let that repeat from the end of the image in the game. In other words, I want to know how to successfully and fluently wrap it with no choppy lookingness, Thanks.
Develop games in your browser. Powerful, performant & highly capable.
To repeat a background over and over again, I advise you to look at the "infinite runner" template, as it implements something similar.
As for the size of your sprite, the first question is : is your floor always at the same height on the screen ? If so, you just have to check the Y coordinate of your sprite every tick, and set the sprite size accordingly.
For example, let's say you have some Y1, the max height at witch the sprite will begin to shrink, and Y2 the min height, where the sprite should be 0px tall.
Then, the event you need is something along those lines :
System.Every tick (or every X second, X being small)
| If Sprite.Y < Y1 => Sprite.Set scale (1)
| Else Sprite.Set scale (1-(Y-Y1)/(Y2-Y1))
That way :