I am quite pleased with the variety of projects that my Code Club students are creating for our showcase in May. Everything from a maze, pong, virtual pet, dress-up to adventure and sports games. There’s even a game of games project idea that will be interesting to see develop.
One duo was wanting to make a game where the hero stays mostly in the center and the background scrolls before he gets to the edge. Something like Power Pete (or Mighty Mike) from Pangea Software (those were good times, hours wasted)
At first I recalled the scrolling demo project from Colleen Berekey. There are over 50 remixes of this project. I showed the pair this project but it wasn’t quite what they had in mind.
So I went home and thought about it and consulted my consultant – my spouse who’s a software engineer. Like with other tricks to animation, coding this was a matter of changing perspective and looking at the problem from a different point of view.
If your Sprite stays in the middle, the background and chaser Sprites will have to move with the arrow keys. Or more specifically, against the arrow keys.
Scratch Cat stays in the center and only points in the direction of the arrow key. The stars move in the opposite direction briefly and then move back to center. This took some fiddling with to get it to look half way decent. In addition the octopus has to move in the opposite direction while still moving forward towards Scratch Cat.
For added fun I included additional bad guy clones.