Create Continuously Scrolling Tiled Backgrounds (Textures)

1

Index

Stats

14,379 visits, 27,518 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 25 May, 2012. Last updated 19 Feb, 2019

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"

  • 0 Comments

Want to leave a comment? Login or Register an account!