Games24

Video Transcript

So far our game has logic. But it's pretty easy.

Dog movement is not limited at all, so it can easily and quickly reach the bone.

A maze would put obstacles in the dog's movement and would make it difficult for the game.

Let's create a new sprite.

Let's call it a "maze".

I will pick the tool line, and after adjusting the color and width I will begin my painting.

Start from the outer outline.

To plan the interior walls, make sure you have 3 important details

The corridors you create will be large enough to allow both the dog and an identical sprite to pass side-by-side.

Your lines should be parallel and vertical to the walls of the outer outline.

Hold the shift key when you want to achieve this. And use the eraser if necessary in order to erase small projections of the walls that can block the movement.

Let me draw. Music please!

Very nice!

Let me now place this sprite right at the center of the stage..

If I run the script now there will be no interaction between the maze and the dog.

The dog will just run through the walls.

We will change that immediately.

Let's bring on the dog's scenario again.

We want to move the dog - If it touches the maze then the movement is reversed.

The dog's movement is 5 steps, if everytime it touches the maze we have it move 5 steps in the opposite direction, then it will actually remain still.

This is exactly how the maze will work as a wall. Let's now see it in action.

I will try the movement first with the right arrow on the keyboard.

If it touches the maze Move 5 steps backwards.

Let's try it..

Very nice!

I have to add these instructions into the movement the other arrows available to the sprite.

Scroll to Top