

It is used in the incrementing process (updating the rendered element’s position)Ģ. x – the x-position of the element on the screen. ke圜ode – the value of the pressed key.Īpart from these, two more integers are declared within this function, which are as follows:ġ. step – an increment value by which the element is moved or scrolled, andģ.


img – an image file of the desired element,Ģ. Currently using only LEFT and RIGHT arrow keys as its input, its scope may be expanded with more keyboard and mouse controls.Īs can be seen from the algorithm, three inputs are required to execute the scrolling loop:ġ. Though the sketch is quite basic, it helps to illustrate the basic working of a side-scroller. In order to give the player a sense of depth, a parallax effect has been created by moving foreground and background elements at different speeds, giving a sense of depth. Hence, the biker(controlled by the player) appears to move due to the foreground and background elements moving behind it. In this sketch, the background elements(the road, the river, and the sky) move in response to the arrow keys pressed by the user. The display may be scrolled in several different ways – horizontally, vertically, or a combination of both. While side-scrollers have given way to FPSes(first person shooters) in the past two decades, they continue to be popular on smart-phones and other handheld devices. This game has laid the foundation for subsequent(as well as modern) videogames, whether side-scrolling or not, by incorporating secret levels to discover, power-ups to collect, and enemies to defeat – all within a fixed time frame and limited number of lives. Here, the player controls the protagonist Mario, who must race through all the stages in Mushroom Kingdom to save Princess Peach(US version: Princess Toadstool), while smashing bricks, collecting coins and power-ups, and defeating the antagonist Goombas(mushrooms) and Koopa Troopas(turtles). The most iconic game title in this genre is Super Mario Bros., a platformer game that was developed and published by Nintendo for the NES(Nintendo Entertainment System) platform. This technological feat was achieved Tomohiro Nishikado, the game’s designer, who also incorporated sprites and collision detection in this racing arcade game. Side-scrollers have been in existence since the early 1970s, with Speed Race(1974) being the first game to use a scrolling display, albeit a vertical one. Here, the player controls the biker’s direction (along with the background behind it) using the LEFT and RIGHT arrow keys. This month’s discussion is dedicated to BikeRoller – an endlessly scrolling sketch.

The common element in all of these games is a display that scrolls in response to the player’s input. The term ‘side-scroller’ now encompasses all videogames that utilize a side-view angle of the camera in the gameplay. In fact, it surprised me to find that I could program a side-scroller – a hitherto complex interface – within 90 lines of code, and decided to write about it. The Processing IDE continues to impress me with its visual capabilities and intuitive functions.
