WASD to move Don't give me credit, this was almost completely @SirProelium 's work. IN A NUTSHELL: 3000 random costumes are generated, 15 clones take on each costume based on the player's location, and the clones move around if they go off screen so it looks seamless. HOW IT WORKS (full explanation): First, the generator generates 15 random terrain, and amends them to the cost# list. That list comprises the level, and 3000 random terrain are inserted at the end. Every value is the costume number of the terrain piece. 'Tick' is a forever loop, executed in the 'Hitbox' sprite, and it makes the generation extremely rapid, resulting in 3000 values in 10 seconds tops. The interpreter takes these values, assignes every clone a scroll order and a line. The line# is the line number of a given index in the cost# list. It updates by 15 or -15 depending on whether the clone hits the right or the left edge, respectively. Then there is scrollX. It ranges from 0 - about infinity, really, and due to the fact that lists are infinite, scrollX has only a minimum value. ScrollX behaves inversely, so changing ScrollX by 1 moves the terrrain 1 pixel backward. The terrain constantly teleports to the coords of ScrollX + BLOCK_WIDTH times the Scroll_Order. This moves the block at, let's say, position 5 (where the scroll order = 1) times the pixel width of that costume (33, but to make it look smoother I use 32) plus the edge of the screen (about y = -240), which is changed by ScrollX, placing the block in the exact position relative to the player. The rest makes sure the block is the correct costume (by setting it to the costume number of its index in the list cost#) and checks to see if the block is off the screen. If it is, the block uses a lag-lessening trick I learned from @griffpatch where it changes its index (as previously explained) and translates its position to the opposite edge. This is to avoid using excessive cloning and deleting, and only 15 clones ever exist. Yeah...
OH MY GOD YAY IT WORKS I THINK Version 1.4 +All tiles are saved in a single list, and the tiles now run smoothly without resetting. +The game seems quite perfect...but what do I know... :| -Lag seemingly removed Version 1.3 *Changed a mechanic in how tiles generate +The world has 3000 tiles...don't even try to walk the whole thing... +Added lag...weird. Version 1.2 +Attempted to remove lag further -Removed loading icon's scripts -Removed ability to go backwards, world now has a border. *NOTE: To make the little cracks between blocks smaller, make the 'BLOCK_WIDTH' a smaller number Version 1.1 +Attempt at fixing bug where terrain has little lines through it Version 1.0 +Added more terrain types +Reduced lag (slightly) +Added ScrollX -Removed previous tracking code *Fixed bug where terrain has holes *Fixed random generation bug *Fixed all graphical terrain bugs *Changed respawn mechanics *Changed player speed