As we revealed in the last blog, the idea for the game is basically to stop a dam bursting by keeping a giant cork in the hole. This cork blocking can be applied to many things in life which is the main reason we chose this as the winner. We like cork.
Currently the game screen layout is in the form of a very shoddy sketch in order to give 3D Phil an idea of where things will be. This is how it looks:
As you can see, that's a pretty wide image. This means we're going to need scrolling and you know we are going to get fancy on that. Over to 3D Phil to explain the code bits for the movement so far:
To start with I need to make the boy move left and right in the game area.
The Boy movieclip will move horizontally on the screen while the background movieclip moves in the opposite direction underneath him.
I will trigger a movement function from the keyboard events and pass a direction parameter: -1 for left and 1 for right.
The horizontal (x) position will increase when moving right and decrease when moving left.
mcx.boy_mc._x += (gamevars.boyspeed/2)*dir;
//level 1 background
mcx.bg_mc._x -= (gamevars.boyspeed*2)*dir;
mcx.rocks_mc._x -= (gamevars.boyspeed*2)*dir;
I will try to explain this.
is a game setting where I am storing a number that controls how much the boy moves each time. This is currently set to 3 pixels.
is a reference to the horizontal position of the boy clip.
this adds a number to the current value.
this equation takes half the value of boyspeed and makes it positive or negative by multiplying it by the dir(direction) parameter which is either -1 or 1
The background layers are moved in the opposite direction by using -= this subtracts a number from the current value.
This function will eventually have extra code to stop movement at the left and right limits of the game area.
Also we will include parallax scrolling, this is where we have more than one background layer that move at different speeds to create the impression of depth and perspective.
More sketches from the Wobble Box. Watch out for the cockney...
Working at the Fantasy Office, Ted has to take a trip through...
Aww. Hamsters. So cute and harmless.
Once upon a perfect peril...
So here it is! I'm starting Uni this September, and as...
A young boy faces the horrors of crack use through the smooth...
I can't think of the last good debut album, like really good, talented, pretty mainstream album. It seems all music that you hear is Cowell produced...
Posted by Mr stabby
So the recent Boston Marathon was the victim of a bomb attack by an as-yet unknown person or organisation. It has taken 3 lives so far and injured countless...
Posted by Mr stabby