The background has been developed and although is empty and plain works well when tiled and won't be distracting for the player as they focus on the game. The colour scheme also helps to link it to the bronze and grey colors typically associated with the steam-punk theme.
Before setting up the background the basic structure of the game needs to be worked out. By default is you select create a game on touchdevelop the first line of code is already present and this uses the Game library. The games start function creates by default three lives and they are displayed in the top left hand corner of the screen however as this game has only one life they are not necessary and have been hidden from view.
Next to ensure that nothing falls off the bottom or top of the screen obstacles where created they prevent sprites from moving past that point and even work to bounce sprite off of them.
Now that the basics have been coded next is the background itself. the scrolling background code was based off of another scrolling code however edited to scroll horizontally instead of vertically this original code was part of a Touch Develop tutorial and can be found here
Firstly the background had to be duplicated into 2 images Back 1 and Back two and variable were declared below.
Finally we add the scroll action this action is run in the game loop and constantly ensures that the background follow each other.

Thanks Kaylah for this post. You have obviously thought well ahead to anticipate some of the problems that will exist when creating a game like this ie obstacles to stop your player running off the screen never to be seen again.
ReplyDelete