Rotating Tiles/Textures
This is very simple, it consists of creating a tiled background(texture) and applying a rotating behavious. The textures are sized very large so that if their point of rotation is on the edge of the layout, the texture edge still won't be scene.
Tutorial
- As before create the Tiled Background objects
- Add the object 'behaviour' rotate to each.
.
.
- Open up the events editor.
- Enter the code below
.
Note: The Tiled backgrounds are named generically here.
.
Explaination: So that the textures are always large enough, both their height and width has been set to twice the longest length or the layout (width in this case).
.
Please refer to the video tutorial, the Scirra Arcade upload or the .capz file for more information concerning these.
Please feel free to contact me if you have any questions.
.
.
-Adam
.
-----------------------------------------------------------------------------------------
Edits/suggestions:
1- As pointed out by 'Yann'. Instead of using each tick to time the movement of the texture. Use delta time (dt) instead to ensure smoother movement un-restricted to FPS. As suggested:
Quote:
"It would look like:
Global number speed = 100 // in pixel by second
Every tick -> set Y to Arrow_Small.Y speed*dt
Arrow_Small: Y > 0 -> Arrow_Small: set Y to self.Y-256"