1 of 25

PRISON BREAK

ISHAAN P

2 of 25

AGENDA

  • Objective
  • Sprites
  • Costumes
  • Backgrounds Used
  • Explanation of Concepts
  • Code Sequences along with the Scratch concepts
  • Game

3 of 25

OBJECTIVE

  • The aim of this presentation is to guide the user in creating a ‘Prison Break’ Game in Scratch platform.
  • During this process, the user will understand the concepts of variables, broadcast, cloning, direction etc., features of Scratch.
  • The game is about a character trying to break out of prison, without getting caught.

4 of 25

SPRITES USED

Primary Gun

[M4LMG]

Secondary Gun [Renetti Pistol]

Bed in Cell

Weapons inside Bed

Inventory for weapons

Pistol

Primary Gun

5 of 25

SPRITES USED (CONTD.)

Jail Warden

Bullet

6 of 25

PLAYER SPRITE - COSTUMES

Primary Gun

[M4LMG]

Secondary Gun [Renetti Pistol]

Player

7 of 25

BED SPRITE - COSTUMES

Bed in Cell

Weapons inside Bed

8 of 25

BACKGROUNDS USED

Cell 1

Cell 2

Cell 3

Walking

Area

For

Warden

Door

Door

Walking

Area

For

Warden

Prison

Introductory Messages

Prisoner from Cell 2 will try to break out of prison

Prisoners from Cell1 and Cell 3 are not included in this presentation

9 of 25

CODE FOR BACKGROUND

This code will explain the situation of the game to the viewers

Message1 in the code

10 of 25

CODE FOR BED SPRITE AND PLAYER MOVEMENT

Use this code for the movement of the player

Make a costume named Bed

Then add this code to Bed sprite

11 of 25

CODE FOR PLAYER MOVEMENT – CELL RESTRICTION

The following code will restrict the player to his cell, until the player discovers the weaponry.

Note:

If Loop, Repeat Until and Forever are control blocks used.

The player gets restricted between these coordinates, indicating the cell boundary.

12 of 25

CODE FOR PLAYER MOVEMENT – CELL OPENED

Remember the broadcast message of Guns! add this code to It

Remember this from the previous slide? Now since the escape prison switch is set to 1, this code stops getting executed.

13 of 25

COSTUME FOR GUNS IN THE BED

Remember the bed in the slide 6? Make another costume when the player receives the broadcast of the guns.

[Any picture of a gun for the costume can be used.☺]

14 of 25

INVENTORY

  • The game needs an inventory. To add this, go to the paint option in the create a Sprite dialog box and paint a red background.
  • Add any colour which is light.
  • Then add a broadcast message named 'show inventory’ and Hide Inventory respectively.

15 of 25

INVENTORY – CONTD.

Code for Inventory Sprite to Show / Hide

Code to check the Key Pressed

16 of 25

COSTUMES FOR GUNS IN INVENTORY

We need to show the guns in the inventory, so make the respective costumes and show them.

17 of 25

CODE FOR SELECTING THE GUNS

Then add the same code for both the sprites In their respective place

Make sure you have a separate broadcast message for each.

18 of 25

The game needs a warden.

Make the Warden sprite as shown below

CODE FOR WARDEN

Add the following part of the code to the Warden sprite

19 of 25

  • We add a bullet sprite in the code.

CODE FOR BULLET

Selection of the Guns

is getting performed,

and the bullet accordingly.

20 of 25

Add the code to make the right sound during the bullet fire.

Play the sound until done block is used from sound section.

CODE FOR BULLET SOUND

21 of 25

Add the code for the bullet to actually go from the gun.

CODE FOR BULLET MOVEMENT

22 of 25

  • In the previous slide, when the bullet hits the warden, it reduces warden’s health. A variable is used for maintaining the warden’s health.
  • This code works in the beginning of the project.

CODE FOR VARIABLE CONTROL

23 of 25

This code explains that if the Warden’s health reaches to zero or less than zero, it sends a broadcast message to end the game.

CODE FOR VARIABLE CONTROL

24 of 25

CODE FOR FINISHING GAME

Code for Background

Code for Player

This code gets executed when the player gets discovered / caught by the Warden

This code gets executed when the player escapes successfully from the prison.

25 of 25

Now, Play the game; Also use it for your reference