Hi everyone, today I am going make a tutorial on how to create what is sometimes called bumpy bgs. Before we start, there is a few things I would like to get straight. Firstly, yes I did not fully invent this technique, but I am making a tutorial on it, so please give me some credit, if you decide to use this. Right, here goes nothing.
Create a new hopscotch project, add a blank text object. Open the code editor for this text object, and add a function: When Game Starts. Then, add the Set — to variable block. Create a new variable, and call it size. Set this new variable to 100. This is going to be the thing that controls how big the trail is. So far your code should look like this:
Now we need to create enough clones to fill the whole screen. Select the function When <. Select the first box on that function, and chose the ready made variable, Self Total Clones then, in the second box, enter a large number, I would suggest somewhere between 500-1000. To many clones may make your device crash, and to little may not fill the screen, so choose reasonably. The in the enter code section, enter the block Create A clone of this object. Your code should look something like this:
Now choose the function: When Object is cloned. Then enter the block: Set— to. Create another variable for self, called size. The place this variable in the — part of the block. Now choose the set position black, and enter the following: x= Random 0-iPad width, Y= Random 0-iPad height. Your code should look like this:
Now in the same function, select the block: repeat times and enter 100 in to the amount. Now select the draw a trail block, and enter the width as the variable we created earlier: self size. Replace the move forward block with move forward 0. Then add the block: increase variable self size by -1. For the colour of the trail, mess around, fluke it. But I suggest something along these lines: h: self x position, s: self y position and b: 100. Your code should look like something like this:
Play the project, and see what happens. If you don’t like the colours, change the HSB values, and see if you can make something nice, tag me on this topic if you make this! It makes an excellent first project, or can be used as a background for a game. Check out my other tutorials, on backgrounds on my profile. Any comments? Leave a post below.
Want to join my tag list or leave? Just tag me and tell me. The actual versions of the bgs are slightly down on my profile, so go check them out for inspiration. Here’s a link to one of them, and if you follow the code above exactly, you will make this.
Here are other variants I have made:
Oh and also, an elipsy warning.